[lld] [lld][ELF] Extend profile guided function ordering to ELF binaries (PR #117514)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 22:53:21 PST 2024


================
@@ -141,6 +141,20 @@ def call_graph_profile_sort: JJ<"call-graph-profile-sort=">,
 def : FF<"no-call-graph-profile-sort">, Alias<call_graph_profile_sort>, AliasArgs<["none"]>,
   Flags<[HelpHidden]>;
 
+defm irpgo_profile_sort: Eq<"irpgo-profile-sort",
+    "Read the IRPGO profile at <profile> to order sections to improve startup time">;
+
+defm compression_sort_startup_functions: BB<"compression-sort-startup-functions",
+    "Order startup functions to improve compressed size in addition to startup time",
+    "Do not order startup function for compression">;
+
+def compression_sort: JJ<"compression-sort=">,
----------------
MaskRay wrote:

@ellishg ELF has the compressed section feature https://maskray.me/blog/2022-01-23-compressed-debug-sections

Mach-O doesn't have the feature, but would it make sense to rename the Mach-O option? Perhaps these BP related options should all use bp- as a prefix, unless obvious from the context (e.g. `--irpgo-*`)?



https://github.com/llvm/llvm-project/pull/117514


More information about the llvm-commits mailing list