[PATCH] D132837: [ISel] Enable generating more fma instructions.

Thomas Symalla via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 02:02:05 PDT 2022


tsymalla created this revision.
tsymalla added reviewers: foad, nhaehnle.
Herald added subscribers: kosarev, ecnelises, kerbowa, hiraditya, jvesely.
Herald added a project: All.
tsymalla requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In fast-math mode, in some cases a DAG like

(fadd (fma (a, b, ... (fma (c, d, (fmul (e, f)))))), g)

can occur (for instance, when combining several fadds and fmuls
into fma instructions), but being left with an outermost fadd and an innermost fmul, this sequence can be transformed into

(fadd (fma (a, b, ... (fma (c, d, g)))), (fmul (e, f))

which swaps the solidary operand from the fadd with the
innermost fmul. This allows for generating even more fma instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132837

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132837.456289.patch
Type: text/x-patch
Size: 3628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220829/e7678971/attachment.bin>


More information about the llvm-commits mailing list