@@ -47970,10 +47970,10 @@ static SDValue combineMul(SDNode *N, SelectionDAG &DAG,
47970
47970
// of a MULHU/MULHS. There isn't a way to convey this to the generic DAG
47971
47971
// combiner.
47972
47972
static SDValue combineShiftToPMULH(SDNode *N, SelectionDAG &DAG,
47973
+ const SDLoc &DL,
47973
47974
const X86Subtarget &Subtarget) {
47974
47975
assert((N->getOpcode() == ISD::SRL || N->getOpcode() == ISD::SRA) &&
47975
47976
"SRL or SRA node is required here!");
47976
- SDLoc DL(N);
47977
47977
47978
47978
if (!Subtarget.hasSSE2())
47979
47979
return SDValue();
@@ -48024,6 +48024,7 @@ static SDValue combineShiftLeft(SDNode *N, SelectionDAG &DAG,
48024
48024
SDValue N1 = N->getOperand(1);
48025
48025
ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
48026
48026
EVT VT = N0.getValueType();
48027
+ SDLoc DL(N);
48027
48028
48028
48029
// Exploits AVX2 VSHLV/VSRLV instructions for efficient unsigned vector shifts
48029
48030
// with out-of-bounds clamping.
@@ -48039,7 +48040,6 @@ static SDValue combineShiftLeft(SDNode *N, SelectionDAG &DAG,
48039
48040
ISD::isConstantSplatVector(Cond.getOperand(1).getNode(), SV) &&
48040
48041
ISD::isConstantSplatVectorAllZeros(N01.getNode()) &&
48041
48042
SV == VT.getScalarSizeInBits()) {
48042
- SDLoc DL(N);
48043
48043
return DAG.getNode(X86ISD::VSHLV, DL, VT, N00, N1);
48044
48044
}
48045
48045
}
@@ -48074,10 +48074,8 @@ static SDValue combineShiftLeft(SDNode *N, SelectionDAG &DAG,
48074
48074
N00.getOperand(0).getOpcode() == X86ISD::SETCC_CARRY) {
48075
48075
MaskOK = Mask.isIntN(N00.getOperand(0).getValueSizeInBits());
48076
48076
}
48077
- if (MaskOK && Mask != 0) {
48078
- SDLoc DL(N);
48077
+ if (MaskOK && Mask != 0)
48079
48078
return DAG.getNode(ISD::AND, DL, VT, N00, DAG.getConstant(Mask, DL, VT));
48080
- }
48081
48079
}
48082
48080
48083
48081
return SDValue();
@@ -48092,7 +48090,7 @@ static SDValue combineShiftRightArithmetic(SDNode *N, SelectionDAG &DAG,
48092
48090
unsigned Size = VT.getSizeInBits();
48093
48091
SDLoc DL(N);
48094
48092
48095
- if (SDValue V = combineShiftToPMULH(N, DAG, Subtarget))
48093
+ if (SDValue V = combineShiftToPMULH(N, DAG, DL, Subtarget))
48096
48094
return V;
48097
48095
48098
48096
// fold sra(x,umin(amt,bw-1)) -> avx2 psrav(x,amt)
@@ -48157,8 +48155,9 @@ static SDValue combineShiftRightLogical(SDNode *N, SelectionDAG &DAG,
48157
48155
SDValue N0 = N->getOperand(0);
48158
48156
SDValue N1 = N->getOperand(1);
48159
48157
EVT VT = N0.getValueType();
48158
+ SDLoc DL(N);
48160
48159
48161
- if (SDValue V = combineShiftToPMULH(N, DAG, Subtarget))
48160
+ if (SDValue V = combineShiftToPMULH(N, DAG, DL, Subtarget))
48162
48161
return V;
48163
48162
48164
48163
// Exploits AVX2 VSHLV/VSRLV instructions for efficient unsigned vector shifts
@@ -48175,7 +48174,6 @@ static SDValue combineShiftRightLogical(SDNode *N, SelectionDAG &DAG,
48175
48174
ISD::isConstantSplatVector(Cond.getOperand(1).getNode(), SV) &&
48176
48175
ISD::isConstantSplatVectorAllZeros(N01.getNode()) &&
48177
48176
SV == VT.getScalarSizeInBits()) {
48178
- SDLoc DL(N);
48179
48177
return DAG.getNode(X86ISD::VSRLV, DL, VT, N00, N1);
48180
48178
}
48181
48179
}
@@ -48215,7 +48213,6 @@ static SDValue combineShiftRightLogical(SDNode *N, SelectionDAG &DAG,
48215
48213
if ((OldMaskSize > 8 && NewMaskSize <= 8) ||
48216
48214
(OldMaskSize > 32 && NewMaskSize <= 32)) {
48217
48215
// srl (and X, AndC), ShiftC --> and (srl X, ShiftC), (AndC >> ShiftC)
48218
- SDLoc DL(N);
48219
48216
SDValue NewMask = DAG.getConstant(NewMaskVal, DL, VT);
48220
48217
SDValue NewShift = DAG.getNode(ISD::SRL, DL, VT, N0.getOperand(0), N1);
48221
48218
return DAG.getNode(ISD::AND, DL, VT, NewShift, NewMask);
0 commit comments