[PATCH] D62252: [DAGCombiner][X86][AArch64][SPARC][SystemZ] y - (x + C) -> (y - x) - C fold

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 06:31:55 PDT 2019


lebedev.ri created this revision.
lebedev.ri added reviewers: RKSimon, craig.topper, spatel.
lebedev.ri added a project: LLVM.
Herald added subscribers: jrtc27, fedor.sergeev, kristof.beyls, javed.absar, jyknight.

Direct sibling of D62223 <https://reviews.llvm.org/D62223> patch.
While i don't have a direct motivational pattern for this,
it would seem to make sense to handle both patterns (or none),
for symmetry?

The aarch64 changes look neutral;
sparc and systemz look like improvement (one less instruction each);
x86 changes - 32bit case improves, 64bit case shows that LEA no longer
gets constructed, which may be because that whole test is `-mattr=+slow-lea,+slow-3ops-lea`

https://rise4fun.com/Alive/ffh


Repository:
  rL LLVM

https://reviews.llvm.org/D62252

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/AArch64/shift-amount-mod.ll
  test/CodeGen/AArch64/sink-addsub-of-const.ll
  test/CodeGen/SPARC/2013-05-17-CallFrame.ll
  test/CodeGen/SystemZ/alloca-03.ll
  test/CodeGen/X86/sink-addsub-of-const.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62252.200724.patch
Type: text/x-patch
Size: 5767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190522/44def5e2/attachment.bin>


More information about the llvm-commits mailing list