This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Simplify and speedup df notes creation


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 .text size with it inlined and without?

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.


The df bits are fine except that you have two of these:

-  return old;
+  return;

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]