OSDN Git Service

* ipa-inline.c (cgraph_mark_inline_edge): Avoid double accounting
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Apr 2010 18:22:35 +0000 (18:22 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:32:12 +0000 (14:32 +0900)
of optimized out static functions.
(cgraph_edge_badness): Add DUMP parameter and dump reasons for the
cost computation.  Also sanity check for overflows.
(update_caller_keys): Update cgraph_edge_badness call; properly
update fibheap and sanity check that it is up to date.
(add_new_edges_to_heap): Update cgraph_edge_badness.
(cgraph_decide_inlining_of_small_function): Likewise;
add sanity checking that badness in heap is up to date;
improve dumping of reason; Update badness of calls to the
offline copy of function currently inlined; dump badness
of functions not inlined because of unit growth limits.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158278 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-inline.c

index 402cb10..903650c 100644 (file)
@@ -1,3 +1,18 @@
+2010-04-13  Jan Hubicka  <jh@suse.cz>
+
+       * ipa-inline.c (cgraph_mark_inline_edge): Avoid double accounting
+       of optimized out static functions.
+       (cgraph_edge_badness): Add DUMP parameter and dump reasons for the
+       cost computation.  Also sanity check for overflows.
+       (update_caller_keys): Update cgraph_edge_badness call; properly
+       update fibheap and sanity check that it is up to date.
+       (add_new_edges_to_heap): Update cgraph_edge_badness.
+       (cgraph_decide_inlining_of_small_function): Likewise;
+       add sanity checking that badness in heap is up to date;
+       improve dumping of reason; Update badness of calls to the
+       offline copy of function currently inlined; dump badness
+       of functions not inlined because of unit growth limits.
+
 2010-04-13  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR middle-end/32628
index 36d455d..3162b69 100644 (file)
@@ -313,6 +313,10 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
   e->inline_failed = CIF_OK;
   DECL_POSSIBLY_INLINED (e->callee->decl) = true;
 
+  if (!e->callee->global.inlined)
+    DECL_POSSIBLY_INLINED (e->callee->decl) = true;
+  e->callee->global.inlined = true;
+
   cgraph_clone_inlined_nodes (e, true, update_original);
 
   what = e->callee;
@@ -542,9 +546,6 @@ cgraph_edge_badness (struct cgraph_edge *edge, bool dump)
     (cgraph_estimate_size_after_inlining (1, edge->caller, edge->callee)
      - edge->caller->global.size);
 
-  if (edge->callee->local.disregard_inline_limits)
-    return INT_MIN;
-
   if (dump)
     {
       fprintf (dump_file, "    Badness calculcation for %s -> %s\n",
@@ -1206,9 +1207,8 @@ cgraph_decide_inlining_of_small_functions (void)
                   " Estimated growth after inlined into all callees is %+i insns.\n"
                   " Estimated badness is %i, frequency %.2f.\n",
                   cgraph_node_name (edge->caller),
-                  flag_wpa ? "unknown"
-                  : gimple_filename ((const_gimple) edge->call_stmt),
-                  flag_wpa ? -1 : gimple_lineno ((const_gimple) edge->call_stmt),
+                  gimple_filename ((const_gimple) edge->call_stmt),
+                  gimple_lineno ((const_gimple) edge->call_stmt),
                   cgraph_estimate_growth (edge->callee),
                   badness,
                   edge->frequency / (double)CGRAPH_FREQ_BASE);