This is an archive of the discontinued LLVM Phabricator instance.

[EHStreamer] Omit @LPStart when function has no landing pads
ClosedPublic

Authored by rahmanl on Aug 10 2022, 3:20 PM.

Details

Summary

When no landing pads exist for a function, @LPStart is undefined and must be omitted.

EH table is generally not emitted for functions without landing pads, except when the personality function is uknown (!isNoOpWithoutInvoke(classifyEHPersonality(Per))). In that case, we must omit @LPStart even when machine function splitting is enabled.

Diff Detail

Event Timeline

rahmanl created this revision.Aug 10 2022, 3:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2022, 3:20 PM
rahmanl requested review of this revision.Aug 10 2022, 3:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2022, 3:20 PM

The subject can remove the ending period. Either [AsmPrinter] or [EHStreamer] is a good tag.

rahmanl updated this revision to Diff 451948.Aug 11 2022, 12:31 PM

Add test case.

rahmanl retitled this revision from Omit @LPStart when function has no landing pads. to [EHStreamer] Omit @LPStart when function has no landing pads.Aug 11 2022, 12:32 PM
rahmanl updated this revision to Diff 451950.Aug 11 2022, 12:35 PM

Revised the comment.

rahmanl edited the summary of this revision. (Show Details)Aug 11 2022, 12:35 PM
MaskRay added inline comments.Aug 11 2022, 1:36 PM
llvm/test/CodeGen/X86/gcc_except_table_bb_sections_nolpads.ll
4

-code-model=small can be removed.

27

Consider checking the full content, i.e. .uleb128 .Laction_table_base0-.Lcst_begin0 and .uleb128 foo.__part.2-foo.__part.2 can be interesting as well.

MaskRay accepted this revision.Aug 11 2022, 1:39 PM
This revision is now accepted and ready to land.Aug 11 2022, 1:39 PM

Perhaps mention in the description that this is related to !isNoOpWithoutInvoke(classifyEHPersonality(Per)) in DwarfCFIException.cpp

rahmanl edited the summary of this revision. (Show Details)Aug 15 2022, 2:57 PM
rahmanl updated this revision to Diff 452814.Aug 15 2022, 2:58 PM

Include full content of EH table in the test.

rahmanl marked 2 inline comments as done.Aug 15 2022, 2:58 PM

Thanks for the review @MaskRay

This revision was landed with ongoing or failed builds.Aug 15 2022, 5:09 PM
This revision was automatically updated to reflect the committed changes.