Skip to content

Support AutoFDO (sample-based PGO) #64892

Closed
@ishitatsuyuki

Description

@ishitatsuyuki

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions