[lld] [lld][InstrProf] Profile guided function order (PR #96268)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 26 17:03:02 PDT 2024
================
@@ -147,6 +147,14 @@ def cs_profile_path: Joined<["--"], "cs-profile-path=">,
defm pgo_warn_mismatch: BB<"pgo-warn-mismatch",
"turn on warnings about profile cfg mismatch (default)",
"turn off warnings about profile cfg mismatch">, Group<grp_lld>;
+def profile_guided_function_order: Joined<["--"], "profile-guided-function-order=">,
+ MetaVarName<"<profile>">,
+ HelpText<"Read traces from <profile> to order functions to improve startup time">,
+ Group<grp_lld>;
----------------
ellishg wrote:
I actually thought about splitting this into a "profile" flag (to pass the profile to) and an "enable" flag (just a boolean flag to enable the optimization). Would this be preferred?
As for the flag name, I'm open to suggestions. I could prefix with "bp" for balanced partitioning, but I'm not sure the implementation details are needed in the flag. Like the help text suggests, the point of the flag is to reorder functions based on timestamps from IRPGO profiles. Thus, I thought `--profile-guided-function-order` made sense.
https://github.com/llvm/llvm-project/pull/96268
More information about the llvm-commits
mailing list