[llvm] [AMDGPU] Optimize fcanonicalize/fneg/fsub with packed bf16 math ops (PR #197318)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 04:19:19 PDT 2026


================
@@ -3733,6 +3733,12 @@ multiclass SelectCanonicalizeAsMax<
     // FIXME: Should have VOP3P subtarget predicate
     let OtherPredicates = f16_preds;
   }
+
+let SubtargetPredicate = HasBF16PackedInsts in
+  def : GCNPat<
+    (fcanonicalize (v2bf16 (VOP3PMods v2bf16:$src, i32:$src_mods))),
+    (V_PK_MAX_NUM_BF16 $src_mods, $src, $src_mods, $src, DSTCLAMP.NONE)
----------------
arsenm wrote:

It doesn't really matter, the judgement should be based on power which I have no data on 

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


More information about the llvm-commits mailing list