[PATCH] D9009: Value profiling compiler-rt changes

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 10:31:36 PST 2015


On Thu, Nov 12, 2015 at 10:12 AM, Betul Buyukkurt <betulb at codeaurora.org>
wrote:

> > davidxl added inline comments.
> >
> > ================
> > Comment at: lib/profile/InstrProfiling.c:190
> > @@ +189,3 @@
> > +    }
> > +    I->ValueCounters = (void *)PerSiteCountsHead;
> > +    PerSiteCountsHead = (uint8_t *)VDataPtr;
> > ----------------
> > Release memory of ValueCounters ?
>
> This is a function that's running only atexit, I thought of adding it in
> but then thought of it as unnecessary too due to this being one of the
> very last actions of the run time during the lifetime of the program.
>


Ok to leave it as it is, but the assumption may not be true in the future.

Consider the case when profile dump is not done at exit (e.g. for a server
program). APIs are provided for the user to periodically dump data for
selected program phases they care about. One low overhead way of doing this
is let the program continuously do the profiling without the need to check
the state. APIs are provided so that user can do counter clearing and
dumping at the start and end of the phase ...

Another thing we need to solve in the future is support raw profile data
on-line merging -- otherwise the raw profile data can get really big with
the current appending model. Without this, doing clang bootstrap with PGO
(4 stage with clang/llvm sources as training data) will be impossible.

VP data certainly makes it trickier.

David



>
> >
> > http://reviews.llvm.org/D9009
> >
> >
> >
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/9bd3855f/attachment.html>


More information about the llvm-commits mailing list