[PATCH] D147428: [LoongArch] Optimize multiplication with immediates

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 01:02:20 PDT 2023


benshi001 created this revision.
benshi001 added reviewers: XiaodongLoong, SixWeining, xen0n, wangleiat.
Herald added a subscriber: hiraditya.
Herald added a project: All.
benshi001 requested review of this revision.
Herald added subscribers: llvm-commits, jacquesguan.
Herald added a project: LLVM.

Optimize (mul r, c) to (SLLI (ALSL r, i0), i1), in which
c = (1 + (1 << i0)) << i1.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147428

Files:
  llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
  llvm/test/CodeGen/LoongArch/ir-instruction/mul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147428.510421.patch
Type: text/x-patch
Size: 6183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230403/0b77edb5/attachment.bin>


More information about the llvm-commits mailing list