@@ -7404,17 +7404,16 @@ static int getUnderlyingExtractedFromVec(SDValue &ExtractedFromVec,
7404
7404
return Idx;
7405
7405
}
7406
7406
7407
- static SDValue buildFromShuffleMostly(SDValue Op, SelectionDAG &DAG) {
7407
+ static SDValue buildFromShuffleMostly(SDValue Op, const SDLoc &DL,
7408
+ SelectionDAG &DAG) {
7408
7409
MVT VT = Op.getSimpleValueType();
7409
7410
7410
7411
// Skip if insert_vec_elt is not supported.
7411
7412
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
7412
7413
if (!TLI.isOperationLegalOrCustom(ISD::INSERT_VECTOR_ELT, VT))
7413
7414
return SDValue();
7414
7415
7415
- SDLoc DL(Op);
7416
7416
unsigned NumElems = Op.getNumOperands();
7417
-
7418
7417
SDValue VecIn1;
7419
7418
SDValue VecIn2;
7420
7419
SmallVector<unsigned, 4> InsertIndices;
@@ -9021,7 +9020,7 @@ X86TargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const {
9021
9020
assert(Values.size() > 1 && "Expected non-undef and non-splat vector");
9022
9021
9023
9022
// Check for a build vector from mostly shuffle plus few inserting.
9024
- if (SDValue Sh = buildFromShuffleMostly(Op, DAG))
9023
+ if (SDValue Sh = buildFromShuffleMostly(Op, dl, DAG))
9025
9024
return Sh;
9026
9025
9027
9026
// For SSE 4.1, use insertps to put the high elements into the low element.
@@ -39519,12 +39518,12 @@ static SmallVector<int, 4> getPSHUFShuffleMask(SDValue N) {
39519
39518
/// We walk up the chain and look for a combinable shuffle, skipping over
39520
39519
/// shuffles that we could hoist this shuffle's transformation past without
39521
39520
/// altering anything.
39522
- static SDValue
39523
- combineRedundantDWordShuffle(SDValue N, MutableArrayRef<int> Mask,
39524
- SelectionDAG &DAG) {
39521
+ static SDValue combineRedundantDWordShuffle(SDValue N,
39522
+ MutableArrayRef<int> Mask,
39523
+ const SDLoc &DL,
39524
+ SelectionDAG &DAG) {
39525
39525
assert(N.getOpcode() == X86ISD::PSHUFD &&
39526
39526
"Called with something other than an x86 128-bit half shuffle!");
39527
- SDLoc DL(N);
39528
39527
39529
39528
// Walk up a single-use chain looking for a combinable shuffle. Keep a stack
39530
39529
// of the shuffles in the chain so that we can form a fresh chain to replace
@@ -39922,10 +39921,10 @@ static SDValue canonicalizeLaneShuffleWithRepeatedOps(SDValue V,
39922
39921
}
39923
39922
39924
39923
/// Try to combine x86 target specific shuffles.
39925
- static SDValue combineTargetShuffle(SDValue N, SelectionDAG &DAG,
39924
+ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
39925
+ SelectionDAG &DAG,
39926
39926
TargetLowering::DAGCombinerInfo &DCI,
39927
39927
const X86Subtarget &Subtarget) {
39928
- SDLoc DL(N);
39929
39928
MVT VT = N.getSimpleValueType();
39930
39929
SmallVector<int, 4> Mask;
39931
39930
unsigned Opcode = N.getOpcode();
@@ -40653,7 +40652,7 @@ static SDValue combineTargetShuffle(SDValue N, SelectionDAG &DAG,
40653
40652
break;
40654
40653
40655
40654
case X86ISD::PSHUFD:
40656
- if (SDValue NewN = combineRedundantDWordShuffle(N, Mask, DAG))
40655
+ if (SDValue NewN = combineRedundantDWordShuffle(N, Mask, DL, DAG))
40657
40656
return NewN;
40658
40657
40659
40658
break;
@@ -40762,7 +40761,7 @@ static bool isAddSubOrSubAdd(SDNode *N, const X86Subtarget &Subtarget,
40762
40761
}
40763
40762
40764
40763
/// Combine shuffle of two fma nodes into FMAddSub or FMSubAdd.
40765
- static SDValue combineShuffleToFMAddSub(SDNode *N,
40764
+ static SDValue combineShuffleToFMAddSub(SDNode *N, const SDLoc &DL,
40766
40765
const X86Subtarget &Subtarget,
40767
40766
SelectionDAG &DAG) {
40768
40767
// We only handle target-independent shuffles.
@@ -40796,7 +40795,6 @@ static SDValue combineShuffleToFMAddSub(SDNode *N,
40796
40795
return SDValue();
40797
40796
40798
40797
// FMAddSub takes zeroth operand from FMSub node.
40799
- SDLoc DL(N);
40800
40798
bool IsSubAdd = Op0Even ? Op0 == FMAdd : Op1 == FMAdd;
40801
40799
unsigned Opcode = IsSubAdd ? X86ISD::FMSUBADD : X86ISD::FMADDSUB;
40802
40800
return DAG.getNode(Opcode, DL, VT, FMAdd.getOperand(0), FMAdd.getOperand(1),
@@ -40805,10 +40803,10 @@ static SDValue combineShuffleToFMAddSub(SDNode *N,
40805
40803
40806
40804
/// Try to combine a shuffle into a target-specific add-sub or
40807
40805
/// mul-add-sub node.
40808
- static SDValue combineShuffleToAddSubOrFMAddSub(SDNode *N,
40806
+ static SDValue combineShuffleToAddSubOrFMAddSub(SDNode *N, const SDLoc &DL,
40809
40807
const X86Subtarget &Subtarget,
40810
40808
SelectionDAG &DAG) {
40811
- if (SDValue V = combineShuffleToFMAddSub(N, Subtarget, DAG))
40809
+ if (SDValue V = combineShuffleToFMAddSub(N, DL, Subtarget, DAG))
40812
40810
return V;
40813
40811
40814
40812
SDValue Opnd0, Opnd1;
@@ -40817,7 +40815,6 @@ static SDValue combineShuffleToAddSubOrFMAddSub(SDNode *N,
40817
40815
return SDValue();
40818
40816
40819
40817
MVT VT = N->getSimpleValueType(0);
40820
- SDLoc DL(N);
40821
40818
40822
40819
// Try to generate X86ISD::FMADDSUB node here.
40823
40820
SDValue Opnd2;
@@ -40847,7 +40844,8 @@ static SDValue combineShuffleToAddSubOrFMAddSub(SDNode *N,
40847
40844
// We are looking for a shuffle where both sources are concatenated with undef
40848
40845
// and have a width that is half of the output's width. AVX2 has VPERMD/Q, so
40849
40846
// if we can express this as a single-source shuffle, that's preferable.
40850
- static SDValue combineShuffleOfConcatUndef(SDNode *N, SelectionDAG &DAG,
40847
+ static SDValue combineShuffleOfConcatUndef(SDNode *N, const SDLoc &DL,
40848
+ SelectionDAG &DAG,
40851
40849
const X86Subtarget &Subtarget) {
40852
40850
if (!Subtarget.hasAVX2() || !isa<ShuffleVectorSDNode>(N))
40853
40851
return SDValue();
@@ -40879,11 +40877,10 @@ static SDValue combineShuffleOfConcatUndef(SDNode *N, SelectionDAG &DAG,
40879
40877
SmallVector<int, 8> Mask;
40880
40878
int NumElts = VT.getVectorNumElements();
40881
40879
40882
- ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
40880
+ auto *SVOp = cast<ShuffleVectorSDNode>(N);
40883
40881
for (int Elt : SVOp->getMask())
40884
40882
Mask.push_back(Elt < NumElts ? Elt : (Elt - NumElts / 2));
40885
40883
40886
- SDLoc DL(N);
40887
40884
SDValue Concat = DAG.getNode(ISD::CONCAT_VECTORS, DL, VT, N0.getOperand(0),
40888
40885
N1.getOperand(0));
40889
40886
return DAG.getVectorShuffle(VT, DL, Concat, DAG.getUNDEF(VT), Mask);
@@ -40935,7 +40932,8 @@ static SDValue combineShuffle(SDNode *N, SelectionDAG &DAG,
40935
40932
EVT VT = N->getValueType(0);
40936
40933
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
40937
40934
if (TLI.isTypeLegal(VT) && !isSoftF16(VT, Subtarget))
40938
- if (SDValue AddSub = combineShuffleToAddSubOrFMAddSub(N, Subtarget, DAG))
40935
+ if (SDValue AddSub =
40936
+ combineShuffleToAddSubOrFMAddSub(N, dl, Subtarget, DAG))
40939
40937
return AddSub;
40940
40938
40941
40939
// Attempt to combine into a vector load/broadcast.
@@ -40949,12 +40947,12 @@ static SDValue combineShuffle(SDNode *N, SelectionDAG &DAG,
40949
40947
// Into:
40950
40948
// (vector_shuffle <mask> (concat_vectors t1, t2), undef)
40951
40949
// Since the latter can be efficiently lowered with VPERMD/VPERMQ
40952
- if (SDValue ShufConcat = combineShuffleOfConcatUndef(N, DAG, Subtarget))
40950
+ if (SDValue ShufConcat = combineShuffleOfConcatUndef(N, dl, DAG, Subtarget))
40953
40951
return ShufConcat;
40954
40952
40955
40953
if (isTargetShuffle(N->getOpcode())) {
40956
40954
SDValue Op(N, 0);
40957
- if (SDValue Shuffle = combineTargetShuffle(Op, DAG, DCI, Subtarget))
40955
+ if (SDValue Shuffle = combineTargetShuffle(Op, dl, DAG, DCI, Subtarget))
40958
40956
return Shuffle;
40959
40957
40960
40958
// Try recursively combining arbitrary sequences of x86 shuffle
0 commit comments