summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-03 00:29:13 +0000
committerDevang Patel <dpatel@apple.com>2008-09-03 00:29:13 +0000
commitbcd39345debb8c3007a3cac575db900eff9e2725 (patch)
treec68d9633b4ce1ff43a1c895390124fca7af9187c /llvm/lib
parentc5d330400fd473e709f42036080bba7a4b7e48a8 (diff)
downloadbcm5719-llvm-bcd39345debb8c3007a3cac575db900eff9e2725.tar.gz
bcm5719-llvm-bcd39345debb8c3007a3cac575db900eff9e2725.zip
Add additional check to ensure that iv is canonicalized.
llvm-svn: 55682
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 16b8dbb451f..96fa0e9eb16 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1935,6 +1935,7 @@ void LoopStrengthReduce::OptimizeIVType(Loop *L) {
ConstantInt *CInit = dyn_cast<ConstantInt>(PHI->getIncomingValue(Entry));
if (!CInit) return;
+ if (!CInit->isZero()) return;
bool signedInit = CInit->getValue().isNegative();
OpenPOWER on IntegriCloud