summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-24 23:25:42 +0000
committerDan Gohman <gohman@apple.com>2009-05-24 23:25:42 +0000
commit8ca0885d69ed4c41f9df940f7da72b3adc8193e3 (patch)
tree29e38bc746f7ad0b812233dc6db46c1d5bfe1a30 /llvm/lib/Transforms
parentac149ee60a9443533f6415b1d72af77bbdb9a561 (diff)
downloadbcm5719-llvm-8ca0885d69ed4c41f9df940f7da72b3adc8193e3.tar.gz
bcm5719-llvm-8ca0885d69ed4c41f9df940f7da72b3adc8193e3.zip
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. llvm-svn: 72375
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 7300bf47fe7..ca7aa7bd30d 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud