Add Context-Sensitive IR PGO (CSIR PGO) #118562
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Clang has support for an additional PGO mode - Context-Sensitive PGO. This is completely the same way as now used by Rustc but the main difference is when instrumentation is done. In usual (IR PGO) instrumentation is done before the inlining phase, with CSIR PGO - after the inlining phase. This could be important since the inlining decisions can introduce some noise into the profiling information.
In llvm/llvm-project#56274 (comment) comment, there is a small insight into the actual effects on the performance. According to this, we can treat CSIR PGO as a light replacement for LLVM BOLT optimization. For some people, it could be important since LLVM BOLT does not work on all platforms.
Right now it's not clear, could we implement CSIR PGO by just passing the right LLVM flag, or some frontend changes are required too? I guess some CSIR PGO implementation in Clang is required here. In any way, CSIR PGO information should be added to the Rustc PGO documentation.
CSIR PGO also was mentioned in the initial PGO issue for Rustc: #59913 (comment)
The text was updated successfully, but these errors were encountered: