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: Make cgraph_node smaller


> > 	* cgraph.h (struct cgraph_local_info, struct cgraph_global_info,
> > 	cgraph_rtl_info): Unify, replace with a single struct...
> 
> 
> How much do you get from getting these unified?

Not much right now.  Once the cgraph_node struct is smaller than 64 bytes,
it should save a few megabytes on a piece of code I have with lots and lots
and lots of very small functions (C++, what else could have such insanity). 

> (I would preffer to leave them separate so we can do easier IPA - you
> need to save only local_info into file and I would like to keep
> global/rtl info separate as rtl info will likely become target
> dependent sooner or later)

???  What kind of target dependent information do you want to put in a call
graph?

As for writing them to a file, it's probably just as easy to write out the
whole struct, considering that global and rtl info are really small compared
to the local data.

> Of course if it makes noticeable difference, we can go with marking the
> nodes inside single structure.

The win is not as big as what there's left to gain from squeezing bytes out
of other structs.  On the other hand, it never hurts to be small.  The
difference is 64 cgraph_nodes per page (if a page is 4096 bytes), vs. 46 now
(because cgraph nodes now end up in the 88 byte special page order).  That
is a 40% reduction in memory use by cgraph_nodes.

Of course if you have plans to make call graph nodes even bigger than they
are
now (by adding fields to the local/global/rtl structs) then this whole
exercise
is completely pointless.

> How large are the savings relative to overall memory consumption

For my test case it would be about 2.5% when these structs are smaller than
64 bytes.  Not much, but not too bad either.  Right now, nothing had
changed,
a cgraph_node is 68 bytes, so it _still_ ends up in the 88 byte pages.

Gr.
Steven


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