This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Simplify and speedup df notes creation
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org, steven at gcc dot gnu dot org
- Date: Fri, 11 Jun 2010 17:38:20 +0200
- Subject: Re: Simplify and speedup df notes creation
- References: <20100611144347.GG18540@kam.mff.cuni.cz> <4C125451.5080204@gnu.org>
> On 06/11/2010 04:43 PM, Jan Hubicka wrote:
>> df-notes is trying to reust old notes by collecting them to linklist and then
>> re-insert the originals if they did not change. This seems just useless
>> excercise since creation of new note is cheap in theory (we maintain freelist),
>> but it is somewhat slow because we do 3 function calls.
>>
>> This patch removes the linklists and brings add_reg_note inline.
>
> Makes sense, and especially it allows to inline the INSN_LIST/EXPR_LIST
> choice in most of the callees; this might be a small improvement but
> it's obviously there. The switch statement in alloc_reg_note should be
> well-predicted but not unfortunately the common case is the default and
> requires to go through 2-3 jumps.
>
> Is it really required to inline alloc_EXPR_LIST? Can you measure the
I guess the patch would be win without inline too, but the hot path through
alloc_EXPR_LIST is very short and simple, so I would say it is good candidate
for inlining.
> .text size with it inlined and without?
Will do.
>
>> Doing so hits
>> the problems with our twisty include files. It can not go to rtl.h since it
>> would be compiled into gen files (and also gen_rtx_EXPR_LIST is not defined
>> there yet). I ended up putting it into emit-rtl.h where it seem to belong most
>> from other choices that introduces need to include emit-rtl into few extra
>> files. In lists.c we need also function.h since note allocation needs crtl.
>> I am open to alternatives here and I will mind updating dependencies if the
>> patch is accepted.
>
> What about moving all of lists.c to emit-rtl.c? A lot of it is also
> duplicate for EXPR_LIST and INSN_LIST, the free lists could be reduced
> to one with more simplification using gen_rtx_fmt_ee. It's all stuff
> for other patches though.
Well, I guess we can have one freelist and change the RTX type since they
are equivalent in memory layout...
Honza
>
> The df bits are fine except that you have two of these:
>
> - return old;
> + return;
>
> Paolo