Skip to content

Commit 5064ff9

Browse files
committed
[X86] Lower*EXTEND - pull out repeated SDLoc calls. NFC.
1 parent 477b48e commit 5064ff9

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20120,12 +20120,11 @@ SDValue X86TargetLowering::FP_TO_INTHelper(SDValue Op, SelectionDAG &DAG,
2012020120
return Res;
2012120121
}
2012220122

20123-
static SDValue LowerAVXExtend(SDValue Op, SelectionDAG &DAG,
20123+
static SDValue LowerAVXExtend(SDValue Op, const SDLoc &dl, SelectionDAG &DAG,
2012420124
const X86Subtarget &Subtarget) {
2012520125
MVT VT = Op.getSimpleValueType();
2012620126
SDValue In = Op.getOperand(0);
2012720127
MVT InVT = In.getSimpleValueType();
20128-
SDLoc dl(Op);
2012920128
unsigned Opc = Op.getOpcode();
2013020129

2013120130
assert(VT.isVector() && InVT.isVector() && "Expected vector type");
@@ -20196,14 +20195,13 @@ static SDValue SplitAndExtendv16i1(unsigned ExtOpc, MVT VT, SDValue In,
2019620195
return DAG.getNode(ISD::TRUNCATE, dl, VT, Res);
2019720196
}
2019820197

20199-
static SDValue LowerZERO_EXTEND_Mask(SDValue Op,
20200-
const X86Subtarget &Subtarget,
20201-
SelectionDAG &DAG) {
20198+
static SDValue LowerZERO_EXTEND_Mask(SDValue Op, const SDLoc &DL,
20199+
const X86Subtarget &Subtarget,
20200+
SelectionDAG &DAG) {
2020220201
MVT VT = Op->getSimpleValueType(0);
2020320202
SDValue In = Op->getOperand(0);
2020420203
MVT InVT = In.getSimpleValueType();
2020520204
assert(InVT.getVectorElementType() == MVT::i1 && "Unexpected input type!");
20206-
SDLoc DL(Op);
2020720205
unsigned NumElts = VT.getVectorNumElements();
2020820206

2020920207
// For all vectors, but vXi8 we can just emit a sign_extend and a shift. This
@@ -20258,12 +20256,13 @@ static SDValue LowerZERO_EXTEND(SDValue Op, const X86Subtarget &Subtarget,
2025820256
SelectionDAG &DAG) {
2025920257
SDValue In = Op.getOperand(0);
2026020258
MVT SVT = In.getSimpleValueType();
20259+
SDLoc DL(Op);
2026120260

2026220261
if (SVT.getVectorElementType() == MVT::i1)
20263-
return LowerZERO_EXTEND_Mask(Op, Subtarget, DAG);
20262+
return LowerZERO_EXTEND_Mask(Op, DL, Subtarget, DAG);
2026420263

2026520264
assert(Subtarget.hasAVX() && "Expected AVX support");
20266-
return LowerAVXExtend(Op, DAG, Subtarget);
20265+
return LowerAVXExtend(Op, DL, DAG, Subtarget);
2026720266
}
2026820267

2026920268
/// Helper to recursively truncate vector elements in half with PACKSS/PACKUS.
@@ -24310,16 +24309,14 @@ SDValue X86TargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
2431024309
return DAG.getNode(X86ISD::CMOV, DL, Op.getValueType(), Ops, Op->getFlags());
2431124310
}
2431224311

24313-
static SDValue LowerSIGN_EXTEND_Mask(SDValue Op,
24312+
static SDValue LowerSIGN_EXTEND_Mask(SDValue Op, const SDLoc &dl,
2431424313
const X86Subtarget &Subtarget,
2431524314
SelectionDAG &DAG) {
2431624315
MVT VT = Op->getSimpleValueType(0);
2431724316
SDValue In = Op->getOperand(0);
2431824317
MVT InVT = In.getSimpleValueType();
2431924318
assert(InVT.getVectorElementType() == MVT::i1 && "Unexpected input type!");
2432024319
MVT VTElt = VT.getVectorElementType();
24321-
SDLoc dl(Op);
24322-
2432324320
unsigned NumElts = VT.getVectorNumElements();
2432424321

2432524322
// Extend VT if the scalar type is i8/i16 and BWI is not supported.
@@ -24371,12 +24368,13 @@ static SDValue LowerANY_EXTEND(SDValue Op, const X86Subtarget &Subtarget,
2437124368
SelectionDAG &DAG) {
2437224369
SDValue In = Op->getOperand(0);
2437324370
MVT InVT = In.getSimpleValueType();
24371+
SDLoc DL(Op);
2437424372

2437524373
if (InVT.getVectorElementType() == MVT::i1)
24376-
return LowerSIGN_EXTEND_Mask(Op, Subtarget, DAG);
24374+
return LowerSIGN_EXTEND_Mask(Op, DL, Subtarget, DAG);
2437724375

2437824376
assert(Subtarget.hasAVX() && "Expected AVX support");
24379-
return LowerAVXExtend(Op, DAG, Subtarget);
24377+
return LowerAVXExtend(Op, DL, DAG, Subtarget);
2438024378
}
2438124379

2438224380
// Lowering for SIGN_EXTEND_VECTOR_INREG and ZERO_EXTEND_VECTOR_INREG.
@@ -24514,7 +24512,7 @@ static SDValue LowerSIGN_EXTEND(SDValue Op, const X86Subtarget &Subtarget,
2451424512
SDLoc dl(Op);
2451524513

2451624514
if (InVT.getVectorElementType() == MVT::i1)
24517-
return LowerSIGN_EXTEND_Mask(Op, Subtarget, DAG);
24515+
return LowerSIGN_EXTEND_Mask(Op, dl, Subtarget, DAG);
2451824516

2451924517
assert(VT.isVector() && InVT.isVector() && "Expected vector type");
2452024518
assert(VT.getVectorNumElements() == InVT.getVectorNumElements() &&

0 commit comments

Comments
 (0)