This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Clear some of pointers in SSA_NAME
- From: Jeffrey A Law <law at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 20 Sep 2004 12:34:38 -0600
- Subject: Re: Clear some of pointers in SSA_NAME
- Organization: Red Hat, Inc
- References: <20040919150426.GG10126@kam.mff.cuni.cz>
- Reply-to: law at redhat dot com
On Sun, 2004-09-19 at 09:04, Jan Hubicka wrote:
> Hi,
> release_ssa_name don't clear the released SSA name keeping dead
> statements alive from GGC point of view. This patch fixes everything
> except for SSA_NAME_VAR that is still accessed for released sse name in
> tree-into-ssa. See my other mail.
>
> This patch saves about 30% of memory usage on rt-3.4.ii testcase I got
> somewhere from testsuite. This is kind of cheat as the testcase merely
> use hords of templates to construct mostly empty fucntion and dce1 pass
> kills most of the statements before we happen to consume the memory
> later. But it shows that keeping dead pointers around is not the
> coolest idea on the planet.
>
> Honza
> bootstrapped/regtested ppc-linux, OK?
>
> 2004-09-19 Jan Hubicka <jh@suse.cz>
> * tree-ssanames.c (release_ssa_name): Zero out SSA_NAME datastructure.
I've been looking at similar stuff. Though my tests haven't shown
this to be a problem at all. In fact, a similar change I tried had
absolutely _no_ effect on Gerald's testcase.
I'd be very curious to know which of those pointers is keeping data
live -- mostly because it may point to a pass that is not cleaning
up things as well as it should.
On a style note, I'd probably suggest using memset to wipe the
entire node, then put back the 2-3 fields we actually need, ie
the tree code, the ssa version # associated with the node and
(for a little while longer) the SSA_NAME_VAR associated with
the node.
[ Also note that once you wipe the node en-masse in release_ssa_name,
you no longer have to do so in the code which recycles them. ]
jeff