-
Notifications
You must be signed in to change notification settings - Fork 11.5k
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
Conversation
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest IsMemprofUse.
There was a problem hiding this comment.
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 && |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The code seems easier to read if it's centered on what the user wants rather than combinations of whatever internal variables.