[PATCH] D66755: [DAGCombiner] cancel fnegs from multiplied operands of FMA

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 10:37:39 PDT 2019


spatel created this revision.
spatel added reviewers: qiucf, hfinkel, cameron.mcinally.
Herald added subscribers: jsji, MaskRay, hiraditya, nhaehnle, jvesely, nemanjai, mcrosier.
Herald added a project: LLVM.

(-X) * (-Y) + Z --> X * Y + Z

This is a missing optimization that shows up as a potential regression in D66050 <https://reviews.llvm.org/D66050>, so I think we should solve it first. We appear to be partly missing this fold in IR as well.

We do handle the simpler case of: 
(-X) * (-Y) --> X * Y


https://reviews.llvm.org/D66755

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AMDGPU/fneg-combines.ll
  llvm/test/CodeGen/PowerPC/fneg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66755.217196.patch
Type: text/x-patch
Size: 4656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190826/24e47a03/attachment-0001.bin>


More information about the llvm-commits mailing list