[PATCH] D140465: [RISCV] Add DAG combine to fold (select C, (add X, Y), Y) -> (add (select C, X, 0), Y).
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 21 00:56:43 PST 2022
craig.topper created this revision.
craig.topper added reviewers: reames, asb, luismarques.
Herald added subscribers: sunshaoce, VincentWu, StephenFan, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, steven.zhang, 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: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.
Similar for sub, or, and xor. All ops that have 0 as a neutral value.
This is based on a similar tranform in InstCombine.
This allows us to remove some XVentanaCondOps patterns and
some code from DAGCombine for RISCVISD::SELECT_CC.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D140465
Files:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoXVentana.td
llvm/test/CodeGen/RISCV/select.ll
llvm/test/CodeGen/RISCV/sextw-removal.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140465.484487.patch
Type: text/x-patch
Size: 20525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221221/b93e6e94/attachment.bin>
More information about the llvm-commits
mailing list