Skip to content

Commit c545d57

Browse files
committed
[X86] combineConcatVectorOps - use ConcatSubOperand helper to concat VPERMV3 subvector operands together.
Shouldn't affect existing test coverage, but aggressively peeking through bitcasts before concatenation will help in a future patch.
1 parent 77f44a9 commit c545d57

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57974,18 +57974,16 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5797457974
int Src = M < NumSrcElts ? 0 : 2;
5797557975
M += M < NumSrcElts ? 0 : NumSrcElts;
5797657976

57977-
// Reference the lowest sub if they upper sub is the same.
57977+
// Reference the lowest sub if the upper sub is the same.
5797857978
if (Ops[0].getOperand(Src) != Ops[i].getOperand(Src))
5797957979
M += i * NumSrcElts;
5798057980
}
5798157981
ConcatMask.push_back(M);
5798257982
}
5798357983
}
5798457984
if (ConcatMask.size() == (NumOps * NumSrcElts)) {
57985-
SDValue Src0 = concatSubVectors(Ops[0].getOperand(0),
57986-
Ops[1].getOperand(0), DAG, DL);
57987-
SDValue Src1 = concatSubVectors(Ops[0].getOperand(2),
57988-
Ops[1].getOperand(2), DAG, DL);
57985+
SDValue Src0 = ConcatSubOperand(VT, Ops, 0);
57986+
SDValue Src1 = ConcatSubOperand(VT, Ops, 2);
5798957987
MVT IntMaskSVT = MVT::getIntegerVT(EltSizeInBits);
5799057988
MVT IntMaskVT = MVT::getVectorVT(IntMaskSVT, NumOps * NumSrcElts);
5799157989
SDValue Mask = getConstVector(ConcatMask, IntMaskVT, DAG, DL, true);

0 commit comments

Comments
 (0)