[PATCH] D140324: [SDAG] neg x with one demanded bit is x

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 10:53:04 PST 2022


reames created this revision.
reames added reviewers: craig.topper, asb, frasercrmck, kito-cheng.
Herald added subscribers: armkevincheng, sjarus, eric-k256, StephenFan, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, bollu, simoncook, johnrusso, rbar, hiraditya, arichardson, mcrosier.
Herald added a project: All.
reames requested review of this revision.
Herald added subscribers: pcwang-thead, MaskRay.
Herald added a project: LLVM.

We have a version of this transform in InstCombine, but surprisingly not in SDAG.

Even more surprisingly, this benefits RISCV, but no other target.  This was surprising enough I double checked my build configuration to make sure all targets were enabled; they appear to be.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140324

Files:
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/RISCV/alu64.ll
  llvm/test/CodeGen/RISCV/bittest.ll
  llvm/test/CodeGen/RISCV/forced-atomics.ll
  llvm/test/CodeGen/RISCV/fpclamptosat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140324.484011.patch
Type: text/x-patch
Size: 6859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221219/4007d9d2/attachment.bin>


More information about the llvm-commits mailing list