[llvm] [SDAG] Heed enableAggressiveFMAFusion when folding fma(a,b,c*d)+e (PR #94209)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 05:28:40 PDT 2024


jayfoad wrote:

This effectively reverts https://reviews.llvm.org/D28332 "DAGCombiner: Add hasOneUse checks to fadd/fma combine" (@arsenm @RKSimon). The description there was:

> Even with aggressive fusion enabled, this requires duplicating
> the fmul, or increases an fadd to another fma which is not an
> improvement.

But replacing a dependent fmul-fma-fadd sequence with fma-fma does reduce overall latency (assuming fadd/fmul/fma all have the same performance), which was the point of enableAggressiveFMAFusion in the first place, as described in 62ac736faa3f9e1307529d365a5267b9cfbb8084 (@hfinkel).

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


More information about the llvm-commits mailing list