[PATCH] D98050: [AMDGPU][GlobalISel] Transform (fsub (fpext (fneg (fmul x, y))), z) -> (fneg (fma (fpext x), (fpext y), z))

Mateja Marjanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 5 07:51:39 PST 2021


matejam created this revision.
matejam added reviewers: foad, arsenm, Petar.Avramovic, mbrkusanin.
matejam added a project: LLVM.
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.

Instead of sub 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 has one multiplication, which gets negated and
extended, and from that the third argument is subtracted. This combiner
will transform that into two extends and one negation within the fma/fmad
instruction.


https://reviews.llvm.org/D98050

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-sub-ext-neg-mul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98050.328534.patch
Type: text/x-patch
Size: 22108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210305/960c62ec/attachment.bin>


More information about the llvm-commits mailing list