[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


================
@@ -850,6 +850,13 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM,
     setOperationAction(ISD::SELECT, {MVT::v4i16, MVT::v4f16, MVT::v4bf16},
                        Custom);
 
+    if (Subtarget->hasBF16PackedInsts()) {
+      for (MVT VT : {MVT::v4bf16, MVT::v8bf16, MVT::v16bf16, MVT::v32bf16})
+        // Split vector operations.
+        setOperationAction({ISD::FADD, ISD::FMUL, ISD::FMA, ISD::FCANONICALIZE},
+                           VT, Custom);
----------------
arsenm wrote:

Test coverage isn't comprehensive across all types + opcodes 

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


More information about the llvm-commits mailing list