This is the mail archive of the
mailing list for the GCC project.
Re: Make cgraph_node smaller
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Nov 2003 13:52:30 +0100
- Subject: Re: Make cgraph_node smaller
- References: <email@example.com>
> 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
> Bootstrapped c, c++, objc and java, and tested c and c++. OK?
> 2003-11-17 Steven Bosscher <firstname.lastname@example.org>
> * 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
Using bitfields is definitly OK.
> (cgraph_local_info, cgraph_global_info, cgraph_rtl_info): Update
> * 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):
> * calls.c (flags_from_decl_or_type, expand_call): Likewise.
> * config/i386/i386.c (ix86_function_regparm): Likewise.
> * decl2.c (finish_file): Use the cgraph_local_info() abstraction
> instead of accessing call graph nodes directly.