This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Save 6% of GGC memory (consumed in tree-ssa-pre)
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 31 Jul 2006 22:06:35 -0400
- Subject: Re: Save 6% of GGC memory (consumed in tree-ssa-pre)
- References: <20060731224556.GI3390@kam.mff.cuni.cz>
Jan Hubicka wrote:
> Hi,
> memory statistics for combine.c at -O2 shows 13% of memory to be taken
> by create_tree_ann function:
> tree-phinodes.c:156 (allocate_phi_node) 3813160: 4.6% 0: 0.0% 0: 0.0% 22568: 0.3% 12114
> genrtl.c:17 (gen_rtx_fmt_ee) 7518920: 9.1% 0: 0.0% 3080: 0.0% 1504400:17.1% 188050
> tree-dfa.c:209 (create_tree_ann) 10927080:13.3% 0: 0.0% 7440: 0.1% 728968: 8.3% 91121
> Total 82223861 12694004 6318427 8805836 1369076
>
> This is the same for my now favorite testcase and other common sources.
> I always accounted it to annotations being bloated, but I unstrumented
> create_tree_ann for statistics and found out that this all memory is in
> fact allocated all by tree-vn and it is all there just to hold one
> pointer value_handle. I would say that a hashtable would do a lot
> better job here (or direct use of the annotation pointer on
> expressions), but I am leaving it for Danny
If you use a hashtable, your PRE times will jump about 4 or 5x (my
recollection but feel free to try it yourself :) )
It makes *very* heavy use of getting the value handle, and it can't
really be avoided.