[PATCH] D156144: [RISCV] Add simple DAG combine to pull xor with 1 through select_cc.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 10:23:09 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: asb, wangpc, mgudim, reames.
Herald added subscribers: jobnoorman, luke, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: eopXD, MaskRay.
Herald added a project: LLVM.

If we're selecting the result of two setccs that have been legalized
by introducing an xor with 1, we can pull the xor with 1 through the
select to enable more optimizations.

We could generalize this to other binary operators with identical
conditions, but those are usually caught before we legalize the select.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156144

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/atomic-rmw.ll
  llvm/test/CodeGen/RISCV/atomic-signext.ll
  llvm/test/CodeGen/RISCV/atomicrmw-uinc-udec-wrap.ll
  llvm/test/CodeGen/RISCV/condops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156144.543620.patch
Type: text/x-patch
Size: 15477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230724/9d22bafc/attachment.bin>


More information about the llvm-commits mailing list