forked from OSchip/llvm-project
[ValueTracking] computeKnownBitsFromShiftOperator use KnownBits direct for constant shift amounts.
Let KnownBits shift handlers deal with out-of-range shift amounts.
This commit is contained in:
parent
185cface2e
commit
49623fa77a
|
@ -993,8 +993,7 @@ static void computeKnownBitsFromShiftOperator(
|
|||
computeKnownBits(I->getOperand(1), DemandedElts, Known, Depth + 1, Q);
|
||||
|
||||
if (Known.isConstant()) {
|
||||
unsigned ShiftAmt = Known.getConstant().getLimitedValue(BitWidth - 1);
|
||||
Known = KF(Known2, KnownBits::makeConstant(APInt(32, ShiftAmt)));
|
||||
Known = KF(Known2, Known);
|
||||
|
||||
// If the known bits conflict, this must be an overflowing left shift, so
|
||||
// the shift result is poison. We can return anything we want. Choose 0 for
|
||||
|
|
Loading…
Reference in New Issue