diff options
author | Chris Lattner <sabre@nondot.org> | 2007-03-04 04:27:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-03-04 04:27:24 +0000 |
commit | f964f321ebe1ed17530aeb4876f20b2406155230 (patch) | |
tree | 10e45027c88eb6d3caabdb721f5e2b36d6fbc689 | |
parent | 55091782c14286750eebe148cb9e5668b06812e0 (diff) |
Speed up -instcombine by 20% by avoiding a particularly expensive passmgr call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34902 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index ce8230d086..07ffb19277 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -74,6 +74,7 @@ namespace { 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 @@ static bool DeadPHICycle(PHINode *PN, std::set<PHINode*> &PotentiallyDeadPHIs) { // 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::DoOneIteration(Function &F, unsigned Iteration) { bool InstCombiner::runOnFunction(Function &F) { + MustPreserveLCSSA = mustPreserveAnalysisID(LCSSAID); + bool EverMadeChange = false; // Iterate while there is work to do. |