This is the mail archive of the
mailing list for the GCC project.
Re: IPA merge 6: variable annotations
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, zadeck at naturalbridge dot com, amacleod at redhat dot com
- Date: Wed, 20 Dec 2006 10:49:38 -0500
- Subject: Re: IPA merge 6: variable annotations
- References: <20061203235419.GF5242@kam.mff.cuni.cz>
Jan Hubicka wrote on 12/03/06 18:54:
How would sound putting dense UIDs to each referenced var into the
annotations implemented by direct pointers/hashtable as I am doing now
and using on-side arrays/bitmaps in the passes? (pretty much as we do
for REGNOs on RTL land).
Yes, I have wanted to try this for the longest time. A dense DECL_UID
space would allow us to use simple arrays like we do with SSA_NAMEs.
I remember disucssing the variable UIDs with Kenny and others on GCC
summit and we was considering some strategies for static numbering (ie
giving global UIDs in a way so each function has just limited range),
but I think we found out this is not going to work in all cases when we
want to invent new local and global variables on the go. So it seem to
me the hashtable assinging static's the local UIDs is probably best
solution here for local passes, we still can use DECL_UID for purposes
of IPA datastructures.
How about an UID that is a tuple <fnid, declid> so that each
function can add temporary variables? The tuple could be encoded as a
HOST_WIDE_INT split into M bits for fnid and N bits for declid, or it
could be a structure of two ints.
Each pass would then have a matrix where to store DECL annotations.
+ /* Hashtable of variables annotations. Used for static variables only;Spacing. Document argument FUN. Similarly in other functions.
+ local variables have direct pointer in the tree node. */
+ static inline htab_t
+ gimple_var_anns (struct function *fun)
This is OK in the meantime. I think an array of annotations and
dual ID numbering should work in the long term.