[PATCH] D119089: [RISCV] Teach RISCVDAGToDAGISel::selectShiftMask to replace sub from constant with neg.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 6 11:46:12 PST 2022


craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, kito-cheng, arcbbb, khchen.
Herald added subscribers: VincentWu, luke957, achieveartificialintelligence, StephenFan, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, pengfei, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, kristof.beyls.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

If the shift amount is (sub C, X) where C is 0 modulo the size of
the shift, we can replace it with neg or negw.

Similar is is done for AArch64 and X86.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119089

Files:
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
  llvm/test/CodeGen/RISCV/rotl-rotr.ll
  llvm/test/CodeGen/RISCV/shifts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119089.406270.patch
Type: text/x-patch
Size: 16126 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220206/1489125e/attachment.bin>


More information about the llvm-commits mailing list