This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Questions about initialization data during LTO

On Thu, Sep 12, 2019 at 1:28 AM Gary Oblock <> wrote:
> I'm trying to do a set of optimizations that drastically transform the
> layout of arrays of structures. For obvious reasons they will need to
> run at LTO time. I'm running into some difficulties comprehending how
> the initialization data is stored. Also, I'm seeing DECL_INITIALs
> being set to NULL and that is worrisome since it would throw a monkey
> wrench into what I'm doing. That is, because for my optimizations to
> work they will need to either disqualify an array with initialization
> data or transform said data.
> So, is the initialization data being hidden at LTO time?
> If not what's its format and how do I best manipulate it?

You probably have to do at least part of the work at WPA time where
DECL_INITIAL should be appropriately set.  Initializers are generally only
shipped to / output in one LTRANS unit unless they can be used for
constant folding.

> Any insight into how to deal with these problem would be most helpful.
> These are some really interesting optimizations and will greatly speed
> up code that uses large arrays of structures.

Usually hinting the programmer is way easier here since a compiler has
to give up too easily for data layout optimizations.  Unless you only
target specific benchmarks...


> Thanks,
> Gary Oblock

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]