public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Cgraph alias reorg 0/14
@ 2011-06-08 14:12 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2011-06-08 14:12 UTC (permalink / raw)
  To: gcc-patches

Hi,
in the following series of patches I want to reorganize handling of alises in
cgraph infastructure.

The longer term plan is to introduce symbol table into GCC that will be common
base for cgraph, varpool and aliases (i.e. all kinds of symbols we have in
GCC).

Original design of cgraph/varpool was motivated by needs of IPA passes that
sort of don't want to know about existence of multiple symbols defining same
object and thus aliases was not present in the structures.

The implementation of aliases is ackward. We do collect them in alias pairs and
then we mark all aliased symbols as "needed" that is kind of full optimization
barrier for IPA. This produce lousy code and thus we added special case of
same body aliases and thunks for C++ use.

I already changed thunks to be stand alone function, this series is going to do
the same for standard aliases (i.e. function-function aliases that are not
weakrefs). Weakrefs, variable aliases and introduction of symbtab will follow
incremnetally.

The repsentation of function alias is a cgraph_node with node->alias set and
with only one reference of new type IPA_REF_ALIAS pointing to the real
function.

This imply a need for IPA passes to actually understand the aliases.  Most
passes want to simply pretend that edges/references go to the final objects
instead of the alias nodes.  This is hoever not 100% direct transition because
alias can have different visibility than the final function (i.e. one can take
overwritable alias of static or hidden function).

For this reason I added several accestor functions.

cgraph_function_or_thunk_node that for given node walks the chain of aliases
until it finds a real function or thunk node and cgraph_for_node_and_aliases
that takes a callback and calls it on given function and all its alias nodes.

For passes that wants to go through thunks, too, there is
cgraph_for_node_thunks_and_aliases and cgraph_function_node.

The merge plan of this series is as follows:

 - first few fixes and cleanups
 - cgraph_function_or_thunk_node, cgraph_for_node_and_aliases,
   cgraph_for_node_thunks_and_aliases, cgraph_function_node functions that do
   nothing, since they are pointless on current representaiton.
 - update of each of the individual optimizers to use them
 - introduction of the new representation + all the changes that has to
   go along with it.

I've tested the combined patch on x86_64-linux, x86-linux, ppc-linux
by bootstrap/regtest as well as on the Mozilla.

Honza

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-08 14:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-08 14:12 Cgraph alias reorg 0/14 Jan Hubicka

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