@@ -1880,8 +1880,8 @@ bool TargetLowering::SimplifyDemandedBits(
1880
1880
Flags.setNoSignedWrap(IsNSW);
1881
1881
Flags.setNoUnsignedWrap(IsNUW);
1882
1882
SDValue NewOp = TLO.DAG.getNode(ISD::TRUNCATE, dl, HalfVT, Op0);
1883
- SDValue NewShiftAmt = TLO.DAG.getShiftAmountConstant(
1884
- ShAmt, HalfVT, dl, TLO.LegalTypes() );
1883
+ SDValue NewShiftAmt =
1884
+ TLO.DAG.getShiftAmountConstant( ShAmt, HalfVT, dl);
1885
1885
SDValue NewShift = TLO.DAG.getNode(ISD::SHL, dl, HalfVT, NewOp,
1886
1886
NewShiftAmt, Flags);
1887
1887
SDValue NewExt =
@@ -1977,8 +1977,8 @@ bool TargetLowering::SimplifyDemandedBits(
1977
1977
((InDemandedMask.countLeadingZeros() >= (BitWidth / 2)) ||
1978
1978
TLO.DAG.MaskedValueIsZero(Op0, HiBits))) {
1979
1979
SDValue NewOp = TLO.DAG.getNode(ISD::TRUNCATE, dl, HalfVT, Op0);
1980
- SDValue NewShiftAmt = TLO.DAG.getShiftAmountConstant(
1981
- ShAmt, HalfVT, dl, TLO.LegalTypes() );
1980
+ SDValue NewShiftAmt =
1981
+ TLO.DAG.getShiftAmountConstant( ShAmt, HalfVT, dl);
1982
1982
SDValue NewShift =
1983
1983
TLO.DAG.getNode(ISD::SRL, dl, HalfVT, NewOp, NewShiftAmt);
1984
1984
return TLO.CombineTo(
@@ -2600,8 +2600,7 @@ bool TargetLowering::SimplifyDemandedBits(
2600
2600
if (!(HighBits & DemandedBits)) {
2601
2601
// None of the shifted in bits are needed. Add a truncate of the
2602
2602
// shift input, then shift it.
2603
- SDValue NewShAmt =
2604
- TLO.DAG.getShiftAmountConstant(ShVal, VT, dl, TLO.LegalTypes());
2603
+ SDValue NewShAmt = TLO.DAG.getShiftAmountConstant(ShVal, VT, dl);
2605
2604
SDValue NewTrunc =
2606
2605
TLO.DAG.getNode(ISD::TRUNCATE, dl, VT, Src.getOperand(0));
2607
2606
return TLO.CombineTo(
@@ -4254,8 +4253,7 @@ SDValue TargetLowering::foldSetCCWithBinOp(EVT VT, SDValue N0, SDValue N1,
4254
4253
return SDValue();
4255
4254
4256
4255
// (X - Y) == Y --> X == Y << 1
4257
- SDValue One =
4258
- DAG.getShiftAmountConstant(1, OpVT, DL, !DCI.isBeforeLegalize());
4256
+ SDValue One = DAG.getShiftAmountConstant(1, OpVT, DL);
4259
4257
SDValue YShl1 = DAG.getNode(ISD::SHL, DL, N1.getValueType(), Y, One);
4260
4258
if (!DCI.isCalledByLegalizer())
4261
4259
DCI.AddToWorklist(YShl1.getNode());
@@ -5113,8 +5111,7 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
5113
5111
return DAG.getNode(
5114
5112
ISD::TRUNCATE, dl, VT,
5115
5113
DAG.getNode(ISD::SRL, dl, ShValTy, N0,
5116
- DAG.getShiftAmountConstant(
5117
- ShCt, ShValTy, dl, !DCI.isBeforeLegalize())));
5114
+ DAG.getShiftAmountConstant(ShCt, ShValTy, dl)));
5118
5115
}
5119
5116
} else if (Cond == ISD::SETEQ && C1 == AndRHS->getAPIntValue()) {
5120
5117
// (X & 8) == 8 --> (X & 8) >> 3
@@ -5125,8 +5122,7 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
5125
5122
return DAG.getNode(
5126
5123
ISD::TRUNCATE, dl, VT,
5127
5124
DAG.getNode(ISD::SRL, dl, ShValTy, N0,
5128
- DAG.getShiftAmountConstant(
5129
- ShCt, ShValTy, dl, !DCI.isBeforeLegalize())));
5125
+ DAG.getShiftAmountConstant(ShCt, ShValTy, dl)));
5130
5126
}
5131
5127
}
5132
5128
}
@@ -5144,8 +5140,7 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
5144
5140
if (!TLI.shouldAvoidTransformToShift(ShValTy, ShiftBits)) {
5145
5141
SDValue Shift = DAG.getNode(
5146
5142
ISD::SRL, dl, ShValTy, N0.getOperand(0),
5147
- DAG.getShiftAmountConstant(ShiftBits, ShValTy, dl,
5148
- !DCI.isBeforeLegalize()));
5143
+ DAG.getShiftAmountConstant(ShiftBits, ShValTy, dl));
5149
5144
SDValue CmpRHS = DAG.getConstant(C1.lshr(ShiftBits), dl, ShValTy);
5150
5145
return DAG.getSetCC(dl, VT, Shift, CmpRHS, Cond);
5151
5146
}
@@ -5174,8 +5169,7 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
5174
5169
!TLI.shouldAvoidTransformToShift(ShValTy, ShiftBits)) {
5175
5170
SDValue Shift =
5176
5171
DAG.getNode(ISD::SRL, dl, ShValTy, N0,
5177
- DAG.getShiftAmountConstant(ShiftBits, ShValTy, dl,
5178
- !DCI.isBeforeLegalize()));
5172
+ DAG.getShiftAmountConstant(ShiftBits, ShValTy, dl));
5179
5173
SDValue CmpRHS = DAG.getConstant(NewC, dl, ShValTy);
5180
5174
return DAG.getSetCC(dl, VT, Shift, CmpRHS, NewCond);
5181
5175
}
@@ -9599,9 +9593,8 @@ TargetLowering::scalarizeVectorLoad(LoadSDNode *LD,
9599
9593
for (unsigned Idx = 0; Idx < NumElem; ++Idx) {
9600
9594
unsigned ShiftIntoIdx =
9601
9595
(DAG.getDataLayout().isBigEndian() ? (NumElem - 1) - Idx : Idx);
9602
- SDValue ShiftAmount =
9603
- DAG.getShiftAmountConstant(ShiftIntoIdx * SrcEltVT.getSizeInBits(),
9604
- LoadVT, SL, /*LegalTypes=*/false);
9596
+ SDValue ShiftAmount = DAG.getShiftAmountConstant(
9597
+ ShiftIntoIdx * SrcEltVT.getSizeInBits(), LoadVT, SL);
9605
9598
SDValue ShiftedElt = DAG.getNode(ISD::SRL, SL, LoadVT, Load, ShiftAmount);
9606
9599
SDValue Elt =
9607
9600
DAG.getNode(ISD::AND, SL, LoadVT, ShiftedElt, SrcEltBitMask);
0 commit comments