summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-03 00:10:56 +0000
committerDevang Patel <dpatel@apple.com>2008-09-03 00:10:56 +0000
commita9348dc7acc6f292425721c178311d7b0b5144b6 (patch)
tree37f6a290428ef0860c18a24cddbc61f79a350767 /lib/Transforms/Scalar
parentc3f44b0d636ff9a6d706ea9ac17ae77c8fa8aeff (diff)
downloadexternal_llvm-a9348dc7acc6f292425721c178311d7b0b5144b6.zip
external_llvm-a9348dc7acc6f292425721c178311d7b0b5144b6.tar.gz
external_llvm-a9348dc7acc6f292425721c178311d7b0b5144b6.tar.bz2
Check iteration count.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index b2c5977..16b8dbb 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1908,6 +1908,10 @@ BinaryOperator *getNewPHIIncrement(BinaryOperator *Incr, PHINode *PHI,
/// change the type of IV, if possible.
void LoopStrengthReduce::OptimizeIVType(Loop *L) {
+ SCEVHandle IterationCount = SE->getIterationCount(L);
+ if (isa<SCEVCouldNotCompute>(IterationCount))
+ return;
+
BasicBlock *LPH = L->getLoopPreheader();
BasicBlock *LatchBB = L->getLoopLatch();
SmallVector<PHINode *, 4> PHIs;