[lld] 15f0ad2 - [ELF] Bump the limit of thunk creation passes from 10 to 15

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 14:18:26 PDT 2020


I've never been happy with this limit on the number of iterations, since
you can construct inputs that go over the limit, and you can exceed the
limit purely by chance (as you discovered).

Would it be better to make this based on progress? i.e. if there are no
more possible places to insert a thunk call, then give up.

Peter

On Wed, Sep 16, 2020 at 2:05 PM Fangrui Song via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Fangrui Song
> Date: 2020-09-16T14:05:22-07:00
> New Revision: 15f0ad2fa29beaf1dad1548ccb97c2c729ea53cd
>
> URL:
> https://github.com/llvm/llvm-project/commit/15f0ad2fa29beaf1dad1548ccb97c2c729ea53cd
> DIFF:
> https://github.com/llvm/llvm-project/commit/15f0ad2fa29beaf1dad1548ccb97c2c729ea53cd.diff
>
> LOG: [ELF] Bump the limit of thunk creation passes from 10 to 15
>
> I have noticed that a 374MiB powerpc64le 'ld.lld' requires 11 passes to
> link.
> There is a ThunkSection (whose parent OutputSection is ".text" of 169MiB)
> with 12867 thunks.
>
> Added:
>
>
> Modified:
>     lld/ELF/Writer.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
> index 5ef37e9ecb89..f42686f08e64 100644
> --- a/lld/ELF/Writer.cpp
> +++ b/lld/ELF/Writer.cpp
> @@ -1701,8 +1701,8 @@ template <class ELFT> void
> Writer<ELFT>::finalizeAddressDependentContent() {
>      bool changed = target->needsThunks && tc.createThunks(outputSections);
>
>      // With Thunk Size much smaller than branch range we expect to
> -    // converge quickly; if we get to 10 something has gone wrong.
> -    if (changed && tc.pass >= 10) {
> +    // converge quickly; if we get to 15 something has gone wrong.
> +    if (changed && tc.pass >= 15) {
>        error("thunk creation not converged");
>        break;
>      }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>


-- 
-- 
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200916/dddff481/attachment.html>


More information about the llvm-commits mailing list