public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* LTO and adding extra information from extra passes
@ 2009-09-02 20:06 Basile STARYNKEVITCH
  2009-09-02 20:18 ` Richard Guenther
  2009-09-03 12:50 ` Diego Novillo
  0 siblings, 2 replies; 6+ messages in thread
From: Basile STARYNKEVITCH @ 2009-09-02 20:06 UTC (permalink / raw)
  To: GCC Mailing List

Hello All,

My feeling is that the Link Time Optimisation (LTO) effort should be 
soon (=is expected to be, or is already) merged inside GCC trunk (future 
4.5).

Several years ago, I asked if there is any possibility for an additional 
pass to profit of LTO infrastructure to add some extra data into LTO 
stuff (which is probably DWARF related inside ELF object files, but I am 
not sure) and to retrieve it. I remember that the answer was of course not.

Now we have a working plugin infrastructure, and I believe it would be 
very sensible for some plugin to register passes which add persistent 
information (as does LTO with its Gimple related representation) into 
object files and to retrieve it.

Is there is still a major objection against that, or is there some API 
usable from plguins for that purpose?

Even the mere ability to add inside the LTO data a chunk of bytes 
identified by the name of the plugin would be great. Of course, some 
more features could be welcome (e.g. the ability to add data specific to 
each compiled function or cgraph_node or whatever, or even to each 
gimple...).

I could imagine that a plugin might be interested in adding say some 
information into the object file (when ordinary compilation for LTO of a 
single compilation unit happens) and later retrieve it (when link time 
optimisation occur merging several object files.)

A dream case example would be a plugin for whole program static analysis.

Regards.
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LTO and adding extra information from extra passes
  2009-09-02 20:06 LTO and adding extra information from extra passes Basile STARYNKEVITCH
@ 2009-09-02 20:18 ` Richard Guenther
  2009-09-02 20:24   ` Basile STARYNKEVITCH
  2009-09-03 12:50 ` Diego Novillo
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Guenther @ 2009-09-02 20:18 UTC (permalink / raw)
  To: Basile STARYNKEVITCH; +Cc: GCC Mailing List

On Wed, Sep 2, 2009 at 10:06 PM, Basile
STARYNKEVITCH<basile@starynkevitch.net> wrote:
> Hello All,
>
> My feeling is that the Link Time Optimisation (LTO) effort should be soon
> (=is expected to be, or is already) merged inside GCC trunk (future 4.5).
>
> Several years ago, I asked if there is any possibility for an additional
> pass to profit of LTO infrastructure to add some extra data into LTO stuff
> (which is probably DWARF related inside ELF object files, but I am not sure)
> and to retrieve it. I remember that the answer was of course not.
>
> Now we have a working plugin infrastructure, and I believe it would be very
> sensible for some plugin to register passes which add persistent information
> (as does LTO with its Gimple related representation) into object files and
> to retrieve it.
>
> Is there is still a major objection against that, or is there some API
> usable from plguins for that purpose?
>
> Even the mere ability to add inside the LTO data a chunk of bytes identified
> by the name of the plugin would be great. Of course, some more features
> could be welcome (e.g. the ability to add data specific to each compiled
> function or cgraph_node or whatever, or even to each gimple...).
>
> I could imagine that a plugin might be interested in adding say some
> information into the object file (when ordinary compilation for LTO of a
> single compilation unit happens) and later retrieve it (when link time
> optimisation occur merging several object files.)
>
> A dream case example would be a plugin for whole program static analysis.

The IPA pass infrastructure has all the necessary bits for this.

Richard.

> Regards.
> --
> Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mines, sont seulement les miennes} ***
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LTO and adding extra information from extra passes
  2009-09-02 20:18 ` Richard Guenther
@ 2009-09-02 20:24   ` Basile STARYNKEVITCH
  2009-09-02 20:35     ` Richard Guenther
  0 siblings, 1 reply; 6+ messages in thread
From: Basile STARYNKEVITCH @ 2009-09-02 20:24 UTC (permalink / raw)
  To: Richard Guenther; +Cc: GCC Mailing List

Richard Guenther wrote:
> On Wed, Sep 2, 2009 at 10:06 PM, Basile
> STARYNKEVITCH<basile@starynkevitch.net> wrote:
>> Hello All,
>>
>> My feeling is that the Link Time Optimisation (LTO) effort should be soon
>> (=is expected to be, or is already) merged inside GCC trunk (future 4.5).
>>
>> Several years ago, I asked if there is any possibility for an additional
>> pass to profit of LTO infrastructure to add some extra data into LTO stuff
>> (which is probably DWARF related inside ELF object files, but I am not sure)
>> and to retrieve it. I remember that the answer was of course not.
[...]

>>
>> I could imagine that a plugin might be interested in adding say some
>> information into the object file (when ordinary compilation for LTO of a
>> single compilation unit happens) and later retrieve it (when link time
>> optimisation occur merging several object files.)
>>
>> A dream case example would be a plugin for whole program static analysis.
> 
> The IPA pass infrastructure has all the necessary bits for this.

How do you deal with several compilation units?

I was thinking LTO is designed for that?

