diff options
author | Owen Anderson <resistor@mac.com> | 2010-11-01 21:08:20 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-11-01 21:08:20 +0000 |
commit | 648b20d5dbc54391f0d38c6ff16cf304bf3cb297 (patch) | |
tree | b24a5a8786d39d2ce346f466553bf4082f1dc6dd /lib/Transforms/InstCombine/InstCombineShifts.cpp | |
parent | 99f535242c71d795c11bf54aa6d30ddbed465e9a (diff) | |
download | llvm-648b20d5dbc54391f0d38c6ff16cf304bf3cb297.tar.gz llvm-648b20d5dbc54391f0d38c6ff16cf304bf3cb297.tar.bz2 llvm-648b20d5dbc54391f0d38c6ff16cf304bf3cb297.tar.xz |
When folding away a (shl (shr)) pair, we need to check that the bits that will BECOME the low
bits are zero, not that the current low bits are zero. Fixes <rdar://problem/8606771>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineShifts.cpp')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineShifts.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineShifts.cpp b/lib/Transforms/InstCombine/InstCombineShifts.cpp index 27716b886a..012d238729 100644 --- a/lib/Transforms/InstCombine/InstCombineShifts.cpp +++ b/lib/Transforms/InstCombine/InstCombineShifts.cpp @@ -157,7 +157,7 @@ static bool CanEvaluateShifted(Value *V, unsigned NumBits, bool isLeftShift, if (CI->getZExtValue() > NumBits) { unsigned LowBits = CI->getZExtValue() - NumBits; if (MaskedValueIsZero(I->getOperand(0), - APInt::getLowBitsSet(TypeWidth, LowBits))) + APInt::getLowBitsSet(TypeWidth, LowBits) << NumBits)) return true; } |