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

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


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

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 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/D98049

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-mul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98049.328532.patch
Type: text/x-patch
Size: 13458 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210305/b2cf40ac/attachment.bin>


More information about the llvm-commits mailing list