Stop trying to have instcombine preserve LCSSA form: this was not
authorDuncan Sands <baldrick@free.fr>
Wed, 27 Apr 2011 10:55:12 +0000 (10:55 +0000)
committerDuncan Sands <baldrick@free.fr>
Wed, 27 Apr 2011 10:55:12 +0000 (10:55 +0000)
effective in avoiding recomputation of LCSSA form; the widespread
use of instsimplify (which looks through phi nodes) means it was
not preserving LCSSA form anyway; and instcombine is no longer
scheduled in the middle of the loop passes so this doesn't matter
anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130301 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/InstCombine/InstCombinePHI.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp

index 6b3c14558431e9b2a2ac2b801e1d8e037cb45ef4..9c70cf89e48c8a64310f4c71d3bc208aacf70fbe 100644 (file)
@@ -70,7 +70,6 @@ class LLVM_LIBRARY_VISIBILITY InstCombiner
                              : public FunctionPass,
                                public InstVisitor<InstCombiner, Instruction*> {
   TargetData *TD;
-  bool MustPreserveLCSSA;
   bool MadeIRChange;
 public:
   /// Worklist - All of the instructions that need to be simplified.
index 8419db68f4fba11eb0e7dfb81c70b2551d0a0aa0..abf61bbaf3a6e806703dfa2de472ca273a6cf783 100644 (file)
@@ -774,9 +774,6 @@ Instruction *InstCombiner::SliceUpIllegalIntegerPHI(PHINode &FirstPhi) {
 // PHINode simplification
 //
 Instruction *InstCombiner::visitPHINode(PHINode &PN) {
-  // If LCSSA is around, don't mess with Phi nodes
-  if (MustPreserveLCSSA) return 0;
-
   if (Value *V = SimplifyInstruction(&PN, TD))
     return ReplaceInstUsesWith(PN, V);
 
index 4be671f031e45f28e34bcb04ab51b7dc28496559..7a84598c3a0d565f583e9684d7a9641cc75065d2 100644 (file)
@@ -76,7 +76,6 @@ INITIALIZE_PASS(InstCombiner, "instcombine",
                 "Combine redundant instructions", false, false)
 
 void InstCombiner::getAnalysisUsage(AnalysisUsage &AU) const {
-  AU.addPreservedID(LCSSAID);
   AU.setPreservesCFG();
 }
 
@@ -1637,7 +1636,6 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
 
 
 bool InstCombiner::runOnFunction(Function &F) {
-  MustPreserveLCSSA = mustPreserveAnalysisID(LCSSAID);
   TD = getAnalysisIfAvailable<TargetData>();