Skip to content

Commit 73e93ec

Browse files
authored
[X86] combineConcatVectorOps - attempt to recursively call combineConcatVectorOps from inside ConcatSubOperand. (#131303)
Before falling back to creating a generic ISD::CONCAT_VECTORS node, see if we can directly concat the subvectors if we peek through any bitcasts.
1 parent 80079c9 commit 73e93ec

6 files changed

+1621
-1636
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57937,11 +57937,14 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5793757937
// Attempt to peek through bitcasts and concat the original subvectors.
5793857938
EVT SubVT = peekThroughBitcasts(Subs[0]).getValueType();
5793957939
if (SubVT.isSimple() && SubVT.isVector()) {
57940-
EVT ConcatVT =
57941-
EVT::getVectorVT(Ctx, SubVT.getScalarType(),
57940+
MVT ConcatVT =
57941+
MVT::getVectorVT(SubVT.getSimpleVT().getScalarType(),
5794257942
SubVT.getVectorElementCount() * Subs.size());
5794357943
for (SDValue &Sub : Subs)
5794457944
Sub = DAG.getBitcast(SubVT, Sub);
57945+
if (SDValue ConcatSrc = combineConcatVectorOps(DL, ConcatVT, Subs, DAG,
57946+
Subtarget, Depth + 1))
57947+
return DAG.getBitcast(VT, ConcatSrc);
5794557948
return DAG.getBitcast(
5794657949
VT, DAG.getNode(ISD::CONCAT_VECTORS, DL, ConcatVT, Subs));
5794757950
}

0 commit comments

Comments
 (0)