[PATCH] D97937: [AMDGPU][GlobalISel] Transform (fadd (fpext (fmul x, y)), z) -> (fma (fpext x), (fpext y), z)

Mateja Marjanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 05:03:53 PST 2021


matejam created this revision.
matejam added reviewers: foad, arsenm, mbrkusanin, Petar.Avramovic.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, rovka, yaxunl, nhaehnle, jvesely, kzhuravl.
matejam requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Instead of add and mul instructions, use v_mad, v_mac or v_fma if fma
instructions are faster and are legal for the given architecture.
Combiner for a case that adds two function arguments, extends the result
and multiplies it with the third function argument, and transforms that
into extend instructions combined with some of the fma instruction
depending on the architecture.


https://reviews.llvm.org/D97937

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-add-ext-mul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97937.328127.patch
Type: text/x-patch
Size: 15649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210304/c936eddb/attachment.bin>


More information about the llvm-commits mailing list