indvars: drive by heuristics fix.

Minor oversight noticed by inspection. Sorry no unit test.

llvm-svn: 160422
This commit is contained in:
Andrew Trick 2012-07-18 04:35:13 +00:00
parent c08726627c
commit 0d07dfcd6f

View File

@ -1409,7 +1409,7 @@ FindLoopCounter(Loop *L, const SCEV *BECount,
// If two IVs both count from zero or both count from nonzero then the
// narrower is likely a dead phi that has been widened. Use the wider phi
// to allow the other to be eliminated.
if (PhiWidth <= SE->getTypeSizeInBits(BestPhi->getType()))
else if (PhiWidth <= SE->getTypeSizeInBits(BestPhi->getType()))
continue;
}
BestPhi = Phi;