[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:
Max Graey 2026-03-30 17:24:31 +03:00 committed by GitHub
parent b75c1d1163
commit 3c1b9f278d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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));
}