aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2013-02-08 23:55:01 +0000
committerRong Xu <xur@google.com>2013-02-08 23:55:01 +0000
commit620db28535e3d3846c491911f628bbb2bb7d7e8e (patch)
treebade121b9062c933bb32fdb1654c57c8296be104
parentf5028d2bedcf3b9a4c2ad491204941532da83525 (diff)
2013-02-08 Rong Xu <xur@google.com>
* params.def (PARAM_LIPO_GEN_LIMIT_IPA_INLINE): New parameter. * ipa-inline.c (inline_small_functions): Suppress ipa-inline for LIPO profile-gen compilation. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/google/gcc-4_7@195906 138bc75d-0d04-0410-961f-82ee72b054a4
-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,