mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-26 13:36:28 +00:00
Even if there are not any induction variables in the loop, if we can compute
the trip count for the loop, insert one so that we can canonicalize the exit condition. llvm-svn: 13015
This commit is contained in:
parent
6d5decd7d4
commit
5c85946417
@ -368,7 +368,17 @@ void IndVarSimplify::runOnLoop(Loop *L) {
|
||||
|
||||
// If there are no induction variables in the loop, there is nothing more to
|
||||
// do.
|
||||
if (IndVars.empty()) return;
|
||||
if (IndVars.empty()) {
|
||||
// Actually, if we know how many times the loop iterates, lets insert a
|
||||
// canonical induction variable to help subsequent passes.
|
||||
if (!isa<SCEVCouldNotCompute>(IterationCount)) {
|
||||
ScalarEvolutionRewriter Rewriter(*SE, *LI);
|
||||
Rewriter.GetOrInsertCanonicalInductionVariable(L,
|
||||
IterationCount->getType());
|
||||
LinearFunctionTestReplace(L, IterationCount, Rewriter);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Compute the type of the largest recurrence expression.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user