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

Nick Lewycky nicholas at mxc.ca
Tue Oct 3 09:52:41 CDT 2006



Changes in directory llvm/lib/Transforms/Scalar:

PredicateSimplifier.cpp updated: 1.16 -> 1.17
---
Log message:

Move break-crit-edges before the predicate simplifier. Allows us to
optimize in more cases.


---
Diffs of the changes:  (+3 -7)

 PredicateSimplifier.cpp |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)


Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.16 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.17
--- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.16	Thu Sep 28 18:35:21 2006
+++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp	Tue Oct  3 09:52:23 2006
@@ -500,8 +500,10 @@
 }
 
 void PredicateSimplifier::getAnalysisUsage(AnalysisUsage &AU) const {
+  AU.addRequiredID(BreakCriticalEdgesID);
   AU.addRequired<DominatorTree>();
   AU.setPreservesCFG();
+  AU.addPreservedID(BreakCriticalEdgesID);
 }
 
 // resolve catches cases addProperty won't because it wasn't used as a
@@ -622,13 +624,7 @@
                                              PropertySet &NextPS) {
   assert(edge < TI->getNumSuccessors() && "Invalid index for edge.");
 
-  BasicBlock *BB     = TI->getParent(),
-             *BBNext = TI->getSuccessor(edge);
-
-  if (BBNext->getSinglePredecessor() == BB)
-    visitBasicBlock(BBNext, NextPS);
-  else
-    visitBasicBlock(BBNext, CurrentPS);
+  visitBasicBlock(TI->getSuccessor(edge), NextPS);
 }
 
 void PredicateSimplifier::proceedToSuccessors(PropertySet &KP,






More information about the llvm-commits mailing list