[lld] [ELF] Making cdsort default for function reordering (PR #68638)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 15:09:40 PDT 2023


MaskRay wrote:

> Can we apply the same optimization for cdsort as in #68617? (ie limiting the size of the max chain to 512). Block reordering becomes 50x faster on some instances after the change, without sacrificing the quality. I am happy to test this too, if you share (some version of) the problematic call graph. Btw, cdsort is on by default in BOLT for ~5 years now. Likely something is off with the call graphs coming from the compiler.

I have applied the latest commits from #68617, but I do not see a speed-up for the internal program that I saw a timeout (20+min for the total build on a machine that may be slower than my pc). On my pc:

```
% time timeout 660 zsh /t/0.sh --call-graph-profile-sort=cdsort  # old
timeout 660 zsh /t/0.sh --call-graph-profile-sort=cdsort  548.21s user 3.63s system 101% cpu 9:02.64 total
% time timeout 600 zsh /t/0.sh --call-graph-profile-sort=cdsort  # new
timeout 600 zsh /t/0.sh --call-graph-profile-sort=cdsort  549.94s user 3.49s system 101% cpu 9:03.94 total
```

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


More information about the llvm-commits mailing list