Invoke SimplifyIndVar when we partially unroll a loop. Fixes PR10534.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137203 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick
2011-08-10 04:29:49 +00:00
parent bddb7f8210
commit 39f40299a6
3 changed files with 64 additions and 5 deletions
+1 -4
View File
@@ -79,6 +79,7 @@ namespace {
AU.addPreservedID(LoopSimplifyID);
AU.addRequiredID(LCSSAID);
AU.addPreservedID(LCSSAID);
AU.addRequired<ScalarEvolution>();
AU.addPreserved<ScalarEvolution>();
// FIXME: Loop unroll requires LCSSA. And LCSSA requires dom info.
// If loop unroll does not preserve dom info then LCSSA pass on next
@@ -187,12 +188,8 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
}
// Unroll the loop.
Function *F = L->getHeader()->getParent();
if (!UnrollLoop(L, Count, TripCount, TripMultiple, LI, &LPM))
return false;
// FIXME: Reconstruct dom info, because it is not preserved properly.
if (DominatorTree *DT = getAnalysisIfAvailable<DominatorTree>())
DT->runOnFunction(*F);
return true;
}