[PATCH] D128123: [SDAG] try to replace subtract-from-constant with xor

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 18 08:11:37 PDT 2022


spatel created this revision.
spatel added reviewers: RKSimon, foad, craig.topper, arsenm, deadalnix, dmgreen.
Herald added subscribers: jsji, kosarev, StephenFan, frasercrmck, ecnelises, kerbowa, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, fedor.sergeev, hiraditya, jvesely, nemanjai, mcrosier, jyknight.
Herald added a project: All.
spatel requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, MaskRay, wdng.
Herald added a project: LLVM.

This is almost the same as the abandoned D48529 <https://reviews.llvm.org/D48529>, but it allows splat vector constants too.
This replaces the x86-specific code that was added with the alternate patch D48557 <https://reviews.llvm.org/D48557> with the original generic combine. 
This transform is a less restricted form of an existing InstCombine and the proposed SDAG equivalent for that in D128080 <https://reviews.llvm.org/D128080>:
https://alive2.llvm.org/ce/z/OUm6N_


https://reviews.llvm.org/D128123

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/X86/X86InstrCompiler.td
  llvm/test/CodeGen/AArch64/sub1.ll
  llvm/test/CodeGen/AMDGPU/ds-sub-offset.ll
  llvm/test/CodeGen/AMDGPU/setcc-multiple-use.ll
  llvm/test/CodeGen/ARM/intrinsics-overflow.ll
  llvm/test/CodeGen/ARM/usub_sat.ll
  llvm/test/CodeGen/ARM/usub_sat_plus.ll
  llvm/test/CodeGen/PowerPC/bool-math.ll
  llvm/test/CodeGen/PowerPC/select_const.ll
  llvm/test/CodeGen/RISCV/atomic-rmw.ll
  llvm/test/CodeGen/RISCV/atomic-signext.ll
  llvm/test/CodeGen/SPARC/64bit.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128123.438129.patch
Type: text/x-patch
Size: 21551 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220618/e6d63951/attachment.bin>


More information about the llvm-commits mailing list