This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [jh@suse.cz: Re: 6 GCC regressions, 2 new, with your patch on 2003-06-24T13:15:02Z.]


> > On Wed, Jun 25, 2003 at 10:38:08PM +0200, Jan Hubicka wrote:
> > > To avoid it we would have to hash the strings themselves that is slow.
> > 
> > How slow?  Can you quantify the slowdown?  
> 
> Not sure, for C++ the identifiers are pretty large and computing hash
> value from the identifier can get pretty costy (in the case we won't go
> for something simple like size*first+last gperf use.
> 
> I now use cgraph_node/cgraph_varpool_node quite often during analysis so
> slowing them down does not look like good idea.  I can try to make some
> measurements in case you preffer.
> 
> One alternative seems to be to simply give identifiers unique integers
> in addition to the unique pointers I use right now that won't change by
> PCHizing.  There should be plenty of space in the identifier tree node,
> right?
Hi,
Additional posibility is to add pointer directly into
FUNCTION_DECLs/VAR_DECLs and avoid the hashtable entirely.  Is there
some space?

before we get into some conclusion,  I've installed the attached patch
as obvious.  I noticed that the known_decls array is initialized twice
which may lead to garbage collecting of the first few
functions/variables on the lists.

Fri Jun 27 17:41:16 CEST 2003  Jan Hubicka  <jh@suse.cz>
	* cgraph.c (cgraph_node, cgraph_varpool_node): Avoid re-initializing
	of known_decls.
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.13
diff -c -3 -p -r1.13 cgraph.c
*** cgraph.c	24 Jun 2003 16:50:26 -0000	1.13
--- cgraph.c	27 Jun 2003 15:41:06 -0000
*************** cgraph_node (decl)
*** 108,114 ****
    if (!cgraph_hash)
      {
        cgraph_hash = htab_create (10, hash_node, eq_node, NULL);
!       VARRAY_TREE_INIT (known_decls, 32, "known_decls");
      }
  
    slot =
--- 108,115 ----
    if (!cgraph_hash)
      {
        cgraph_hash = htab_create (10, hash_node, eq_node, NULL);
!       if (!known_decls)
!         VARRAY_TREE_INIT (known_decls, 32, "known_decls");
      }
  
    slot =
*************** cgraph_varpool_node (tree decl)
*** 394,400 ****
    if (!cgraph_varpool_hash)
      {
        cgraph_varpool_hash = htab_create (10, cgraph_varpool_hash_node, eq_cgraph_varpool_node, NULL);
!       VARRAY_TREE_INIT (known_decls, 32, "known_decls");
      }
  
    slot =
--- 395,402 ----
    if (!cgraph_varpool_hash)
      {
        cgraph_varpool_hash = htab_create (10, cgraph_varpool_hash_node, eq_cgraph_varpool_node, NULL);
!       if (!known_decls)
!         VARRAY_TREE_INIT (known_decls, 32, "known_decls");
      }
  
    slot =


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]