This is an archive of the discontinued LLVM Phabricator instance.

[ShrinkWrap] Allow shrinkwrapping past memory accesses to jump tables

Authored by jpenix-quic on May 4 2023, 11:59 AM.



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

Diff Detail

Event Timeline

jpenix-quic created this revision.May 4 2023, 11:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 11:59 AM
jpenix-quic requested review of this revision.May 4 2023, 11:59 AM

Make if statement slightly more tidy.

This revision is now accepted and ready to land.May 8 2023, 11:22 AM