[PATCH] D85548: Allow fneg + strict_fadd -> strict_fsub in DAGCombiner

Andrew J Wock via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 12:28:40 PDT 2020


ajwock created this revision.
ajwock added reviewers: arsenm, spatel, craig.topper, andrew.w.kaylor, kpn, uweigand, pengfei, sepavloff.
Herald added subscribers: llvm-commits, kerbowa, steven.zhang, hiraditya, nhaehnle, jvesely.
Herald added a project: LLVM.
ajwock requested review of this revision.
Herald added a subscriber: wdng.

This is the first of a set of DAGCombiner changes enabling strictfp optimizations.  I want to test to waters with this to make sure changes like these are acceptable for the strictfp case- this particular change should preserve exception ordering and result precision perfectly, and many other possible changes appear to be able to as well.

Copied from regular fadd combines but modified to preserve ordering via the chain, this change allows strict_fadd x, (fneg y) to become strict_fsub x, y and strict_fadd (fneg x), y to become strict_fsub y, x.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85548

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AMDGPU/strict_fadd.f32.ll
  llvm/test/CodeGen/X86/strict-fadd-combines.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85548.283987.patch
Type: text/x-patch
Size: 4475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200807/8890b4b2/attachment.bin>


More information about the llvm-commits mailing list