This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][PseudoProbe] Support new pseudo probe encoding
ClosedPublic

Authored by hoy on Oct 20 2022, 4:48 PM.

Details

Summary

This is the corresponding Bolt change to D135914: [PseudoProbe] Decode offset based pseudo probe.. To be
minimal intrusive, the pseudo probe re-encoding sticks with
the old encoding format. This is fine since unlike linker, Bolt
processes the pseudo probe section as a whole and it is free
from relocation overflow issues.

Diff Detail

Event Timeline

hoy created this revision.Oct 20 2022, 4:48 PM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
hoy requested review of this revision.Oct 20 2022, 4:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 4:48 PM
hoy edited the summary of this revision. (Show Details)Oct 20 2022, 4:51 PM
hoy edited the summary of this revision. (Show Details)Oct 20 2022, 4:55 PM

Is this change going to be tested in the parent diff or otherwise?

A couple of nits: change [Bolt] -> [BOLT] in the Title and use 72-char line width for the Summary.

bolt/lib/Rewrite/RewriteInstance.cpp
603–604

I left the comment on the parent diff regarding the types.

3547

nit:

3548

nit: this line looks more than 80 chars wide.

hoy added a comment.Oct 21 2022, 9:27 AM

Is this change going to be tested in the parent diff or otherwise?

Good question. We have internal tests not upstreamed yet. Maybe it's time to upstream them?

bolt/lib/Rewrite/RewriteInstance.cpp
603–604

Thanks, fixed in the parent diff.

3548

oops, thought the linter would help.

hoy updated this revision to Diff 469672.Oct 21 2022, 9:59 AM

Addressing comments.

Looks good. There's a couple of styling nits. You might need to run arc with --verbatim to update Title and Summary fields.

bolt/lib/Rewrite/RewriteInstance.cpp
603–604
605–606
3546
hoy marked 5 inline comments as done.Oct 21 2022, 3:53 PM
hoy updated this revision to Diff 469811.Oct 21 2022, 3:53 PM

Updating D136394: [Bolt][PseudoProbe] Support new pseudo probe encoding

hoy added a comment.Oct 21 2022, 3:57 PM

Looks good. There's a couple of styling nits. You might need to run arc with --verbatim to update Title and Summary fields.

I noticed that other Bolt commits has line wrapping in its summary. Does arc diff --verbatim do the trick?

Looks good. There's a couple of styling nits. You might need to run arc with --verbatim to update Title and Summary fields.

I noticed that other Bolt commits has line wrapping in its summary. Does arc diff --verbatim do the trick?

I mean if you fix Title+Summary locally, you'll need the flag to update the phabricator diff.

hoy retitled this revision from [Bolt][PseudoProbe] Support new pseudo probe encoding to [BOLT][PseudoProbe] Support new pseudo probe encoding.Oct 21 2022, 4:02 PM
hoy edited the summary of this revision. (Show Details)
wenlei added inline comments.Oct 25 2022, 5:03 PM
bolt/lib/Rewrite/RewriteInstance.cpp
605

A quick question for bolt folks - does BinarayFunction represent individual segments of split functions; or does BinaryFunction simply maps to original function, with MCSymbol under a binary function representing each split funclets? Asking because we want to make sure naming convention is consistent for probe emission and bolt.

maksfb added inline comments.Oct 25 2022, 5:48 PM
bolt/lib/Rewrite/RewriteInstance.cpp
605

We have a limited support for inputs with split functions. At the moment, we have one BinaryFunction for each function fragment, but it doesn't work well for a number of reasons, and for a proper support we will eventually have to merge the fragments into a single instance of a BinaryFunction. When BOLT splits functions, each fragment will come from the same instance of BinaryFunction.

@hoy, Amir will migrate the internal pseudo-probe tests. That should enable you to add/modify the test for this change.

hoy added a comment.Oct 25 2022, 5:51 PM

@hoy, Amir will migrate the internal pseudo-probe tests. That should enable you to add/modify the test for this change.

This is great! Actually I already have a fix to our internal pseudo probe tests. Will work with Amir to get that in.

Amir added a comment.Oct 25 2022, 6:38 PM

@hoy, Amir will migrate the internal pseudo-probe tests. That should enable you to add/modify the test for this change.

This is great! Actually I already have a fix to our internal pseudo probe tests. Will work with Amir to get that in.

Here's the test: D136729

wenlei added inline comments.Oct 25 2022, 6:42 PM
bolt/lib/Rewrite/RewriteInstance.cpp
605

Thanks for clarification. @hoy then I'd suggest let's not use the term binary function for split funclets during probe emission.

hoy added a subscriber: maksim.Oct 26 2022, 11:10 AM

@maksim Does the current version look good to you? Any more comments? Thanks.

bolt/lib/Rewrite/RewriteInstance.cpp
605

Sounds good. Changed to using split function.

hoy updated this revision to Diff 470878.Oct 26 2022, 11:11 AM

Rebasing

maksfb removed a subscriber: maksim.Oct 27 2022, 11:26 AM
maksfb accepted this revision.Oct 27 2022, 12:06 PM

LGTM. Thanks.

This revision is now accepted and ready to land.Oct 27 2022, 12:06 PM
hoy closed this revision.Oct 27 2022, 2:33 PM

Closed by commit rGd5a963ab8b40