diff options
author | Dan Gohman <gohman@apple.com> | 2009-05-24 23:25:42 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-05-24 23:25:42 +0000 |
commit | d594e6f0345b3e1e4b640a7099596ca613da16d6 (patch) | |
tree | c9ab0d07f9aeac3c437e49475182988a41c2dcbe /lib/Transforms | |
parent | c046c00d0a1f65483a8c69f26c66fc74f5228332 (diff) |
Change ScalarEvolution::getSCEVAtScope to always return the original value
in the case where a loop exit value cannot be computed, instead of only in
some cases while using SCEVCouldNotCompute in others. This simplifies
getSCEVAtScope's callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 7300bf47fe..ca7aa7bd30 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -275,10 +275,8 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L, // Okay, this instruction has a user outside of the current loop // and varies predictably *inside* the loop. Evaluate the value it // contains when the loop exits, if possible. - SCEVHandle SH = SE->getSCEV(Inst); - SCEVHandle ExitValue = SE->getSCEVAtScope(SH, L->getParentLoop()); - if (isa<SCEVCouldNotCompute>(ExitValue) || - !ExitValue->isLoopInvariant(L)) + SCEVHandle ExitValue = SE->getSCEVAtScope(Inst, L->getParentLoop()); + if (!ExitValue->isLoopInvariant(L)) continue; Changed = true; |