[PATCH] D90575: [RISCV] Add missing patterns for rotr with immediate for Zbb/Zbp extensions.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 1 15:50:10 PST 2020


craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, lenary, lewis-revill, PaoloS.
Herald added subscribers: frasercrmck, NickHung, evandro, apazos, sameer.abuasal, pzheng, 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.
Herald added a project: LLVM.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.

DAGCombine doesn't canonicalize rotl/rotr with immediate so we
need patterns for both.

Remove the custom matcher for rotl to RORI and just use a SDNodeXForm
to convert the immediate instead.. Doing this gives priority to the
rev32/rev16 versions of grevi over rori since an explicit immediate
is more precise than any immediate. I also added rotr patterns for
rev32/rev16.

There is at least one other grev pattern than probably needs a
another rotr pattern, but we need more test coverage first.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90575

Files:
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
  llvm/lib/Target/RISCV/RISCVInstrInfoB.td
  llvm/test/CodeGen/RISCV/rv32Zbbp.ll
  llvm/test/CodeGen/RISCV/rv32Zbp.ll
  llvm/test/CodeGen/RISCV/rv64Zbbp.ll
  llvm/test/CodeGen/RISCV/rv64Zbp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90575.302179.patch
Type: text/x-patch
Size: 10794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201101/958a8648/attachment.bin>


More information about the llvm-commits mailing list