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: Move cgraph_node_set and varpool_node_set out of GGC and make them use pointer_map


> Hi,
> I always considered the cgrpah_node_set/varpool_node_set to be
> overengineered
> but they also turned out to be quite ineffective since we do quite a
> lot of
> queries into them during stremaing out.
> 
> This patch moves them to pointer_map, like I did for streamer cache.
> While
> doing so I needed to get the structure out of GGC memory since
> pointer_map is
> not ggc firendly. This is not a deal at all, because the sets can only
> point to
> live cgraph/varpool entries anyway. Pointing to removed ones would lead
> to
> spectacular failures in any case.
> 
> Bootstrapped/regtested x86_64-linux, OK?
> 
> Honza
> 
> 	* cgraph.h (cgraph_node_set_def, varpool_node_set_def): Move out
> of GTY;
> 	replace hash by pointer map.
> 	(cgraph_node_set_element_def, cgraph_node_set_element,
> 	const_cgraph_node_set_element, varpool_node_set_element_def,
> 	varpool_node_set_element, const_varpool_node_set_element):
> Remove.
> 	(free_cgraph_node_set, free_varpool_node_set): New function.
> 	(cgraph_node_set_size, varpool_node_set_size): Use vector size.
> 	* tree-emutls.c: Free varpool node set.
> 	* ipa-utils.c (cgraph_node_set_new, cgraph_node_set_add,
> 	cgraph_node_set_remove, cgraph_node_set_find,
> dump_cgraph_node_set,
> 	debug_cgraph_node_set, free_cgraph_node_set,
> varpool_node_set_new,
> 	varpool_node_set_add, varpool_node_set_remove,
> varpool_node_set_find,
> 	dump_varpool_node_set, free_varpool_node_set,
> debug_varpool_node_set):
> 	Move here from ipa.c; implement using pointer_map
> 	* ipa.c (cgraph_node_set_new, cgraph_node_set_add,
> 	cgraph_node_set_remove, cgraph_node_set_find,
> dump_cgraph_node_set,
> 	debug_cgraph_node_set, varpool_node_set_new,
> 	varpool_node_set_add, varpool_node_set_remove,
> varpool_node_set_find,
> 	dump_varpool_node_set, debug_varpool_node_set):
> 	Move to ipa-uitls.c.
> 	* lto/lto.c (ltrans_partition_def): Remove GTY annotations.
> 	(ltrans_partitions): Move to heap.
> 	(new_partition): Update.
> 	(free_ltrans_partitions): New function.
> 	(lto_wpa_write_files): Use it.
> 	* passes.c (ipa_write_summaries): Update.

This causes cross and native build of ARM Linux toolchain to fail:

gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-
strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-
format-attribute -Wold-style-definition -Wc++-compat -fno-common  -
DHAVE_CONFIG_H -I. -Ilto -
I/work/source/gcc -
I/work/source/gcc/lto -
I/work/source/gcc/../include -
I/work/source/gcc/../libcpp/include -
I/work/source/gcc/../libdecnumber -
I/work/source/gcc/../libdecnumber/dpd
-I../libdecnumber
/work/source/gcc/lto/lto.c -o
lto/lto.o
/work/source/gcc/lto/lto.c:1163:
warning: function declaration isn't a prototype
/work/source/gcc/lto/lto.c: In
function 'free_ltrans_partitions':
/work/source/gcc/lto/lto.c:1163:
warning: old-style function definition
/work/source/gcc/lto/lto.c:1168:
error: 'struct ltrans_partition_def' has no member named 'cgraph'
/work/source/gcc/lto/lto.c:1168:
error: 'set' undeclared (first use in this function)
/work/source/gcc/lto/lto.c:1168:
error: (Each undeclared identifier is reported only once
/work/source/gcc/lto/lto.c:1168:
error: for each function it appears in.)
/work/source/gcc/lto/lto.c:1171:
warning: implicit declaration of function
'VEC_latrans_partition_heap_free'
make[2]: *** [lto/lto.o] Error 1
make[2]: *** Waiting for unfinished jobs....
rm gcov.pod gfdl.pod cpp.pod fsf-funding.pod gcc.pod
make[2]: Leaving directory `/work/cross-build/trunk-r173334-
thumb/arm-none-linux-gnueabi/obj/gcc1/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/work/cross-build/trunk-r173334-
thumb/arm-none-linux-gnueabi/obj/gcc1'
make: *** [all] Error 2
+ exit

But I see you fixed it up soon after (r173336), so no action is
required now, but I figured it was worth letting people know anyway.

Cheers,
Ian




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