public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gary Oblock <goblock@marvell.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: [EXT] Re: Questions about initialization data during LTO
Date: Thu, 12 Sep 2019 19:09:00 -0000	[thread overview]
Message-ID: <MWHPR18MB1072ED9D8EF0658B2F664094B9B00@MWHPR18MB1072.namprd18.prod.outlook.com> (raw)
In-Reply-To: <CAFiYyc2g7wc96oiUHJ7aWvrgejWNr39LQ7cBQnfMNd__5kt13A@mail.gmail.com>

On 9/12/19 3:12 AM, Richard Biener wrote:
> External Email
>
> ----------------------------------------------------------------------
> On Thu, Sep 12, 2019 at 1:28 AM Gary Oblock <goblock@marvell.com> 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.
First, I thought WHOPR was deprecated?? Second, if the initializations
are stripped is there any indication that it's occurred? Third, is it
possible
to selectively disable the stripping for arrays of structures and
structures?

Note, this optimization is a lot harder to do as bits and pieces here and
there and perhaps totally unfeasible. I have to be able to examine all the
uses of of all the structures and all the variables of these types to in
order
to qualify the optimization. Then I have to do the same thing all over
again
to apply the transformations.
>> 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...
I don't follow you about hinting... Are you saying the programmer
would need to supply hints in the code enabling the optimizations?
I want to be as general as possible and improve "dusty decks" too.
Admittedly the first cut of these optimizations will be quite limited.
My plan is to get the framework to function and then extend it.

Gary
>
> Richard.
>
>> Thanks,
>>
>> Gary Oblock

  reply	other threads:[~2019-09-12 19:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 23:27 Gary Oblock
2019-09-12 10:12 ` Richard Biener
2019-09-12 19:09   ` Gary Oblock [this message]
2019-09-13 12:58     ` [EXT] " Richard Biener
2019-09-13 12:19 ` Martin Liška
2019-09-13 19:01   ` [EXT] " Gary Oblock
2019-09-14 15:39     ` Martin Liška
2019-09-16 18:28       ` Gary Oblock
2019-09-16 22:19         ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR18MB1072ED9D8EF0658B2F664094B9B00@MWHPR18MB1072.namprd18.prod.outlook.com \
    --to=goblock@marvell.com \
    --cc=gcc@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).