gcc.dg/tree-ssa/ssa-dom-cse-2.c: xfail scan for mmix.
[gcc.git] / gcc / ipa-inline-analysis.c
index e36902073f57818c5cf8a762a433b096f783150a..148efbc09ef033f9565e06c3aed1b1a12df2ab50 100644 (file)
@@ -1,5 +1,5 @@
 /* Analysis used by inlining decision heuristics.
-   Copyright (C) 2003-2019 Free Software Foundation, Inc.
+   Copyright (C) 2003-2020 Free Software Foundation, Inc.
    Contributed by Jan Hubicka
 
 This file is part of GCC.
@@ -148,7 +148,7 @@ free_growth_caches (void)
   node_context_cache_clear = 0;
 }
 
-/* Return hints derrived from EDGE.   */
+/* Return hints derived from EDGE.   */
 
 int
 simple_edge_hints (struct cgraph_edge *edge)
@@ -163,9 +163,7 @@ simple_edge_hints (struct cgraph_edge *edge)
   if (to_scc_no && to_scc_no  == callee_scc_no && !edge->recursive_p ())
     hints |= INLINE_HINT_same_scc;
 
-  if (callee->lto_file_data && edge->caller->lto_file_data
-      && edge->caller->lto_file_data != callee->lto_file_data
-      && !callee->merged_comdat && !callee->icf_merged)
+  if (cross_module_call_p (edge))
     hints |= INLINE_HINT_cross_module;
 
   return hints;
@@ -211,6 +209,7 @@ do_estimate_edge_time (struct cgraph_edge *edge, sreal *ret_nonspec_time)
          nonspec_time = e->entry.nonspec_time;
          hints = e->entry.hints;
          if (flag_checking
+             && !opt_for_fn (callee->decl, flag_profile_partial_training)
              && !callee->count.ipa_p ())
            {
              sreal chk_time, chk_nonspec_time;
@@ -456,14 +455,15 @@ offline_size (struct cgraph_node *node, ipa_size_summary *info)
          Take this into account.  */
       else if (DECL_COMDAT (node->decl)
               && node->can_remove_if_no_direct_calls_p ())
-       return (info->size
-               * (100 - param_comdat_sharing_probability)
-               + 50) / 100;
+       {
+         int prob = opt_for_fn (node->decl, param_comdat_sharing_probability);
+         return (info->size * (100 - prob) + 50) / 100;
+       }
     }
   return 0;
 }
 
-/* Estimate the growth caused by inlining NODE into all callees.  */
+/* Estimate the growth caused by inlining NODE into all callers.  */
 
 int
 estimate_growth (struct cgraph_node *node)