[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:
Simon Pilgrim 2020-11-13 10:47:56 +00:00
parent 185cface2e
commit 49623fa77a
1 changed files with 1 additions and 2 deletions

View File

@ -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