LTO and adding extra information from extra passes

Basile STARYNKEVITCH basile@starynkevitch.net
Wed Sep 2 20:06:00 GMT 2009


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} ***



More information about the Gcc mailing list