@@ -30224,8 +30224,7 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
30224
30224
// another. The construction of this mask will be constant folded.
30225
30225
// The mask for a logical right shift is nearly identical, the only
30226
30226
// difference is that the all ones mask is shifted right instead of left.
30227
- SDValue CstFullMask = DAG.getAllOnesConstant(dl, NarrowScalarVT);
30228
- SDValue SplatFullMask = DAG.getSplat(VT, dl, CstFullMask);
30227
+ SDValue SplatFullMask = DAG.getAllOnesConstant(dl, VT);
30229
30228
SDValue Mask = DAG.getNode(LogicalOpc, dl, VT, SplatFullMask, Amt);
30230
30229
Mask = DAG.getBitcast(WideVT, Mask);
30231
30230
// Finally, we mask the shifted vector with the SWAR mask.
@@ -30258,9 +30257,8 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
30258
30257
//
30259
30258
// This is equal to Masked - 2*SignBitMask which will correctly sign
30260
30259
// extend our result.
30261
- SDValue CstHighBit =
30262
- DAG.getConstant(1ULL << (EltSizeInBits - 1), dl, NarrowScalarVT);
30263
- SDValue SplatHighBit = DAG.getSplat(VT, dl, CstHighBit);
30260
+ SDValue SplatHighBit =
30261
+ DAG.getConstant(APInt::getSignMask(EltSizeInBits), dl, VT);
30264
30262
// This does not induce recursion, all operands are constants.
30265
30263
SDValue SignBitMask = DAG.getNode(LogicalOpc, dl, VT, SplatHighBit, Amt);
30266
30264
SDValue FlippedSignBit =
0 commit comments