This is the mail archive of the 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

> Hi,
> This is a first round in an attempt to trim `struct cgraph_node' to something 
> smaller.  IMHO it is way too big as it is now: 80 bytes per node.  This patch 
> trims that to 68 with still some room for improvement.
> At present this makes no difference in compile time or memory use, because the 
> cgraph nodes still go into the 88 byte special page order.  Eventually I want 
> to trim this struct to less than 64 bytes, which would make the call graph 
> smaller.
> Bootstrapped c, c++, objc and java, and tested c and c++.  OK?
> Gr.
> Steven
> 2003-11-17  Steven Bosscher  <>
> 	* 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?
(I woud 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)
Of course if it makes noticeable difference, we can go with marking the
nodes inside single structure.

How large are the savings relative to overall memory consumption
(expecting the 16 bytes savings)?
> 	(struct cgraph_function_info): ...this.  Use bitfields instead of
> 	bools.
Using bitfields is definitly OK.

> 	(cgraph_local_info, cgraph_global_info, cgraph_rtl_info): Update
> 	prototypes.
> 	* cgraph.c (cgraph_local_info, cgraph_global_info, cgraph_rtl_info):
> 	Update comment; return pointer to cgraph_function_info after making
> 	sure the requested information is indeed available.
> 	(cgraph_mark_reachable_node, cgraph_function_possibly_inlined_p,
> 	dump_cgraph): Update users these structs.
> 	* cgraphunit.c (decide_is_function_needed, cgraph_finalize_function,
> 	cgraph_analyze_function, cgraph_estimate_size_after_inlining,
> 	cgraph_estimate_growth, cgraph_mark_inline,
> 	graph_check_inline_limits, cgraph_default_inline_p,
> 	cgraph_decide_inlining_of_small_function, cgraph_decide_inlining,
> 	cgraph_decide_inlining_incrementally, cgraph_mark_local_functions):
> 	Likewise.
> 	* calls.c (flags_from_decl_or_type, expand_call): Likewise.
> 	* config/i386/i386.c (ix86_function_regparm): Likewise.
> cp/
> 	* decl2.c (finish_file): Use the cgraph_local_info() abstraction
> 	instead of accessing call graph nodes directly.

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