This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Remove unit-at-a-time checks and flag_inline_trees
- From: Diego Novillo <dnovillo at google dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 23 Jul 2008 23:56:02 -0400
- Subject: Re: Remove unit-at-a-time checks and flag_inline_trees
- References: <20080723113253.GD2791@kam.mff.cuni.cz>
On 7/23/08 7:32 AM, Jan Hubicka wrote:
Bootstrapped/regtested i686-linux, will commit it tomorrow if there are no complains.
This is great! I only have a few minor grammar nits.
--- 1847,1858 ----
{
DECL_EXTERNAL (decl) = 0;
! #ifdef ENABLE_CHECKING
! /* Double check that we didn't passed function to callgraph early. */
s/didn't passed/didn't pass the/
s/to callgraph/to the callgraph/
--- 23,29 ----
The callgraph:
! The call-graph is data structure designed for inter-procedural optimization.
s/is data/is a data/
--- 54,63 ----
- cgraph_optimize
! Inter procedural analysis takes place here. In particular the static
! functions whose address is never taken are marked as local. Backend can
s/Backend/The back-end/ (I can't never remember how we hyphenate those)
--- 103,109 ----
??? Reorganize code so variables are output very last and only if they
really has been referenced by produced code, so we catch more cases
! where reference has been optimized out. */
s/really has been/have really been/
s/where reference/where a reference/
--- 308,318 ----
/* Determine if function DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
! configury */
Missing ending period.
--- 324,329 ----
*************** decide_is_function_needed (struct cgraph
*** 389,420 ****
if (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl))
return true;
- if (flag_unit_at_a_time)
- return false;
-
- /* If not doing unit at a time, then we'll only defer this function
- if its marked for inlining. Otherwise we want to emit it now. */
-
- /* "extern inline" functions are never output locally. */
- if (DECL_EXTERNAL (decl))
- return false;
- /* Nested functions of extern inline function shall not be emit unless
- we inlined the origin. */
- for (origin = decl_function_context (decl); origin;
- origin = decl_function_context (origin))
- if (DECL_EXTERNAL (origin))
- return false;
- /* We want to emit COMDAT functions only when absolutely necessary. */
- if (DECL_COMDAT (decl))
- return false;
- if (!DECL_INLINE (decl)
- || (!node->local.disregard_inline_limits
- /* When declared inline, defer even the uninlinable functions.
- This allows them to be eliminated when unused. */
- && !DECL_DECLARED_INLINE_P (decl)
- && (!node->local.inlinable || !cgraph_default_inline_p (node, NULL))))
- return true;
-
I like this!
- /* When not doing unit-at-a-time, output all functions enqueued.
- Return true when such a functions were found. */
-
- static bool
- cgraph_assemble_pending_functions (void)
- {
- bool output = false;
-
- if (flag_unit_at_a_time || errorcount || sorrycount)
- return false;
-
- cgraph_output_pending_asms ();
-
- while (cgraph_nodes_queue)
- {
- struct cgraph_node *n = cgraph_nodes_queue;
-
- cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
- n->next_needed = NULL;
- if (!n->global.inlined_to
- && !n->alias
- && !DECL_EXTERNAL (n->decl))
- {
- cgraph_expand_function (n);
- output = true;
- }
- output |= cgraph_process_new_functions ();
- }
-
- return output;
- }
-
-
And this!
--- 1434,1440 ----
if (sorrycount || errorcount)
return 0;
! if (cgraph_decide_inlining_incrementally (node, INLINE_SIZE, 0))
Hmm? Shouldn't we still check optimize_size? Or have you moved this
elsewhere?
Thanks for doing this. I'm glad that we are finally getting rid of
non-unit-at-a-time. I think this will create a few merge conflicts with
the tuples branch, but they shouldn't be hard to fix.
Diego.