[llvm] [AMDGPU] Fix vector legalization for bf16 valu ops (PR #158439)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 23:45:29 PDT 2025


================
@@ -607,6 +607,8 @@ InstructionCost GCNTTIImpl::getArithmeticInstrCost(
   case ISD::FSUB:
     if (ST->hasPackedFP32Ops() && SLT == MVT::f32)
       NElts = (NElts + 1) / 2;
+    if (ST->hasBF16PackedInsts() && SLT == MVT::bf16)
----------------
arsenm wrote:

F16 case here missing is probably a bug. We should also probably be expressing this in terms of a legality query on the 2 x element 

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


More information about the llvm-commits mailing list