[PATCH] D111141: [RISCV] Optimize (add (mul r, c0), c1)
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 5 05:44:28 PDT 2021
benshi001 created this revision.
benshi001 added reviewers: luismarques, asb, craig.topper, jrtc27.
Herald added subscribers: achieveartificialintelligence, vkmr, frasercrmck, evandro, 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.
benshi001 requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.
Optimize (add (mul x, c0), c1) ->
(add (mul (add x, c1/c0+1), c0), c1%c0-c0),
if c1/c0+1 and c1%c0-c0 are simm12, while c1 is not.
Optimize (add (mul x, c0), c1) ->
(add (mul (add x, c1/c0-1), c0), c1%c0+c0),
if c1/c0-1 and c1%c0+c0 are simm12, while c1 is not.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D111141
Files:
llvm/test/CodeGen/RISCV/addimm-mulimm.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111141.377166.patch
Type: text/x-patch
Size: 10003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211005/4cae0257/attachment.bin>
More information about the llvm-commits
mailing list