Description
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)