[PATCH] Emit lifetime start/end for unnamed objects --- take 3

David Blaikie dblaikie at gmail.com
Mon Sep 15 16:25:17 PDT 2014


I'm hardly an expert on this stuff - but just curious: what sort of testing
did you put this through? Bootstrap Clang? Were you able to gather any
stats on reduced stack usage with this improvement to lifetime markers?

On Mon, Sep 15, 2014 at 4:05 PM, Arnaud A. de Grandmaison <
arnaud.degrandmaison at arm.com> wrote:

> Hi All,
>
>
>
> Please find attached a patch which teaches clang to emit lifetime.start /
> lifetime.end markers for unnamed temporary objects.
>
>
>
> This patch can greatly reduce the stack usage of some C++ code, where it
> is so easy to have short lived unnamed temporaries.
>
>
>
> As noted in the subject, this is my third attempt: my previous attempts
> failed to handle correctly the lifetime extended temporaries, and I have
> had a hard time to understand the CleanupScope. It all boiled down to the
> fact that the body of a function is not considered a full CleanupScope (for
> debug information reasons), so in the case of lifetime extended objects at
> the top level of the function body, with a trivial destructor  +
> lifetime.end marker, the lifetime markers were simply not considered,
> firing an assert in ~CodeGenFunction. All cases are now covered by
> testcases.
>
>
>
> I would appreciate if someone knowledgeable with the lifetime extended
> temporaries & cleanup scopes could give a look to this patch.
>
>
>
> Cheers,
>
> --
>
> 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/cfe-commits/attachments/20140915/b1d6dd0d/attachment.html>


More information about the cfe-commits mailing list