This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Fix ignored LP at fragment start
ClosedPublic

Authored by FPar on Aug 17 2022, 11:30 AM.

Details

Summary

If the first block of a fragment is also a landing pad, the landing pad
is not used if an exception is thrown. This is because the landing pad
is at the same start address that the corresponding LSDA describes. In
that case, the offset in the call site records to refer to that landing
pad is zero, and a zero offset is interpreted by the personality
function as "no handler" and ignored.

Diff Detail

Event Timeline

FPar created this revision.Aug 17 2022, 11:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2022, 11:30 AM
Herald added a subscriber: ayermolo. · View Herald Transcript
FPar requested review of this revision.Aug 17 2022, 11:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2022, 11:30 AM
FPar updated this revision to Diff 453435.Aug 17 2022, 2:41 PM

Replace zero with trap instruction

Amir added inline comments.Aug 17 2022, 2:55 PM
bolt/test/runtime/X86/Inputs/lp-fragment-start.fdata
1

You can merge fdata into the assembly source by leveraging link_fdata script. See e.g. bolt/test/X86/lto-name-match.s

FPar updated this revision to Diff 453448.Aug 17 2022, 3:30 PM

Inline fdata into assembly

FPar marked an inline comment as done.Aug 17 2022, 3:32 PM
FPar added inline comments.
bolt/test/runtime/X86/Inputs/lp-fragment-start.fdata
1

I didn't know that, thanks!

FPar updated this revision to Diff 453464.Aug 17 2022, 4:12 PM
FPar marked an inline comment as done.

Use symbol to calculate offset for fdata

Amir accepted this revision.Aug 17 2022, 4:24 PM

Thanks for fixing this corner case!

This revision is now accepted and ready to land.Aug 17 2022, 4:24 PM
This revision was automatically updated to reflect the committed changes.