[PATCH] D106230: [RISCV] Add custom isel to select (and (srl X, C1), C2) and (and (shl X, C1), C2)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 17 22:07:51 PDT 2021


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

Replace some existing isel patterns that are covered by the new
code. SLLIUWPat has been removed in favor of folding its root case
into the new code. The other uses in isel patterns for shXadd.uw
have been switched to using hardcoded AND masks.

This is based on the original version of D49585 <https://reviews.llvm.org/D49585> from ARM. The final
version of that was made a DAG combine, but I've chosen to keep it
as custom isel. I'm not convinced DAG combine is as good with
shift pairs as it is with and+shift. I saw some issues optimizing
the shifts created by vscale lowering if an and isn't created for
from a shift pair.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106230

Files:
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
  llvm/lib/Target/RISCV/RISCVInstrInfo.td
  llvm/lib/Target/RISCV/RISCVInstrInfoB.td
  llvm/test/CodeGen/RISCV/rv32zbp.ll
  llvm/test/CodeGen/RISCV/rv64i-exhaustive-w-insts.ll
  llvm/test/CodeGen/RISCV/rv64zbp.ll
  llvm/test/CodeGen/RISCV/srem-lkk.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106230.359595.patch
Type: text/x-patch
Size: 12214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210718/780ee054/attachment.bin>


More information about the llvm-commits mailing list