[llvm] [NVPTX] Lower bfloat16 add/mul/sub as fma on SM80 (PR #121065)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 25 18:26:00 PST 2024


================
@@ -17534,10 +17534,13 @@ template <class MatchContextClass> SDValue DAGCombiner::visitFMA(SDNode *N) {
       return N2;
   }
 
+  const bool PreferFMAAdd = (TLI.isOperationLegal(ISD::FMA, VT) &&
----------------
peterbell10 wrote:

Yes, in cases where both fma and add are illegal then I don't see any reason not to simplify the fma to an add. The subsequent legalization of fadd may result in a better sequence of instructions than the fma legalization.

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


More information about the llvm-commits mailing list