[llvm] [AMDGPU][TTI] Refine gfx9 packed FP32 SLP costs for pair formation and shuffles (PR #208572)

Akash Dutta via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 09:46:49 PDT 2026


================
@@ -1344,6 +1355,15 @@ InstructionCost GCNTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
   Kind = improveShuffleKindFromMask(Kind, Mask, SrcTy, Index, SubTp);
 
   unsigned ScalarSize = DL.getTypeSizeInBits(SrcTy->getElementType());
+
+  // Gfx9 packed FP32 shuffles are free. InsertElement above already taxes
+  // assembling <2 x f32> pairs, and a per-lane shuffle cost stacks on top and
+  // over-penalizes SLP. f32-only on gfx9 targets with packed FP32 ops.
----------------
akadutta wrote:

It should not impact non-gfx9 workloads. That's why the generation gate exists. In the absence of that gating, this might also affect gfx1250 (also has packed instructions).

And I completely understand the annoyance with generation checks. Eventually, I would like to get rid of the generation check here if no bugs/regressions crop up.

https://github.com/llvm/llvm-project/pull/208572


More information about the llvm-commits mailing list