[PATCH] D111117: [RISCV] Optimize (add (shl x, c0), c1)
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 4 22:00:01 PDT 2021
benshi001 created this revision.
benshi001 added reviewers: craig.topper, luismarques, asb, 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.
Transform (add (shl x, c0), c1) ->
(add (shl (add x, c1>>c0), c0), c1-(c1>>c0<<c0)),
if c1>>c0 and c1-(c1>>c0<<c0) are simm12, while c1 is not.
Or transform (add (shl x, c0), c1) ->
(shl (add x, c1>>c0), c0),
if c1-(c1>>c0<<c0) is zero, and c1>>c0 is simm12 while c1 is not.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D111117
Files:
llvm/test/CodeGen/RISCV/shlimm-addimm.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111117.377087.patch
Type: text/x-patch
Size: 11312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211005/7dea67d8/attachment.bin>
More information about the llvm-commits
mailing list