[PATCH] D149886: [ShrinkWrap] Allow shrinkwrapping past memory accesses to jump tables
Jonathon Penix via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 4 11:59:31 PDT 2023
jpenix-quic created this revision.
jpenix-quic added reviewers: apazos, efriedma, thegameg, qcolombet, fhahn.
Herald added subscribers: luke, StephenFan, frasercrmck, luismarques, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
Herald added a project: All.
jpenix-quic requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, MaskRay.
Herald added a project: LLVM.
This patch adds a check for whether the memory operand is known to be
a jump table and, if so, allows shrinkwrapping to continue. In the
case that we are looking at a jump table, I believe it is safe to
assume that the access will not be to the stack (but please correct me
if I am wrong here).
In the test attached, this is helpful in that we are able to generate
only one instruction for each non-default case in the original switch
statement.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D149886
Files:
llvm/lib/CodeGen/ShrinkWrap.cpp
llvm/test/CodeGen/RISCV/shrinkwrap-jump-table.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149886.519589.patch
Type: text/x-patch
Size: 4164 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230504/38145b52/attachment.bin>
More information about the llvm-commits
mailing list