[lld] [lld][ELF] Sort thunks by their destination to allow quicker convergence (PR #209962)
Pranav Kant via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 16 08:26:03 PDT 2026
pranavk wrote:
Thanks Peter for taking a look. I agree the alternates you mention can add significant complexity which is probably not worth it (yet).
One another alternate solution that I had in mind which doesn't add complexity and I tested is use some sort of margin that gets subtracted from the branch range as a function of pass number. Eg: in pass 0, today, we mark functions out of range when they are more than 128MiB threshold. With this solution, as we reach higher passes, we reduce this threshold by some margin (say 512KiB). This avoids sorting but tradeoff is that now we may end up promoting some thunks to long that could have been fine with just the short sequence.
https://github.com/llvm/llvm-project/pull/209962
More information about the llvm-commits
mailing list