Remove setPreservesCFG from instcombine. The pass, in particular, does not
authorMark Heffernan <meheff@google.com>
Tue, 4 Nov 2014 01:51:01 +0000 (01:51 +0000)
committerMark Heffernan <meheff@google.com>
Tue, 4 Nov 2014 01:51:01 +0000 (01:51 +0000)
preserve LoopSimplify because instcombine may replace branch predicates
with undef which loop simplify then replaces with always exit.  Replace
setPreservesCFG with the more constrained preservation of DomTree and
LoopInfo.

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

lib/Transforms/InstCombine/InstructionCombining.cpp

index 5a0b01eca5c5f043645b53c5f3ba996b33e7cc0b..4b7f841e2cdabda7b81e6d417d0b838e5f223688 100644 (file)
@@ -90,7 +90,8 @@ INITIALIZE_PASS_END(InstCombiner, "instcombine",
                 "Combine redundant instructions", false, false)
 
 void InstCombiner::getAnalysisUsage(AnalysisUsage &AU) const {
-  AU.setPreservesCFG();
+  AU.addPreserved<DominatorTreeWrapperPass>();
+  AU.addPreserved<LoopInfo>();
   AU.addRequired<AssumptionTracker>();
   AU.addRequired<TargetLibraryInfo>();
 }