[llvm] [AMDGPU][DAGCombiner][GlobalISel] Prevent FMA contraction when multiply cannot be eliminated (PR #169735)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 27 04:00:16 PST 2025


jayfoad wrote:

The idea seems reasonable to me but note it is somewhat at odds with the original motivation for the "aggressive" option:
62ac736faa3f9e1307529d365a5267b9cfbb8084

> [...] The heuristic used by DAGCombine to form FMAs checks that the FMUL has only one
use, but this is overly-conservative on some systems. Specifically, if the FMA
and the FADD have the same latency (and the FMA does not compete for resources
with the FMUL any more than the FADD does), there is no need for the
restriction, and furthermore, **forming the FMA leaving the FMUL can still allow
for higher overall throughput and decreased critical-path length**.

@hfinkel



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


More information about the llvm-commits mailing list