[llvm] [AMDGPU][TTI] Refine gfx9 packed FP32 SLP costs for pair formation and shuffles (PR #208572)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 17 07:22:10 PDT 2026
================
@@ -1042,6 +1042,17 @@ InstructionCost GCNTTIImpl::getVectorInstrCost(
VIC);
}
+ // Gfx9 packed <2 x f32> pair formation for v_pk_*_f32: lanes must occupy an
+ // aligned VGPR pair. A load-fed insert can be allocated into its slot for
+ // free; a compute-fed insert typically needs an alignment move, so charge 1.
+ // f32-only on gfx9 targets with packed FP32 ops.
+ if (Opcode == Instruction::InsertElement && EltSize == 32 &&
+ ST->hasPackedFP32Ops() && ST->getGeneration() == AMDGPUSubtarget::GFX9)
+ if (auto *VecTy = dyn_cast<FixedVectorType>(ValTy))
+ if (VecTy->getNumElements() == 2 &&
----------------
arsenm wrote:
Wide vectors should decompose to the native vector width, this should be a multiple of the legalization cost
https://github.com/llvm/llvm-project/pull/208572
More information about the llvm-commits
mailing list