This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR debug/13367
> On Tue, Dec 30, 2003 at 10:08:07AM +0100, Jan Hubicka wrote:
> > SSE interface does not require it.
>
> I see that we still have the functions in question commented
> out, and macros used instead. We should probably fix that...
>
> But see rs6000/altivec.h, which does use the feature.
Hi,
here is updated patch. It passed testing on i686-pc-gnu-linux and
x86_64-linux, will commit it next year :)
Honza
2003-12-30 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_function_possibly_inlined): Evenw eith
flag_really_no_inline we inline always_inline functions
* cgraphunit.c (cgraph_analyze_function): Clear inlinable flag
for non-always_inline functions when there is flag_really_no_inline
(cgraph_decide_inlining): Limit work done when not inlining.
(cgraph_decide_inlining_incrementally): LIkewise.
(cgraph_optimize_function): Check whether something got inlined.
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.38
diff -c -3 -p -r1.38 cgraph.c
*** cgraph.c 21 Dec 2003 14:08:32 -0000 1.38
--- cgraph.c 30 Dec 2003 09:27:47 -0000
*************** bool
*** 613,619 ****
cgraph_function_possibly_inlined_p (tree decl)
{
if (!cgraph_global_info_ready)
! return (DECL_INLINE (decl) && !flag_really_no_inline);
return cgraph_node (decl)->global.inlined;
}
--- 613,621 ----
cgraph_function_possibly_inlined_p (tree decl)
{
if (!cgraph_global_info_ready)
! return (DECL_INLINE (decl)
! && (!flag_really_no_inline
! || (*lang_hooks.tree_inlining.disregard_inline_limits) (decl)));
return cgraph_node (decl)->global.inlined;
}
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.39
diff -c -3 -p -r1.39 cgraphunit.c
*** cgraphunit.c 21 Nov 2003 06:52:22 -0000 1.39
--- cgraphunit.c 30 Dec 2003 09:27:47 -0000
*************** cgraph_analyze_function (struct cgraph_n
*** 325,331 ****
if (node->local.inlinable)
node->local.disregard_inline_limits
= (*lang_hooks.tree_inlining.disregard_inline_limits) (decl);
!
/* Inlining characteristics are maintained by the cgraph_mark_inline. */
node->global.insns = node->local.self_insns;
if (!DECL_EXTERNAL (decl))
--- 325,332 ----
if (node->local.inlinable)
node->local.disregard_inline_limits
= (*lang_hooks.tree_inlining.disregard_inline_limits) (decl);
! if (flag_really_no_inline && !node->local.disregard_inline_limits)
! node->local.inlinable = 0;
/* Inlining characteristics are maintained by the cgraph_mark_inline. */
node->global.insns = node->local.self_insns;
if (!DECL_EXTERNAL (decl))
*************** cgraph_optimize_function (struct cgraph_
*** 471,477 ****
/* optimize_inline_calls avoids inlining of current_function_decl. */
current_function_decl = decl;
if (flag_inline_trees)
! optimize_inline_calls (decl);
if (node->nested)
{
for (node = node->nested; node; node = node->next_nested)
--- 472,486 ----
/* optimize_inline_calls avoids inlining of current_function_decl. */
current_function_decl = decl;
if (flag_inline_trees)
! {
! struct cgraph_edge *e;
!
! for (e = node->callees; e; e = e->next_callee)
! if (e->inline_call)
! break;
! if (e)
! optimize_inline_calls (decl);
! }
if (node->nested)
{
for (node = node->nested; node; node = node->next_nested)
*************** cgraph_decide_inlining (void)
*** 1137,1216 ****
inlined[y]->output = 0, node->aux = 0;
}
! cgraph_decide_inlining_of_small_functions (inlined, inlined_callees);
! if (cgraph_dump_file)
! fprintf (cgraph_dump_file, "\nDeciding on functions called once:\n");
! /* And finally decide what functions are called once. */
! for (i = nnodes - 1; i >= 0; i--)
! {
! node = order[i];
! if (node->callers && !node->callers->next_caller && !node->needed
! && node->local.inlinable && !node->callers->inline_call
! && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl))
! {
! bool ok = true;
! struct cgraph_node *node1;
!
! /* Verify that we won't duplicate the caller. */
! for (node1 = node->callers->caller;
! node1->callers && node1->callers->inline_call
! && ok; node1 = node1->callers->caller)
! if (node1->callers->next_caller || node1->needed)
! ok = false;
! if (ok)
{
! if (cgraph_dump_file)
! fprintf (cgraph_dump_file,
! "\nConsidering %s %i insns.\n"
! " Called once from %s %i insns.\n",
! cgraph_node_name (node), node->global.insns,
! cgraph_node_name (node->callers->caller),
! node->callers->caller->global.insns);
! ninlined = cgraph_inlined_into (node->callers->caller, inlined);
! old_insns = overall_insns;
! if (cgraph_check_inline_limits
! (node->callers->caller, node, inlined, ninlined))
{
- ninlined_callees =
- cgraph_inlined_callees (node, inlined_callees);
- cgraph_mark_inline (node->callers->caller, node, inlined,
- ninlined, inlined_callees,
- ninlined_callees);
- for (y = 0; y < ninlined_callees; y++)
- inlined_callees[y]->output = 0, node->aux = 0;
if (cgraph_dump_file)
fprintf (cgraph_dump_file,
! " Inlined into %s which now has %i insns"
! " for a net change of %+i insns.\n",
cgraph_node_name (node->callers->caller),
! node->callers->caller->global.insns,
! overall_insns - old_insns);
}
- else
- {
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
- " Inline limit reached, not inlined.\n");
- }
- for (y = 0; y < ninlined; y++)
- inlined[y]->output = 0, node->aux = 0;
}
}
- }
! if (cgraph_dump_file)
! fprintf (cgraph_dump_file,
! "\nInlined %i calls, eliminated %i functions, "
! "%i insns turned to %i insns.\n\n",
! ncalls_inlined, nfunctions_inlined, initial_insns,
! overall_insns);
! free (order);
! free (inlined);
! free (inlined_callees);
}
/* Decide on the inlining. We do so in the topological order to avoid
--- 1146,1229 ----
inlined[y]->output = 0, node->aux = 0;
}
! if (!flag_really_no_inline)
! {
! cgraph_decide_inlining_of_small_functions (inlined, inlined_callees);
! if (cgraph_dump_file)
! fprintf (cgraph_dump_file, "\nDeciding on functions called once:\n");
! /* And finally decide what functions are called once. */
! for (i = nnodes - 1; i >= 0; i--)
! {
! node = order[i];
! if (node->callers && !node->callers->next_caller && !node->needed
! && node->local.inlinable && !node->callers->inline_call
! && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl))
{
! bool ok = true;
! struct cgraph_node *node1;
!
! /* Verify that we won't duplicate the caller. */
! for (node1 = node->callers->caller;
! node1->callers && node1->callers->inline_call
! && ok; node1 = node1->callers->caller)
! if (node1->callers->next_caller || node1->needed)
! ok = false;
! if (ok)
{
if (cgraph_dump_file)
fprintf (cgraph_dump_file,
! "\nConsidering %s %i insns.\n"
! " Called once from %s %i insns.\n",
! cgraph_node_name (node), node->global.insns,
cgraph_node_name (node->callers->caller),
! node->callers->caller->global.insns);
! ninlined = cgraph_inlined_into (node->callers->caller,
! inlined);
! old_insns = overall_insns;
! if (cgraph_check_inline_limits
! (node->callers->caller, node, inlined, ninlined))
! {
! ninlined_callees =
! cgraph_inlined_callees (node, inlined_callees);
! cgraph_mark_inline (node->callers->caller, node, inlined,
! ninlined, inlined_callees,
! ninlined_callees);
! for (y = 0; y < ninlined_callees; y++)
! inlined_callees[y]->output = 0, node->aux = 0;
! if (cgraph_dump_file)
! fprintf (cgraph_dump_file,
! " Inlined into %s which now has %i insns"
! " for a net change of %+i insns.\n",
! cgraph_node_name (node->callers->caller),
! node->callers->caller->global.insns,
! overall_insns - old_insns);
! }
! else
! {
! if (cgraph_dump_file)
! fprintf (cgraph_dump_file,
! " Inline limit reached, not inlined.\n");
! }
! for (y = 0; y < ninlined; y++)
! inlined[y]->output = 0, node->aux = 0;
}
}
}
! if (cgraph_dump_file)
! fprintf (cgraph_dump_file,
! "\nInlined %i calls, eliminated %i functions, "
! "%i insns turned to %i insns.\n\n",
! ncalls_inlined, nfunctions_inlined, initial_insns,
! overall_insns);
! free (order);
! free (inlined);
! free (inlined_callees);
! }
}
/* Decide on the inlining. We do so in the topological order to avoid
*************** cgraph_decide_inlining_incrementally (st
*** 1242,1261 ****
inlined_callees[y]->output = 0, node->aux = 0;
}
! /* Now do the automatic inlining. */
! for (e = node->callees; e; e = e->next_callee)
! if (e->callee->local.inlinable && !e->callee->output
! && e->callee != node && !e->inline_call
! && cgraph_default_inline_p (e->callee)
! && cgraph_check_inline_limits (node, e->callee, inlined,
! ninlined))
! {
! ninlined_callees = cgraph_inlined_callees (e->callee, inlined_callees);
! cgraph_mark_inline (node, e->callee, inlined, ninlined,
! inlined_callees, ninlined_callees);
! for (y = 0; y < ninlined_callees; y++)
! inlined_callees[y]->output = 0, node->aux = 0;
! }
/* Clear the flags set by cgraph_inlined_into. */
for (y = 0; y < ninlined; y++)
--- 1255,1278 ----
inlined_callees[y]->output = 0, node->aux = 0;
}
! if (!flag_really_no_inline)
! {
! /* Now do the automatic inlining. */
! for (e = node->callees; e; e = e->next_callee)
! if (e->callee->local.inlinable && !e->callee->output
! && e->callee != node && !e->inline_call
! && cgraph_default_inline_p (e->callee)
! && cgraph_check_inline_limits (node, e->callee, inlined,
! ninlined))
! {
! ninlined_callees = cgraph_inlined_callees (e->callee,
! inlined_callees);
! cgraph_mark_inline (node, e->callee, inlined, ninlined,
! inlined_callees, ninlined_callees);
! for (y = 0; y < ninlined_callees; y++)
! inlined_callees[y]->output = 0, node->aux = 0;
! }
! }
/* Clear the flags set by cgraph_inlined_into. */
for (y = 0; y < ninlined; y++)