Skip to content

Commit 6f1b5ed

Browse files
committed
[X86] LowerCONCAT_VECTORS - pull out repeated SDLoc(). NFC.
1 parent f037329 commit 6f1b5ed

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9614,13 +9614,12 @@ X86TargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const {
96149614
// 256-bit AVX can use the vinsertf128 instruction
96159615
// to create 256-bit vectors from two other 128-bit ones.
96169616
// TODO: Detect subvector broadcast here instead of DAG combine?
9617-
static SDValue LowerAVXCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG,
9617+
static SDValue LowerAVXCONCAT_VECTORS(SDValue Op, const SDLoc &dl,
9618+
SelectionDAG &DAG,
96189619
const X86Subtarget &Subtarget) {
9619-
SDLoc dl(Op);
96209620
MVT ResVT = Op.getSimpleValueType();
9621-
9622-
assert((ResVT.is256BitVector() ||
9623-
ResVT.is512BitVector()) && "Value type must be 256-/512-bit wide");
9621+
assert((ResVT.is256BitVector() || ResVT.is512BitVector()) &&
9622+
"Value type must be 256-/512-bit wide");
96249623

96259624
unsigned NumOperands = Op.getNumOperands();
96269625
unsigned NumFreezeUndef = 0;
@@ -9688,13 +9687,11 @@ static SDValue LowerAVXCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG,
96889687
// zeros) of the result of a node that already zeros all upper bits of
96899688
// k-register.
96909689
// TODO: Merge this with LowerAVXCONCAT_VECTORS?
9691-
static SDValue LowerCONCAT_VECTORSvXi1(SDValue Op,
9690+
static SDValue LowerCONCAT_VECTORSvXi1(SDValue Op, const SDLoc &dl,
96929691
const X86Subtarget &Subtarget,
96939692
SelectionDAG & DAG) {
9694-
SDLoc dl(Op);
96959693
MVT ResVT = Op.getSimpleValueType();
96969694
unsigned NumOperands = Op.getNumOperands();
9697-
96989695
assert(NumOperands > 1 && isPowerOf2_32(NumOperands) &&
96999696
"Unexpected number of operands in CONCAT_VECTORS");
97009697

@@ -9766,19 +9763,18 @@ static SDValue LowerCONCAT_VECTORSvXi1(SDValue Op,
97669763
static SDValue LowerCONCAT_VECTORS(SDValue Op,
97679764
const X86Subtarget &Subtarget,
97689765
SelectionDAG &DAG) {
9766+
SDLoc DL(Op);
97699767
MVT VT = Op.getSimpleValueType();
97709768
if (VT.getVectorElementType() == MVT::i1)
9771-
return LowerCONCAT_VECTORSvXi1(Op, Subtarget, DAG);
9772-
9773-
assert((VT.is256BitVector() && Op.getNumOperands() == 2) ||
9774-
(VT.is512BitVector() && (Op.getNumOperands() == 2 ||
9775-
Op.getNumOperands() == 4)));
9769+
return LowerCONCAT_VECTORSvXi1(Op, DL, Subtarget, DAG);
97769770

97779771
// AVX can use the vinsertf128 instruction to create 256-bit vectors
97789772
// from two other 128-bit ones.
9779-
97809773
// 512-bit vector may contain 2 256-bit vectors or 4 128-bit vectors
9781-
return LowerAVXCONCAT_VECTORS(Op, DAG, Subtarget);
9774+
assert((VT.is256BitVector() && Op.getNumOperands() == 2) ||
9775+
(VT.is512BitVector() &&
9776+
(Op.getNumOperands() == 2 || Op.getNumOperands() == 4)));
9777+
return LowerAVXCONCAT_VECTORS(Op, DL, DAG, Subtarget);
97829778
}
97839779

97849780
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)