fix overflow check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56011 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2008-09-09 20:54:34 +00:00
parent 0d95267e49
commit 4b3f08bac7
2 changed files with 49 additions and 2 deletions

View File

@@ -1551,8 +1551,7 @@ ICmpInst *LoopStrengthReduce::ChangeCompareStride(Loop *L, ICmpInst *Cond,
// Check stride constant and the comparision constant signs to detect
// overflow.
if (ICmpInst::isSignedPredicate(Predicate) &&
(CmpVal & SignBit) != (CmpSSInt & SignBit))
if ((CmpVal & SignBit) != (CmpSSInt & SignBit))
return Cond;
// Look for a suitable stride / iv as replacement.