[PATCH] D156159: [RISCV] Add DAG combine to pull xor with 1 through select idiom that uses czero_eqz/nez.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 11:34:23 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 are selecting between two setccs that need to be legalized
with xor, the select will be legalized first. Detect this pattern
so we can pull the xor through to expose it to additional
optimizations.

We could generalize this to other operations, but those normally
get handled in DAG combine before select legalization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156159

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/condops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156159.543658.patch
Type: text/x-patch
Size: 6006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230724/0b3a1994/attachment.bin>


More information about the llvm-commits mailing list