Regards.


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LTO and adding extra information from extra passes
  2009-09-02 20:24   ` Basile STARYNKEVITCH
@ 2009-09-02 20:35     ` Richard Guenther
  2009-09-02 20:37       ` Basile STARYNKEVITCH
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Guenther @ 2009-09-02 20:35 UTC (permalink / raw)
  To: Basile STARYNKEVITCH; +Cc: GCC Mailing List

On Wed, Sep 2, 2009 at 10:24 PM, Basile
STARYNKEVITCH<basile@starynkevitch.net> wrote:
> Richard Guenther wrote:
>>
>> On Wed, Sep 2, 2009 at 10:06 PM, Basile
>> STARYNKEVITCH<basile@starynkevitch.net> wrote:
>>>
>>> Hello All,
>>>
>>> My feeling is that the Link Time Optimisation (LTO) effort should be soon
>>> (=is expected to be, or is already) merged inside GCC trunk (future 4.5).
>>>
>>> Several years ago, I asked if there is any possibility for an additional
>>> pass to profit of LTO infrastructure to add some extra data into LTO
>>> stuff
>>> (which is probably DWARF related inside ELF object files, but I am not
>>> sure)
>>> and to retrieve it. I remember that the answer was of course not.
>
> [...]
>
>>>
>>> I could imagine that a plugin might be interested in adding say some
>>> information into the object file (when ordinary compilation for LTO of a
>>> single compilation unit happens) and later retrieve it (when link time
>>> optimisation occur merging several object files.)
>>>
>>> A dream case example would be a plugin for whole program static analysis.
>>
>> The IPA pass infrastructure has all the necessary bits for this.
>
> How do you deal with several compilation units?
>
> I was thinking LTO is designed for that?

I of course mean the IPA pass infrastructure on the LTO branch.

Richard.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LTO and adding extra information from extra passes
  2009-09-02 20:35     ` Richard Guenther
@ 2009-09-02 20:37       ` Basile STARYNKEVITCH
  0 siblings, 0 replies; 6+ messages in thread
From: Basile STARYNKEVITCH @ 2009-09-02 20:37 UTC (permalink / raw)
  To: Richard Guenther; +Cc: GCC Mailing List

Richard Guenther wrote:
>>>>
>>>> A dream case example would be a plugin for whole program static analysis.
>>> The IPA pass infrastructure has all the necessary bits for this.
>> How do you deal with several compilation units?
>>
>> I was thinking LTO is designed for that?
> 
> I of course mean the IPA pass infrastructure on the LTO branch.
What include files describes the API?

Regards.


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LTO and adding extra information from extra passes
  2009-09-02 20:06 LTO and adding extra information from extra passes Basile STARYNKEVITCH
  2009-09-02 20:18 ` Richard Guenther
@ 2009-09-03 12:50 ` Diego Novillo
  1 sibling, 0 replies; 6+ messages in thread
From: Diego Novillo @ 2009-09-03 12:50 UTC (permalink / raw)
  To: Basile STARYNKEVITCH; +Cc: GCC Mailing List

On Wed, Sep 2, 2009 at 16:06, Basile
STARYNKEVITCH<basile@starynkevitch.net> wrote:
> Hello All,
>
> My feeling is that the Link Time Optimisation (LTO) effort should be soon
> (=is expected to be, or is already) merged inside GCC trunk (future 4.5).
>
> Several years ago, I asked if there is any possibility for an additional
> pass to profit of LTO infrastructure to add some extra data into LTO stuff
> (which is probably DWARF related inside ELF object files, but I am not sure)
> and to retrieve it. I remember that the answer was of course not.

Note that the gimple streamer does not use dwarf encoding.  It uses
its own bytecode format.  There is no dwarf in the ELF files, unless
you use -g.

> Now we have a working plugin infrastructure, and I believe it would be very
> sensible for some plugin to register passes which add persistent information
> (as does LTO with its Gimple related representation) into object files and
> to retrieve it.

Yes.  That's been my plan all along.  Once LTO is merged in trunk, we
should add some plugin events to allow interaction with the streamer
as it writes and reads the callgraph.

> Even the mere ability to add inside the LTO data a chunk of bytes identified
> by the name of the plugin would be great. Of course, some more features
> could be welcome (e.g. the ability to add data specific to each compiled
> function or cgraph_node or whatever, or even to each gimple...).

Passes can add their own data to the bytecode.  A couple of IPA passes
are already doing that in the branch (notably, the inliner).

> A dream case example would be a plugin for whole program static analysis.

Note that gimple may not be an appropriate IL to do some kinds of
static analysis.  In gimple we have lost many front end attributes
that a static analyzer may want to use.  However, combined with -g,
this could be partially reconstructed.

Regardless, I agree that there are some analyses that are still
possible and useful that can be done right after the compiler has
built the complete callgraph.


Diego.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-03 12:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-02 20:06 LTO and adding extra information from extra passes Basile STARYNKEVITCH
2009-09-02 20:18 ` Richard Guenther
2009-09-02 20:24   ` Basile STARYNKEVITCH
2009-09-02 20:35     ` Richard Guenther
2009-09-02 20:37       ` Basile STARYNKEVITCH
2009-09-03 12:50 ` Diego Novillo

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).