aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2025-03-08 18:39:29 +0000
committerGitHub <noreply@github.com>2025-03-08 18:39:29 +0000
commit6f77f534d05dc3069ea4d0d7a847d77d45b798f4 (patch)
tree54e61a6711f9ea05ae870c152426fbd3727047fd /llvm/lib
parentaff6ab9d90d23c46bc5f4b909d54bfa9c95c9f03 (diff)
downloadllvm-6f77f534d05dc3069ea4d0d7a847d77d45b798f4.zip
llvm-6f77f534d05dc3069ea4d0d7a847d77d45b798f4.tar.gz
llvm-6f77f534d05dc3069ea4d0d7a847d77d45b798f4.tar.bz2
[X86] combineConcatVectorOps - convert (V)SHUFPS concatenation to use combineConcatVectorOps recursion (#130426)
Only concatenate X86ISD::SHUFP nodes if at least one operand is beneficial to concatenate - helps prevent lot of unnecessary AVX1 concatenations
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index f9661b0..6e68b8a 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -58006,13 +58006,18 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
}
case X86ISD::SHUFP: {
// Add SHUFPD support if/when necessary.
- if (!IsSplat && VT.getScalarType() == MVT::f32 &&
+ if (!IsSplat &&
+ (VT == MVT::v8f32 || (MVT::v16f32 && Subtarget.useAVX512Regs())) &&
llvm::all_of(Ops, [Op0](SDValue Op) {
return Op.getOperand(2) == Op0.getOperand(2);
})) {
- return DAG.getNode(Op0.getOpcode(), DL, VT,
- ConcatSubOperand(VT, Ops, 0),
- ConcatSubOperand(VT, Ops, 1), Op0.getOperand(2));
+ SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
+ SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
+ if (Concat0 || Concat1)
+ return DAG.getNode(Op0.getOpcode(), DL, VT,
+ Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
+ Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1),
+ Op0.getOperand(2));
}
break;
}