-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for stabilizing Profile-Guided Optimization support #59913
Copy link
Copy link
Closed
Labels
A-codegenArea: Code generationArea: Code generationC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-llvmWorking group: LLVM backend code generationWorking group: LLVM backend code generationmetabugIssues about issues themselves ("bugs about bugs")Issues about issues themselves ("bugs about bugs")
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-llvmWorking group: LLVM backend code generationWorking group: LLVM backend code generationmetabugIssues about issues themselves ("bugs about bugs")Issues about issues themselves ("bugs about bugs")
Type
Fields
Give feedbackNo fields configured for issues without a type.
Profile-guided optimization (PGO) is a common optimization technique for ahead-of-time compilers. It works by collecting data about a programs typical execution (e.g. probability of branches taken, typical runtime values of variables, etc) and then uses this information during program optimization for things like inlining decisions, machine code layout, or indirect call promotion.
LLVM supports different forms of PGO, the most effective of which relies on generating instrumented binaries that collect the profiling information. The Rust compiler has had experimental support for this via the
-Z pgo-genand-Z pgo-useflags for a while. This issue tracks the progress of making this functionality available in stable Rust.Steps:
run-maketest that makes sure thatinlineandcoldattributes are added to LLVM IR by LLVM's PGO passes. ( PGO: Add a run-make test that makes sure that PGO profiling data is used by the compiler during optimizations. #60262)codegentest making sure that instrumentation is generated as expected. (Add codegen test for PGO instrumentation. #60038)run-maketest that makes sure PGO works in a mixed Rust/C++ codebase using ThinLTO done vialld. (PGO - Add a smoketest for combining PGO with cross-language LTO. #61036)rustcalready behaves like Clang here: Pre-inlining is enabled except for-Copt-level=sand-Copt-level=z.-Z pgo-gencommandline option. #59874)-C profile-generateand-C profile-useflags (mirroring the corresponding Clang flags).Non-Goals:
Further Information:
cc @rust-lang/core @rust-lang/compiler