Skip to content
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

[BOLT] Check BF state in stale matching #85339

Merged
merged 2 commits into from
Mar 15, 2024
Merged

[BOLT] Check BF state in stale matching #85339

merged 2 commits into from
Mar 15, 2024

Conversation

aaupov
Copy link
Contributor

@aaupov aaupov commented Mar 14, 2024

Only apply stale matching if the binary function is in CFG state, i.e.
has basic blocks.

Test Plan:
Updated bolt/test/X86/reader-stale-yaml.test

@@ -705,6 +706,9 @@ void assignProfile(BinaryFunction &BF,

bool YAMLProfileReader::inferStaleProfile(
BinaryFunction &BF, const yaml::bolt::BinaryFunctionProfile &YamlBF) {
if (BF.getState() != BinaryFunction::State::CFG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can use if (!BF.hasCFG())..., otherwise LGTM.

Copy link
Member

@dcci dcci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after Maksim's comment.

@aaupov aaupov merged commit b431546 into llvm:main Mar 15, 2024
3 of 4 checks passed
@aaupov aaupov deleted the lk-rebase branch March 15, 2024 17:55
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.

None yet

3 participants