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

Chris Lattner sabre at nondot.org
Sat Mar 3 20:27:44 PST 2007



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.642 -> 1.643
---
Log message:

Speed up -instcombine by 20% by avoiding a particularly expensive passmgr call.


---
Diffs of the changes:  (+4 -1)

 InstructionCombining.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.642 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.643
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.642	Fri Mar  2 23:27:34 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Sat Mar  3 22:27:24 2007
@@ -74,6 +74,7 @@
     std::vector<Instruction*> Worklist;
     DenseMap<Instruction*, unsigned> WorklistMap;
     TargetData *TD;
+    bool MustPreserveLCSSA;
   public:
     /// AddToWorkList - Add the specified instruction to the worklist if it
     /// isn't already in it.
@@ -7685,7 +7686,7 @@
 //
 Instruction *InstCombiner::visitPHINode(PHINode &PN) {
   // If LCSSA is around, don't mess with Phi nodes
-  if (mustPreserveAnalysisID(LCSSAID)) return 0;
+  if (MustPreserveLCSSA) return 0;
   
   if (Value *V = PN.hasConstantValue())
     return ReplaceInstUsesWith(PN, V);
@@ -9344,6 +9345,8 @@
 
 
 bool InstCombiner::runOnFunction(Function &F) {
+  MustPreserveLCSSA = mustPreserveAnalysisID(LCSSAID);
+  
   bool EverMadeChange = false;
 
   // Iterate while there is work to do.






More information about the llvm-commits mailing list