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
This commit is contained in:
Devang Patel 2008-09-03 00:29:13 +00:00
parent a9348dc7ac
commit e925ccc553

View File

@ -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();