From a9348dc7acc6f292425721c178311d7b0b5144b6 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 3 Sep 2008 00:10:56 +0000 Subject: Check iteration count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55680 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Transforms/Scalar') 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(IterationCount)) + return; + BasicBlock *LPH = L->getLoopPreheader(); BasicBlock *LatchBB = L->getLoopLatch(); SmallVector PHIs; -- cgit v1.1