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

[nfc] Clarify when the various PGO instrumentation passes run #92330

Merged
merged 3 commits into from
May 16, 2024

Conversation

mtrofin
Copy link
Member

@mtrofin mtrofin commented May 16, 2024

The code seems easier to read if it's centered on what the user wants rather than combinations of whatever internal variables.

The code seems easier to read if it's centered on what the user
wants rather than combinations of whatever internal variables.
if (PGOOpt && Phase != ThinOrFullLTOPhase::ThinLTOPostLink &&
(PGOOpt->Action == PGOOptions::IRInstr ||
PGOOpt->Action == PGOOptions::IRUse || !PGOOpt->MemoryProfile.empty()))
const bool IsPreLink = Phase != ThinOrFullLTOPhase::ThinLTOPostLink;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment above here that we have already asserted that this is not being executed for the FullLTOPostLink phase? So this is specific to ThinLTO and non-LTO.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

IsPGOPreLink && PGOOpt->Action == PGOOptions::IRInstr;
const bool IsPGOInstrUse =
IsPGOPreLink && PGOOpt->Action == PGOOptions::IRUse;
const bool IsMemprof = IsPGOPreLink && !PGOOpt->MemoryProfile.empty();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest IsMemprofUse.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

const bool IsMemprof = IsPGOPreLink && !PGOOpt->MemoryProfile.empty();
// We don't want to mix pgo ctx gen and pgo gen; we also don't currently
// enable ctx profiling from the frontend.
const bool IsCtxProfGen = !IsPGOInstrGen && IsPreLink &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you split out the Ctx profiling stuff into a different PR as that makes this one non-NFC and is separate from the PR description?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@mtrofin mtrofin merged commit 174cdec into llvm:main May 16, 2024
3 of 4 checks passed
@mtrofin mtrofin deleted the pipeline branch May 16, 2024 19:17
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.

2 participants