From: Chris Lattner Date: Thu, 18 Aug 2005 17:35:14 +0000 (+0000) Subject: Enable critical edge splitting by default X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=36b708f05720c407f5e5657f2fd4b0677702ad46;p=oota-llvm.git Enable critical edge splitting by default git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22863 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 6ba00bccdf8..e234e12268f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -36,11 +36,6 @@ #include using namespace llvm; -static cl::opt -SplitPHICritEdges("split-phi-constant-crit-edges", cl::Hidden, - cl::desc("Split critical edges for PHI values that are constants")); - - #ifndef _NDEBUG static cl::opt ViewDAGs("view-isel-dags", cl::Hidden, @@ -966,8 +961,8 @@ unsigned SelectionDAGISel::MakeReg(MVT::ValueType VT) { } void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const { - if (!SplitPHICritEdges) - AU.setPreservesAll(); + // FIXME: we only modify the CFG to split critical edges. This + // updates dom and loop info. } @@ -979,15 +974,14 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) { // First pass, split all critical edges for PHI nodes with incoming values // that are constants, this way the load of the constant into a vreg will not // be placed into MBBs that are used some other way. - if (SplitPHICritEdges) - for (Function::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) { - PHINode *PN; - for (BasicBlock::iterator BBI = BB->begin(); - (PN = dyn_cast(BBI)); ++BBI) - for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) - if (isa(PN->getIncomingValue(i))) - SplitCriticalEdge(PN->getIncomingBlock(i), BB); - } + for (Function::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) { + PHINode *PN; + for (BasicBlock::iterator BBI = BB->begin(); + (PN = dyn_cast(BBI)); ++BBI) + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) + if (isa(PN->getIncomingValue(i))) + SplitCriticalEdge(PN->getIncomingBlock(i), BB); + } FunctionLoweringInfo FuncInfo(TLI, Fn, MF);