aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ipa-inline.c7
-rw-r--r--gcc/params.def10
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index f870949faa1..926616427e9 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1575,6 +1575,13 @@ inline_small_functions (void)
if (!can_inline_edge_p (edge, true))
continue;
+ /* Suppress ipa-inline if the callee has indirect calls. They can
+ result in imprecise dynamic call graph in LIPO profile-generate. */
+ if (PARAM_VALUE (PARAM_LIPO_GEN_LIMIT_IPA_INLINE)
+ && profile_arc_flag && flag_dyn_ipa
+ && edge->callee->indirect_calls)
+ continue;
+
callee = cgraph_function_or_thunk_node (edge->callee, NULL);
growth = estimate_edge_growth (edge);
if (dump_file)
diff --git a/gcc/params.def b/gcc/params.def
index 436d51e06d8..659ebaaa020 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -974,6 +974,16 @@ DEFPARAM (PARAM_LIPO_CUTOFF,
" enviornment variable",
100, 0, 100)
+/* In LIPO profile-gen, use this parameter to limit IPA inline. */
+DEFPARAM (PARAM_LIPO_GEN_LIMIT_IPA_INLINE,
+ "lipo-gen-limit-ipa-inline",
+ "In LIPO profile gen compilation, the inline of a function that"
+ "has hot indirect call can result in imprecise dynamic call graph due"
+ "to phrase ordering issues. This parameter is used to disable"
+ "the inline of function that has a indirect call, only in LIPO-gen"
+ "compilation. Default is 0. If the value is 1, limit is on",
+ 0, 0, 1)
+
/* In LIPO profile-gen, use this parameter to set random group generation
seed value. */
DEFPARAM (PARAM_LIPO_RANDOM_SEED,