This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Accept function start as valid jump table entry
ClosedPublic

Authored by maksfb on Jul 24 2023, 10:39 PM.

Details

Summary

Jump tables may contain a function start address. One real-world example
is when a target basic block contains a recursive tail call that is
later optimized/folded into a jump table target.

While analyzing a jump table, we treat start address similar to an
address past the end of the containing function (a result of
__builtin_unreachable), i.e. we require another "regular" entry for the
heuristic to proceed.

Diff Detail

Event Timeline

maksfb created this revision.Jul 24 2023, 10:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 10:39 PM
Herald added a subscriber: treapster. · View Herald Transcript
maksfb requested review of this revision.Jul 24 2023, 10:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 10:39 PM
Amir accepted this revision.Jul 26 2023, 8:19 AM

Agree to allow function start as jump table entry conditional on presence of another valid entry.

This revision is now accepted and ready to land.Jul 26 2023, 8:19 AM
This revision was automatically updated to reflect the committed changes.