Skip to content

Commit 9a9269e

Browse files
RKSimonfrederik-h
authored andcommitted
[X86] combineConcatVectorOps - extend ISD::VECTOR_SHUFFLE handling to support 512-bit types (llvm#131189)
Limit cases to AVX512 targets that support two-operand crosslane shuffles
1 parent dc1a489 commit 9a9269e

File tree

3 files changed

+159
-569
lines changed

3 files changed

+159
-569
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57984,10 +57984,14 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5798457984

5798557985
switch (Op0.getOpcode()) {
5798657986
case ISD::VECTOR_SHUFFLE: {
57987-
// TODO: Relax VBMI requirement for repeated shuffle ops - currently
57988-
// limited to targets that should always have good cross lane shuffles.
57989-
if (!IsSplat && NumOps == 2 && VT.is256BitVector() &&
57990-
(EltSizeInBits >= 32 || Subtarget.hasInt256())) {
57987+
// TODO: Generalize NumOps support.
57988+
if (!IsSplat && NumOps == 2 &&
57989+
((VT.is256BitVector() &&
57990+
(EltSizeInBits >= 32 || Subtarget.hasInt256())) ||
57991+
(VT.is512BitVector() && Subtarget.useAVX512Regs() &&
57992+
(EltSizeInBits >= 32 || Subtarget.hasVBMI2())))) {
57993+
// TODO: Relax VBMI requirement for repeated shuffle ops - currently
57994+
// limited to targets that should always have good cross lane shuffles.
5799157995
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
5799257996
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
5799357997
if (Concat0 || Concat1 ||

0 commit comments

Comments
 (0)