This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Generate sections for multiple fragments
ClosedPublic

Authored by FPar on Jul 25 2022, 2:43 PM.

Details

Summary

This patch adds support to generate any number of sections that are
assigned to fragments of functions that are split more than two-way.
With this, a function's *nth* split fragment goes into section
.text.cold.n.

This also changes FunctionLayout::erase to make sure, that there are
no empty fragments at the end of the function. This sometimes happens
when blocks are erased from the function. To avoid creating symbols
pointing to these fragments, they need to be removed.

Diff Detail

Event Timeline

FPar created this revision.Jul 25 2022, 2:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 2:43 PM
Herald added a subscriber: ayermolo. · View Herald Transcript
FPar requested review of this revision.Jul 25 2022, 2:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 2:43 PM
FPar removed a subscriber: ayermolo.
FPar updated this revision to Diff 447895.Jul 26 2022, 5:14 PM

Add test case for split-all strategy

FPar updated this revision to Diff 449063.Aug 1 2022, 9:58 AM

Rebase

FPar updated this revision to Diff 449488.Aug 2 2022, 5:03 PM

Don't remove empty fragments when erasing blocks

FPar updated this revision to Diff 450869.Aug 8 2022, 10:35 AM

Trim empty fragments at end and updateOutputValues per fragment

FPar edited the summary of this revision. (Show Details)Aug 8 2022, 10:55 AM
FPar edited the summary of this revision. (Show Details)Aug 8 2022, 10:59 AM
FPar added subscribers: spupyrev, ayermolo.
FPar updated this revision to Diff 453117.Aug 16 2022, 1:50 PM

Cleanup

rafauler accepted this revision.Aug 17 2022, 5:22 PM

LGTM

bolt/lib/Core/BinaryFunction.cpp
4066

symbol might have not been emitted

This revision is now accepted and ready to land.Aug 17 2022, 5:22 PM
FPar updated this revision to Diff 453873.Aug 18 2022, 9:50 PM

Fix comment grammar

This revision was landed with ongoing or failed builds.Aug 18 2022, 9:56 PM
This revision was automatically updated to reflect the committed changes.