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

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 11 11:13:47 PST 2024


================
@@ -1083,6 +1084,15 @@ static void maybeShuffle(Ctx &ctx,
 // Builds section order for handling --symbol-ordering-file.
 static DenseMap<const InputSectionBase *, int> buildSectionOrder(Ctx &ctx) {
   DenseMap<const InputSectionBase *, int> sectionOrder;
+  if (ctx.arg.bpStartupFunctionSort || ctx.arg.bpFunctionOrderForCompression ||
+      ctx.arg.bpDataOrderForCompression) {
+    TimeTraceScope timeScope("Balanced Partitioning Section Orderer");
+    sectionOrder = runBalancedPartitioning(
+        ctx, ctx.arg.irpgoProfilePath, ctx.arg.bpFunctionOrderForCompression,
----------------
ellishg wrote:

```suggestion
        ctx, ctx.arg.bpStartupFunctionSort ? ctx.arg.irpgoProfilePath : "", ctx.arg.bpFunctionOrderForCompression,
```

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


More information about the llvm-commits mailing list