This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Compact SSA version namespace when releasing the freelist
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 Apr 2012 19:48:17 +0200
- Subject: Re: [PATCH] Compact SSA version namespace when releasing the freelist
- References: <Pine.LNX.firstname.lastname@example.org> <4F7DB9E5.email@example.com>
On Thu, Apr 5, 2012 at 5:27 PM, Diego Novillo <firstname.lastname@example.org> wrote:
> On 4/5/12 6:13 AM, Richard Guenther wrote:
>> Currently we release the memory for released SSA names (which we keep
>> around on a freelist, mainly to try to keep the SSA version namespace
>> dense) after early optimizations. ?This has the negative impact
>> (as documented) of permanently establishing holes in the SSA version
>> namespace. ?The following patch fixes this in a simple way.
>> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>> If you build fold-const.c with -O2 the distribution of released
>> ssa names / removed holes is as follows:
>> 43 release_ssa "SSA names released" 34900
>> 43 release_ssa "SSA name holes removed" 34900
> Could you elaborate on what this output means? ?What is 43? ?What is 34900?
It's citing from -fdump-statistics-stats output, 43 is the pass number
of the 'release_ssa'
pass, 34900 is the sum of released ssa names per function. Thus
overall we released
34900 SSA names during the compile of fold-const.c
>> which means we never have "trailing" released SSA names, all SSA
>> names on the freelist are for holes. ?The following is the
>> distribution over releases happening per function:
>> 43 release_ssa "SSA name holes removed == 0" 16
>> 43 release_ssa "SSA name holes removed == 1" 13
> Likewise here. ?What does this output mean?
That's with changed statistics accounting, it's a histogram for the per-function
number SSA names that got released, thus for 16 functions we released zero
SSA names, for 13 functions one.
>> We seem to have quite some "dead" functions in fold-const.c ;)
>> I didn't measure any off-noise memory/compile-time effect of this
>> patch though.
> I ask because I don't understand these two conclusions. ?You're saying that
> we don't do a lot of this, so compile-time effects should be nil?
No, I'm saying despite some significant savings in SSA names namespace
we don't have too many sbitmaps (the SSA renamer has one) or walks over
the SSA name array. And we definitely don't have ones that would exhibit
quadratic behavior in the size of the SSA name array.
> Thanks. ?Diego.