@@ -39642,19 +39642,15 @@ static SDValue combineX86ShuffleChainWithExtract(
39642
39642
/// into either a single instruction if there is a special purpose instruction
39643
39643
/// for this operation, or into a PSHUFB instruction which is a fully general
39644
39644
/// instruction but should only be used to replace chains over a certain depth.
39645
- static SDValue combineX86ShuffleChain(ArrayRef<SDValue> Inputs, SDValue Root,
39646
- ArrayRef<int> BaseMask, int Depth,
39647
- ArrayRef<const SDNode *> SrcNodes,
39648
- bool AllowVariableCrossLaneMask,
39649
- bool AllowVariablePerLaneMask,
39650
- bool IsMaskedShuffle,
39651
- SelectionDAG &DAG,
39652
- const X86Subtarget &Subtarget) {
39645
+ static SDValue combineX86ShuffleChain(
39646
+ ArrayRef<SDValue> Inputs, SDValue Root, ArrayRef<int> BaseMask, int Depth,
39647
+ ArrayRef<const SDNode *> SrcNodes, bool AllowVariableCrossLaneMask,
39648
+ bool AllowVariablePerLaneMask, bool IsMaskedShuffle, SelectionDAG &DAG,
39649
+ const SDLoc &DL, const X86Subtarget &Subtarget) {
39653
39650
assert(!BaseMask.empty() && "Cannot combine an empty shuffle mask!");
39654
39651
assert((Inputs.size() == 1 || Inputs.size() == 2) &&
39655
39652
"Unexpected number of shuffle inputs!");
39656
39653
39657
- SDLoc DL(Root);
39658
39654
unsigned RootOpc = Root.getOpcode();
39659
39655
MVT RootVT = Root.getSimpleValueType();
39660
39656
unsigned RootSizeInBits = RootVT.getSizeInBits();
@@ -40525,7 +40521,7 @@ static SDValue combineX86ShuffleChainWithExtract(
40525
40521
if (SDValue WideShuffle = combineX86ShuffleChain(
40526
40522
WideInputs, WideRoot, WideMask, Depth, SrcNodes,
40527
40523
AllowVariableCrossLaneMask, AllowVariablePerLaneMask, IsMaskedShuffle,
40528
- DAG, Subtarget)) {
40524
+ DAG, SDLoc(WideRoot), Subtarget)) {
40529
40525
WideShuffle =
40530
40526
extractSubVector(WideShuffle, 0, DAG, SDLoc(Root), RootSizeInBits);
40531
40527
return DAG.getBitcast(RootVT, WideShuffle);
@@ -40874,15 +40870,14 @@ static SDValue combineX86ShufflesRecursively(
40874
40870
ArrayRef<SDValue> SrcOps, int SrcOpIndex, SDValue Root,
40875
40871
ArrayRef<int> RootMask, ArrayRef<const SDNode *> SrcNodes, unsigned Depth,
40876
40872
unsigned MaxDepth, bool AllowVariableCrossLaneMask,
40877
- bool AllowVariablePerLaneMask, SelectionDAG &DAG,
40873
+ bool AllowVariablePerLaneMask, SelectionDAG &DAG, const SDLoc &DL,
40878
40874
const X86Subtarget &Subtarget) {
40879
40875
assert(!RootMask.empty() &&
40880
40876
(RootMask.size() > 1 || (RootMask[0] == 0 && SrcOpIndex == 0)) &&
40881
40877
"Illegal shuffle root mask");
40882
40878
MVT RootVT = Root.getSimpleValueType();
40883
40879
assert(RootVT.isVector() && "Shuffles operate on vector types!");
40884
40880
unsigned RootSizeInBits = RootVT.getSizeInBits();
40885
- SDLoc DL(Root);
40886
40881
40887
40882
// Bound the depth of our recursive combine because this is ultimately
40888
40883
// quadratic in nature.
@@ -41176,7 +41171,7 @@ static SDValue combineX86ShufflesRecursively(
41176
41171
}
41177
41172
if (SDValue Res = combineX86ShufflesRecursively(
41178
41173
Ops, i, Root, ResolvedMask, CombinedNodes, Depth + 1, MaxDepth,
41179
- AllowCrossLaneVar, AllowPerLaneVar, DAG, Subtarget))
41174
+ AllowCrossLaneVar, AllowPerLaneVar, DAG, DL, Subtarget))
41180
41175
return Res;
41181
41176
}
41182
41177
}
@@ -41296,7 +41291,7 @@ static SDValue combineX86ShufflesRecursively(
41296
41291
// Try to combine into a single shuffle instruction.
41297
41292
if (SDValue Shuffle = combineX86ShuffleChain(
41298
41293
Ops, Root, Mask, Depth, CombinedNodes, AllowVariableCrossLaneMask,
41299
- AllowVariablePerLaneMask, IsMaskedShuffle, DAG, Subtarget))
41294
+ AllowVariablePerLaneMask, IsMaskedShuffle, DAG, DL, Subtarget))
41300
41295
return Shuffle;
41301
41296
41302
41297
// If all the operands come from the same larger vector, fallthrough and try
@@ -41324,7 +41319,7 @@ static SDValue combineX86ShufflesRecursively(SDValue Op, SelectionDAG &DAG,
41324
41319
return combineX86ShufflesRecursively(
41325
41320
{Op}, 0, Op, {0}, {}, /*Depth*/ 0, X86::MaxShuffleCombineDepth,
41326
41321
/*AllowCrossLaneVarMask*/ true, /*AllowPerLaneVarMask*/ true, DAG,
41327
- Subtarget);
41322
+ SDLoc(Op), Subtarget);
41328
41323
}
41329
41324
41330
41325
/// Get the PSHUF-style mask from PSHUF node.
@@ -41977,7 +41972,7 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
41977
41972
{BC}, 0, BC, DemandedMask, {}, /*Depth*/ 0,
41978
41973
X86::MaxShuffleCombineDepth,
41979
41974
/*AllowCrossLaneVarMask*/ true,
41980
- /*AllowPerLaneVarMask*/ true, DAG, Subtarget))
41975
+ /*AllowPerLaneVarMask*/ true, DAG, DL, Subtarget))
41981
41976
return DAG.getNode(X86ISD::VBROADCAST, DL, VT,
41982
41977
DAG.getBitcast(SrcVT, Res));
41983
41978
}
@@ -43980,7 +43975,7 @@ bool X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode(
43980
43975
SDValue NewShuffle = combineX86ShufflesRecursively(
43981
43976
{Op}, 0, Op, DemandedMask, {}, 0, X86::MaxShuffleCombineDepth - Depth,
43982
43977
/*AllowCrossLaneVarMask*/ true, /*AllowPerLaneVarMask*/ true, TLO.DAG,
43983
- Subtarget);
43978
+ SDLoc(Op), Subtarget);
43984
43979
if (NewShuffle)
43985
43980
return TLO.CombineTo(Op, NewShuffle);
43986
43981
}
@@ -51580,7 +51575,7 @@ static SDValue combineAnd(SDNode *N, SelectionDAG &DAG,
51580
51575
{SrcVec}, 0, SrcVec, ShuffleMask, {}, /*Depth*/ 1,
51581
51576
X86::MaxShuffleCombineDepth,
51582
51577
/*AllowVarCrossLaneMask*/ true,
51583
- /*AllowVarPerLaneMask*/ true, DAG, Subtarget))
51578
+ /*AllowVarPerLaneMask*/ true, DAG, SDLoc(SrcVec), Subtarget))
51584
51579
return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, VT, Shuffle,
51585
51580
N0.getOperand(1));
51586
51581
}
0 commit comments