回复:[PATCH GCC10] ipa-inline.c: Trivial fix on function not declared inline check in want_inline_small_function_p
diff mbox series

Message ID 5b088625-bcea-4bf3-8a2e-2dec4743492b.JunMa@linux.alibaba.com
State New
Headers show
Series
  • 回复:[PATCH GCC10] ipa-inline.c: Trivial fix on function not declared inline check in want_inline_small_function_p
Related show

Commit Message

JunMa March 4, 2019, 1:50 a.m. UTC
------------------------------------------------------------------
发件人:Segher Boessenkool <segher@kernel.crashing.org>
发送时间:2019年3月1日(星期五) 22:18
收件人:JunMa <JunMa@linux.alibaba.com>
抄 送:gcc-patches <gcc-patches@gcc.gnu.org>
主 题:Re: [PATCH GCC10] ipa-inline.c: Trivial fix on function not declared inline check in want_inline_small_function_p


Hi!

On Fri, Mar 01, 2019 at 04:39:38PM +0800, JunMa wrote:
>    Since MAX_INLINE_INSNS_AUTO should be below or equal to 
>    MAX_INLINE_INSNS_SINGLE (see params.def), there is no need
>    to do second inlining limit check on growth when function not
>    declared inline, this patch removes it.
>    Bootstrapped and tested on x86_64-unknown-linux-gnu, is it ok for trunk?

Your mail subject says this is for GCC 10, but you are asking for GCC 9
now; which is it?


Sorry. Since we are in GCC9 stage4 now, also it's not for regression fix.So, it's for GCC 10.

> 2019-03-01  Jun Ma  <JunMa@linux.alibaba.com>
> 
>         *ipa-inline.c(want_inline_small_function_p): Remove
>         redundant growth check when function not declared 
>         inline

Some spaces were lost in the first line.  Trailing space.  Sentences
should end with a full stop (or similar).

Don't send patches (or pretty much anything else) as
application/octet-stream attachments.


Segher


Sorry again for this. Here is the full change.

JunMa


2019-03-01  Jun Ma  <JunMa@linux.alibaba.com>

* ipa-inline.c(want_inline_small_function_p): Remove
redundant growth check when function not declared 
inline.

Patch
diff mbox series

diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 360c3de..ff9bc9e 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -837,15 +837,11 @@  want_inline_small_function_p (struct cgraph_edge *e, bool report)
                             ? MAX (MAX_INLINE_INSNS_AUTO,
                                    MAX_INLINE_INSNS_SINGLE)
                             : MAX_INLINE_INSNS_AUTO)
-              && !(big_speedup == -1 ? big_speedup_p (e) : big_speedup))
+              && !(big_speedup == -1 ? big_speedup_p (e) : big_speedup)
+              && growth_likely_positive (callee, growth))
        {
-         /* growth_likely_positive is expensive, always test it last.  */
-          if (growth >= MAX_INLINE_INSNS_SINGLE
-             || growth_likely_positive (callee, growth))
-           {
-             e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
-             want_inline = false;
-           }
+         e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
+         want_inline = false;
        }
       /* If call is cold, do not inline when function body would grow. */
       else if (!e->maybe_hot_p ()