Dial back the speculative fix for PR8954 a bit, so that we only recompute dominators
authorCameron Zwarich <zwarich@apple.com>
Tue, 11 Jan 2011 22:14:42 +0000 (22:14 +0000)
committerCameron Zwarich <zwarich@apple.com>
Tue, 11 Jan 2011 22:14:42 +0000 (22:14 +0000)
once at the beginning of GVN instead of once per iteration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123278 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVN.cpp

index 279211d4080179f5c40fadec510fe75615fc43dd..014341b867d14998467b0a58b5a56f1db65cd4a4 100644 (file)
@@ -1754,6 +1754,9 @@ bool GVN::runOnFunction(Function& F) {
 
   unsigned Iteration = 0;
 
+  // FIXME: Remove this when PR8954 is fixed.
+  DT->DT->recalculate(F);
+
   while (ShouldContinue) {
     DEBUG(dbgs() << "GVN iteration: " << Iteration << "\n");
     ShouldContinue = iterateOnFunction(F);
@@ -2011,7 +2014,6 @@ bool GVN::iterateOnFunction(Function &F) {
        RE = RPOT.end(); RI != RE; ++RI)
     Changed |= processBlock(*RI);
 #else
-  DT->DT->recalculate(F);
   for (df_iterator<DomTreeNode*> DI = df_begin(DT->getRootNode()),
        DE = df_end(DT->getRootNode()); DI != DE; ++DI)
     Changed |= processBlock(DI->getBlock());