[PATCH] D25456: [InstrProf] Add support for dead_strip+live_support functionality

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 21:49:11 PDT 2016


vsk added a comment.

In https://reviews.llvm.org/D25456#566944, @mehdi_amini wrote:

> Are these symbols already in the "llvm.compiler_used" list?


No, contents of __llvm_prf_data are in llvm.used, which is a bit stricter. Actually, this is very unexpected.. is dead-stripping of live_support sections supposed to kick in for symbols in the llvm.used list? I only expect this to happen for the llvm.compiler_used list.



================
Comment at: include/llvm/ProfileData/InstrProf.h:58
   return AddSegment ? "__DATA," INSTR_PROF_DATA_SECT_NAME_STR
+                      ",regular,live_support"
                     : INSTR_PROF_DATA_SECT_NAME_STR;
----------------
mehdi_amini wrote:
> davidxl wrote:
> > What is the exact meaning of this attribute? Does it mark the section 'not' the  root of the reference graph (which allows symbols just referenced from this section to be GCed)?
> > 
> > Garbage collection for dead function (with profile instrumentation) is currently also broken on Linux because -fdata-sections is not honored by for prof data symbols.
> I see this section as "reversing" the edges in the dead-strip algorithm: if a symbol foo is in the live_support section, the linker will keep it alive if the symbols *referenced by* foo are live.
> (Nothing is expected to reference foo).
This is better than my explanation, thanks Mehdi :).

It's true that symbols referenced by data in a "live_support" section may be GC'd, but it's only interesting the other way: if we could GC a symbol by not treating "live_support" uses as "critical", then we GC the symbol and its uses.


https://reviews.llvm.org/D25456





More information about the llvm-commits mailing list