This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[google] Increase inlining limits with FDO/LIPO


This small patch greatly expands the function size limits for inlining
with FDO/LIPO.  With profile information, the inliner is much more
selective and precise and so the limits can be increased with less
worry that functions and total code size will blow up.  This speeds up
x86-64 internal benchmarks by about geomean 1.5% to 3% with LIPO
(depending on microarch), and 1% to 1.5% with FDO.  Size increase is
negligible (0.1% mean).

Bootstrapped and regression tested on x86-64.

Trunk testing to follow.

Ok for google/main?

Mark


2011-05-17  Mark Heffernan  <meheff@google.com>

       * opts.c (finish_options): Increase inlining limits with profile
       generate and use.

Index: opts.c
===================================================================
--- opts.c	(revision 173666)
+++ opts.c	(working copy)
@@ -828,6 +828,22 @@ finish_options (struct gcc_options *opts
 	  opts->x_flag_split_stack = 0;
 	}
     }
+
+  if (opts->x_flag_profile_use
+      || opts->x_profile_arc_flag
+      || opts->x_flag_profile_values)
+    {
+      /* With accurate profile information, inlining is much more
+	 selective and makes better decisions, so increase the
+	 inlining function size limits.  Changes must be added to both
+	 the generate and use builds to avoid profile mismatches.  */
+      maybe_set_param_value
+	(PARAM_MAX_INLINE_INSNS_SINGLE, 1000,
+	 opts->x_param_values, opts_set->x_param_values);
+      maybe_set_param_value
+	(PARAM_MAX_INLINE_INSNS_AUTO, 1000,
+	 opts->x_param_values, opts_set->x_param_values);
+    }
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]