cif-code.def (NEVER_CALL): New code.
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 25 Jul 2019 16:07:29 +0000 (16:07 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 25 Jul 2019 16:07:29 +0000 (16:07 +0000)
* cif-code.def (NEVER_CALL): New code.
* ipa-inline.c (want_inline_small_function_p): Fix formatting issues.
Set the failure to CIF_NEVER_CALL if the IPA count is zero.

From-SVN: r273804

gcc/ChangeLog
gcc/cif-code.def
gcc/ipa-inline.c

index 1155e4eeb0c7b4b7c30f0a457c504ecea0247086..4196db249dae824b9c2a6efdb47d1d5e9643724e 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-25  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * cif-code.def (NEVER_CALL): New code.
+       * ipa-inline.c (want_inline_small_function_p): Fix formatting issues.
+       Set the failure to CIF_NEVER_CALL if the IPA count is zero.
+
 2019-07-25  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * config/arm/thumb2.md (thumb2_movsi_insn): Fix load/store low reg.
index cee16cf7cb703ad236bbd9b61d3a92fa5f7a651a..ccd08e296caf1b47b5f65e3c95b29339704d528f 100644 (file)
@@ -83,6 +83,10 @@ DEFCIFCODE(RECURSIVE_INLINING, CIF_FINAL_NORMAL,
 DEFCIFCODE(UNLIKELY_CALL, CIF_FINAL_NORMAL,
           N_("call is unlikely and code size would grow"))
 
+/* Call is considered never executed.  */
+DEFCIFCODE(NEVER_CALL, CIF_FINAL_NORMAL,
+          N_("call is considered never executed and code size would grow"))
+
 /* Function is not declared as inline.  */
 DEFCIFCODE(NOT_DECLARED_INLINED, CIF_FINAL_NORMAL,
           N_("function not declared inline and code size would grow"))
index 5862d00008dacde03f31e1f023a348cbfa0e4938..0ed965ae82ff507c582720fe9740ad74b68a8182 100644 (file)
@@ -810,7 +810,7 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
                                  | INLINE_HINT_loop_stride))
                       && !(big_speedup = big_speedup_p (e)))))
        {
-          e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT;
+         e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT;
          want_inline = false;
        }
       else if (!DECL_DECLARED_INLINE_P (callee->decl)
@@ -818,12 +818,12 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
               && growth >= PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SMALL))
        {
          /* growth_likely_positive is expensive, always test it last.  */
-          if (growth >= MAX_INLINE_INSNS_SINGLE
+         if (growth >= MAX_INLINE_INSNS_SINGLE
              || growth_likely_positive (callee, growth))
            {
-              e->inline_failed = CIF_NOT_DECLARED_INLINED;
+             e->inline_failed = CIF_NOT_DECLARED_INLINED;
              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
@@ -839,19 +839,22 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
               && !(big_speedup == -1 ? big_speedup_p (e) : big_speedup))
        {
          /* growth_likely_positive is expensive, always test it last.  */
-          if (growth >= MAX_INLINE_INSNS_SINGLE
+         if (growth >= MAX_INLINE_INSNS_SINGLE
              || growth_likely_positive (callee, growth))
            {
              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 ()
               && (growth >= MAX_INLINE_INSNS_SINGLE
                   || growth_likely_positive (callee, growth)))
        {
-          e->inline_failed = CIF_UNLIKELY_CALL;
+         if (e->count.ipa () == profile_count::zero ())
+           e->inline_failed = CIF_NEVER_CALL;
+         else
+           e->inline_failed = CIF_UNLIKELY_CALL;
          want_inline = false;
        }
     }