Fix a small bug, some 80 cols violations, and add some more debugging output.
authorOwen Anderson <resistor@mac.com>
Tue, 5 Jun 2007 17:31:23 +0000 (17:31 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 5 Jun 2007 17:31:23 +0000 (17:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37436 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVNPRE.cpp

index 2bedd1cdea592e8ed3087d3b5791a7068e2262e6..b34239d6a612c910c4334be47e0d3894bce141c1 100644 (file)
@@ -354,6 +354,10 @@ bool GVNPRE::runOnFunction(Function &F) {
                       currTemps, currAvail, availableOut);
   }
   
+  DOUT << "Maximal Set: ";
+  dump_unique(VN, maximalSet);
+  DOUT << "\n";
+  
   PostDominatorTree &PDT = getAnalysis<PostDominatorTree>();
   
   // Second Phase of BuildSets - calculate ANTIC_IN
@@ -384,10 +388,12 @@ bool GVNPRE::runOnFunction(Function &F) {
       std::set<Value*, ExprLT> old (anticIn.begin(), anticIn.end());
       
       if (BB->getTerminator()->getNumSuccessors() == 1) {
-         if (visited.find(BB) == visited.end())
+         if (visited.find(BB->getTerminator()->getSuccessor(0)) == 
+             visited.end())
            phi_translate_set(VN, maximalSet, maximalSet, BB, anticOut);
          else
-           phi_translate_set(VN, maximalSet, anticipatedIn[BB->getTerminator()->getSuccessor(0)], BB, anticOut);
+           phi_translate_set(VN, maximalSet, 
+             anticipatedIn[BB->getTerminator()->getSuccessor(0)], BB, anticOut);
       } else if (BB->getTerminator()->getNumSuccessors() > 1) {
         BasicBlock* first = BB->getTerminator()->getSuccessor(0);
         anticOut.insert(anticipatedIn[first].begin(),