[PATCH] D108551: [RISCV] Make more optimization for multiplication in the zba extension with SH*ADD.

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 23 06:12:24 PDT 2021


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

This patch make the following optimization.

(mul x, 2 + power_of_2) -> (SH1ADD x, (SLLI x, bits))
(mul x, 4 + power_of_2) -> (SH2ADD x, (SLLI x, bits))
(mul x, 8 + power_of_2) -> (SH3ADD x, (SLLI x, bits))


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108551

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfoB.td
  llvm/test/CodeGen/RISCV/rv32zba.ll
  llvm/test/CodeGen/RISCV/rv64zba.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108551.368083.patch
Type: text/x-patch
Size: 12456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210823/233731da/attachment.bin>


More information about the llvm-commits mailing list