summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-04 19:26:19 +0000
committerChris Lattner <sabre@nondot.org>2005-08-04 19:26:19 +0000
commit0f7c0fa2a7dfc7f04937c856c379375a551e342c (patch)
treec36c3c91205c558fbab6b3ddb503546d271d29ba /llvm/lib/Transforms
parentacc42c4df18fcb0a4b0e3fe168862fe6db8c92b2 (diff)
downloadbcm5719-llvm-0f7c0fa2a7dfc7f04937c856c379375a551e342c.tar.gz
bcm5719-llvm-0f7c0fa2a7dfc7f04937c856c379375a551e342c.zip
Fix a case that caused this to crash on 178.galgel
llvm-svn: 22653
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 7b743e230e8..dfe72c11fcd 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -415,6 +415,12 @@ static SCEVHandle GetImmediateValues(SCEVHandle Val, bool isAddress, Loop *L) {
return GetImmediateValues(SARE->getStart(), isAddress, L);
}
+ if (!Val->isLoopInvariant(L)) {
+ // If this is a loop-variant expression, it must stay in the immediate
+ // field of the expression.
+ return Val;
+ }
+
return SCEVUnknown::getIntegerSCEV(0, Val->getType());
}
OpenPOWER on IntegriCloud