mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-28 06:37:14 +00:00
Get the number of bits to set in a mask correct for a shl/lshr transform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35357 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dce8d9cf99
commit
d5e30f0a01
@ -5858,7 +5858,7 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
|
||||
BinaryOperator::createLShr(X, ConstantInt::get(Ty, ShiftDiff));
|
||||
InsertNewInstBefore(Shift, I);
|
||||
|
||||
APInt Mask(APInt::getLowBitsSet(TypeBits, ShiftAmt2));
|
||||
APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2));
|
||||
return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user