[llvm-commits] CVS: llvm/lib/Transforms/Scalar/GVNPRE.cpp

Owen Anderson resistor at mac.com
Tue Jun 5 10:31:45 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

GVNPRE.cpp updated: 1.18 -> 1.19
---
Log message:

Fix a small bug, some 80 cols violations, and add some more debugging output.


---
Diffs of the changes:  (+8 -2)

 GVNPRE.cpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Scalar/GVNPRE.cpp
diff -u llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.18 llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.19
--- llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.18	Mon Jun  4 18:34:56 2007
+++ llvm/lib/Transforms/Scalar/GVNPRE.cpp	Tue Jun  5 12:31:23 2007
@@ -354,6 +354,10 @@
                       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 @@
       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(),






More information about the llvm-commits mailing list