Exemple #1
0
void MethodCodeSelector::genCFG(U_32 numNodes, CFGCodeSelector& codeSelector, 
                                   bool useEdgeProfile) 
{
    ControlFlowGraph* fg = irManager.getFlowGraph();
    fg->setEdgeProfile(useEdgeProfile);

    CfgCodeSelector cfgCodeSelector(sa, compilationInterface, *this,
                        codeSelectorMemManager,numNodes, irManager);
    { 
        AutoTimer tm(selectionTimer); 
        if( NULL == irManager.getEntryPointInst() ) {
            irManager.newEntryPointPseudoInst( irManager.getDefaultManagedCallingConvention() );
        }
        codeSelector.genCode(cfgCodeSelector);
    }
    {
        AutoTimer tm(fixNodeInfoTimer); 
        irManager.expandSystemExceptions(0);
        cfgCodeSelector.fixNodeInfo();
    }
    {
        AutoTimer tm(blockMergingTimer); 
        fg->purgeEmptyNodes(false, true);
        fg->mergeAdjacentNodes(true, false);
        fg->purgeUnreachableNodes();
    }
}
Exemple #2
0
void IpfMethodCodeSelector::genCFG(U_32           numNodes, 
                                   CFGCodeSelector &codeSelector, 
                                   bool             useProfile) {

    IPF_LOG << endl << "  Select CFG" << endl;
    IpfCfgCodeSelector cfgCodeSelector(cfg, nodes, opnds, compilationInterface);
    codeSelector.genCode(cfgCodeSelector);
}