Closed
Description
AutoFDO is a variant of PGO with less compile-time tradeoff. A few modifications are needed on rustc side to make it possible:
- "profile-sample-use": a LLVM option to load the profile. This is very similar to "profile-use" and can be trivially implemented.
- "debug-info-for-profiling": a very complicated option that has multiple effects in LLVM as well as the frontend (in the original impl, clang).
- The original patch enabled debug info for "start line of all subprograms, linkage name of all subprograms, and standalone subprograms (functions that has neither inlined nor been inlined)" on the frontend side (generation of DWARF)
- Subsequent patches have made this flag to be used to gate
AddDiscriminator
pass. It doesn't seem that we are calling this pass in Rust? - Many pass control their behavior based on the optional boolean passed to
createCompileUnit
Also (maybe) unlike PGO, AutoFDO needs at least line-level debuginfo to work.