From e925ccc553e95cf348455b4ba1dca1fd5981f5bb Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 3 Sep 2008 00:29:13 +0000 Subject: [PATCH] Add additional check to ensure that iv is canonicalized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55682 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 16b8dbb451f..96fa0e9eb16 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -1935,6 +1935,7 @@ void LoopStrengthReduce::OptimizeIVType(Loop *L) { ConstantInt *CInit = dyn_cast(PHI->getIncomingValue(Entry)); if (!CInit) return; + if (!CInit->isZero()) return; bool signedInit = CInit->getValue().isNegative();