This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa PATCH] Pick memory consumption low hanging fruit
- From: law at redhat dot com
- To: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- Cc: Andrew MacLeod <amacleod at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 21 Nov 2003 12:51:42 -0700
- Subject: Re: [tree-ssa PATCH] Pick memory consumption low hanging fruit
- Reply-to: law at redhat dot com
In message <firstname.lastname@example.org>, Steven Bosscher
>> No, but if you still can't use it without SSA, we know the problem is
>> elsewhere :-)
>With the SSA optimizers enabled, for VDEF_EXPRs, PHI_NODEs and SSA_NAMEs
>alone we allocate 66452992 bytes out of 236267452 total for trees, that's
>more than 25%. But turning off the tree optimizers doesn't greatly
>improve things for me, so these are not the resident trees; the problem is
While my varray usage patch is on hold pending resolution of a code
generation bug it exposed I figured I'd take a quick peek at some
of these tree-ssa specific nodes.
PHI_NODES are actually reasonably space efficient. I don't much if
anything we can really do with them.
VDEF_EXPRs are horrible.
Basically a VDEF_EXPR is just storing two pointers. 8 bytes of data on a
32bit machine. Yet we actually allocate a tree node (36 bytes) for this
beast. When you do this 325000 times you're talking about both a
noteworthy amount of memory (8M) and a ton of nodes the GC system has
to track (325000) that are really quite pointless. OUCH. Fixing this
is pretty easy.
SSA_NAMES are marginally wasteful, but not in a way that we can really
improve significantly upon. We could move the occurs_in_abnormal_phi
into one of the other flags as Steven has suggested. We could also move
one of its pointers into the annotation field (ick). That would save
around 2M. We could also move the occurs_in_abnormal_phi into a
global bitmap or something like that, but at this point it probably
makes just as much sense to keep it in the PHI node itself. I'll
probably update Steven's patch slightly (comments, possibly using a
different bit, etc). I'm not sure if I'm going to overload on the
annotation field though.
[ BTW, had you provided the underlying data, we probably would have been
more open to your change to occurs_in_abnormal_phi the first time you
posted it. ]