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

Support AutoFDO (sample-based PGO) #64892

Closed
ishitatsuyuki opened this issue Sep 29, 2019 · 1 comment
Closed

Support AutoFDO (sample-based PGO) #64892

ishitatsuyuki opened this issue Sep 29, 2019 · 1 comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ishitatsuyuki
Copy link
Contributor

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.

@ishitatsuyuki ishitatsuyuki added A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 29, 2019
@jonas-schievink jonas-schievink added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Sep 29, 2019
@mikebenfield
Copy link
Contributor

I plan to look into this. If anyone else has insight into this issue that may not be immediately clear please let me know.

@bors bors closed this as completed in a17193d Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants