[PATCH] D80801: [DAGCombiner] allow more folding of fadd + fmul into fma

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 10:53:51 PDT 2020


spatel added a comment.

In D80801#2063488 <https://reviews.llvm.org/D80801#2063488>, @rscottmanley wrote:

> Wouldn't it be better to choose between what you have here fmadd(a,b,fma(c,d,n)) and a*b + fmadd(c,d,n) for targets that perform worse with FMA chains?


Not sure if I'm understanding the question. Is there a target or a code pattern with a known disadvantage for the 2 fma variant?
Note that the entire set of transforms in visitFADDForFMACombine() is gated on legality checks for FMA(D) nodes, so we are assuming that these ops are supported if we reach this point in the code. There's also an existing target bailout with the generateFMAsInMachineCombiner() hook.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80801/new/

https://reviews.llvm.org/D80801





More information about the llvm-commits mailing list