Skip to content

[BOLT][BAT] Fix handling of split functions #87569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 11, 2024

Conversation

aaupov
Copy link
Contributor

@aaupov aaupov commented Apr 3, 2024

Move BAT parent function lookup outside getLocationName, to the
scope where we retrieve FuncBranchData linked with the function.

Previously DataAggregator would store branch profile recorded in the
split fragment in FuncBranchData associated with the fragment, and
perform name translation in getLocationName for symbol name only.
This works for fdata profile which is printed out as-is, but doesn't
work with BAT YAML profile writer which requires a combined profile.

The issue necessitated fixupBATProfile which partially addressed the
issue (reassigned inter-fragment calls back into intra-function
branches). However, fixupBATProfile fails to address disjoint
profiles (i.e. doesn't merge FuncBranchData for fragments back
into parent). This diff eliminates the need for fixupBATProfile by
removing the root cause of the issue.

Test Plan: NFC for existing tests

aaupov added 4 commits April 3, 2024 15:44
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
@aaupov aaupov marked this pull request as ready for review April 5, 2024 05:05
Created using spr 1.3.4
HaohaiWen and others added 2 commits April 7, 2024 23:47
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
aaupov added 2 commits April 11, 2024 01:43
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
@aaupov aaupov changed the base branch from users/aaupov/spr/main.boltbat-fix-handling-of-split-functions to main April 11, 2024 19:06
@aaupov aaupov merged commit 8840992 into main Apr 11, 2024
@aaupov aaupov deleted the users/aaupov/spr/boltbat-fix-handling-of-split-functions branch April 11, 2024 19:07
aaupov added a commit that referenced this pull request Apr 11, 2024
Call site information setting was conditioned on branch information
presence for a given block. However, it's possible to have sampled
profile lacking one or the other for a given basic block.

Iterate over branch profiles and call profiles independently to cover
all recorded profile data.

Depends on #87569

Test Plan: Updated bolt/test/X86/yaml-secondary-entry-discriminator.s

Reviewers: ayermolo, dcci, maksfb, rafaelauler

Reviewed By: maksfb

Pull Request: #87743
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants