Heads-up: object size threshold for lifetime markers insertion will go away

Reid Kleckner rnk at google.com
Tue Oct 7 11:27:00 PDT 2014


Go for it. :)

On Tue, Oct 7, 2014 at 10:03 AM, Arnaud A. de Grandmaison <
arnaud.degrandmaison at arm.com> wrote:

> [Sorry for the cross-posting, but this future change in clang can affect
> llvm optimization passes]
>
>
>
> Language frontends can insert lifetime.start / lifetime.end markers for
> objects allocated on the stack, providing the optimization passes in LLVM
> with lifetime information so that they can share stack slots and reduce
> stack usage of the generated code. Today, those lifetime markers are only
> inserted for objects > 32 bytes. This threshold was set to prevent
>  impacting compile time. Lifetime markers have been in use for a long time
> now, and some passes got fixed to deal gracefully with them.
>
>
>
> I intend to commit soon a patch removing this threshold, unless someone
> objects or raise concerns. Removing the threshold can only improve stack
> size usage of the generated code, but there is a risk that some specific
> code base trigger some corner case bugs, thus this heads-up.
>
>
>
> I checked that compile time was not impacted by building llvm+clang+lldb
> with a clang with various thresholds, and here are the results (user time
> in seconds for a build from scratch, averaged over 5 builds). Note that the
> reported  threshold is inclusive: 33 (the current threshold) means all
> object whose size >= 33 bytes will be marked for example.
>
>
>
> Threshold
>
> Average
>
> Variance
>
> 33
>
> 4652.67
>
> 4.51
>
> 32
>
> 4677.02
>
> 2.71
>
> 16
>
> 4681.50
>
> 11.06
>
> 8
>
> 4660.23
>
> 12.47
>
> 0
>
> 4667.47
>
> 8.63
>
>
>
> There are some minor fluctuations that I cannot explain, but we just have
> no compromise to make there: always insert the lifetime markers .
>
>
>
> Thanks for your attention,
>
> --
>
> Arnaud A. de Grandmaison
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141007/16f61c6e/attachment.html>


More information about the llvm-commits mailing list