diff options
author | Yiran Wang <yiran@google.com> | 2015-06-23 15:33:17 -0700 |
---|---|---|
committer | Yiran Wang <yiran@google.com> | 2015-06-29 10:56:28 -0700 |
commit | 1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch) | |
tree | 3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/gcc/ipa-inline.c | |
parent | f378ebf14df0952eae870c9865bab8326aa8f137 (diff) | |
download | toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2 |
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/gcc/ipa-inline.c')
-rw-r--r-- | gcc-4.9/gcc/ipa-inline.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/gcc-4.9/gcc/ipa-inline.c b/gcc-4.9/gcc/ipa-inline.c index 29c76b8..c116f74 100644 --- a/gcc-4.9/gcc/ipa-inline.c +++ b/gcc-4.9/gcc/ipa-inline.c @@ -501,7 +501,7 @@ want_early_inline_function_p (struct cgraph_edge *e) growth); want_inline = false; } - else if (DECL_COMDAT (callee->decl) + else if (!flag_auto_profile && DECL_COMDAT (callee->decl) && growth <= PARAM_VALUE (PARAM_EARLY_INLINING_INSNS_COMDAT)) ; else if ((n = num_calls (callee)) != 0 @@ -728,13 +728,25 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) else if (!DECL_DECLARED_INLINE_P (callee->decl) && !flag_inline_functions) { - /* growth_likely_positive is expensive, always test it last. */ - if (growth >= MAX_INLINE_INSNS_SINGLE - || growth_likely_positive (callee, growth)) - { + /* For functions not declared inline, if it has big_speedup + or has good hints for performance and the size growth is + small, they are profitable to inline. */ + if (big_speedup + || (hints & (INLINE_HINT_indirect_call + | INLINE_HINT_loop_iterations + | INLINE_HINT_array_index + | INLINE_HINT_loop_stride))) + { + if (growth >= MAX_GROWTH_AUTO_INLINE_FUNC) + want_inline = false; + } + /* growth_likely_positive is expensive, always test it last. */ + else if (growth >= MAX_INLINE_INSNS_SINGLE + || growth_likely_positive (callee, growth)) + { e->inline_failed = CIF_NOT_DECLARED_INLINED; - want_inline = false; - } + want_inline = false; + } } /* Apply MAX_INLINE_INSNS_AUTO limit for functions not declared inline Upgrade it to MAX_INLINE_INSNS_SINGLE when hints suggests that |