[WebAssembly][NFC] use getOneBitSet instead init + shifting for APint (#188552)
This is valid due to `ShiftAmt < BitWidth` which is ensured by early `ShiftAmt.uge(MaxValidShift)` testing.
This commit is contained in:
parent
b75c1d1163
commit
3c1b9f278d
@ -3808,7 +3808,7 @@ static SDValue performShiftCombine(SDNode *N,
|
||||
if (ShiftAmt.uge(MaxValidShift))
|
||||
return SDValue();
|
||||
|
||||
APInt MulAmt = APInt(BitWidth, 1).shl(ShiftAmt);
|
||||
APInt MulAmt = APInt::getOneBitSet(BitWidth, ShiftAmt.getZExtValue());
|
||||
MulConsts.push_back(DAG.getConstant(MulAmt, DL, FromVT.getScalarType(),
|
||||
/*isTarget=*/false, /*isOpaque=*/true));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user