mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
When checking that the necessary bits are zero in
order to reduce ((x<<30)>>24) to x<<6, check the correct bits. PR 8547. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -131,9 +131,9 @@ static bool CanEvaluateShifted(Value *V, unsigned NumBits, bool isLeftShift,
|
||||
// We can turn shl(c1)+shr(c2) -> shl(c3)+and(c4), but it isn't
|
||||
// profitable unless we know the and'd out bits are already zero.
|
||||
if (CI->getZExtValue() > NumBits) {
|
||||
unsigned HighBits = CI->getZExtValue() - NumBits;
|
||||
unsigned LowBits = TypeWidth - CI->getZExtValue();
|
||||
if (MaskedValueIsZero(I->getOperand(0),
|
||||
APInt::getHighBitsSet(TypeWidth, HighBits)))
|
||||
APInt::getLowBitsSet(TypeWidth, NumBits) << LowBits))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user