[PATCH] D107708: [RISCV] Remove sext_inreg+add/sub/mul/shl isel patterns.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 8 00:12:19 PDT 2021


craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, frasercrmck, evandro, khchen, arcbbb, HsiangKai.
Herald added subscribers: StephenFan, vkmr, 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.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

Let the sext_inreg be selected to sext.w. Remove unneeded sext.w
during PostProcessISelDAG.

This gives opportunities for some other isel patterns to match
like the ADDIPair or matching mul with immediate to shXadd.

This becomes possible after D107658 <https://reviews.llvm.org/D107658> started selecting W instructions
based on users. The sext.w will be considered a W user so isel
will often select a W instruction for the sext.w input and we can
just remove the sext.w. Otherwise we can combine the sext.w with
a ADD/SUB/MUL/SLLI to create a new W instruction in parallel
to the the original instruction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107708

Files:
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
  llvm/lib/Target/RISCV/RISCVInstrInfo.td
  llvm/lib/Target/RISCV/RISCVInstrInfoM.td
  llvm/test/CodeGen/RISCV/add-imm.ll
  llvm/test/CodeGen/RISCV/xaluo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107708.365003.patch
Type: text/x-patch
Size: 14437 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210808/72df9a81/attachment.bin>


More information about the llvm-commits mailing list