public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [google] Increase inlining limits with FDO/LIPO
@ 2011-05-18  7:50 Mark Heffernan
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Heffernan @ 2011-05-18  7:50 UTC (permalink / raw)
  To: Xinliang David Li, gcc-patches

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);
+    }
 }

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-05-20 18:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <BANLkTimYA_0zYxj12z3_Tu1Dz7BayRxW-Q@mail.gmail.com>
2011-05-18  9:01 ` [google] Increase inlining limits with FDO/LIPO Xinliang David Li
2011-05-18 18:37   ` Mark Heffernan
     [not found]   ` <BANLkTimta+uCqZW8RX1wDoJ2GQb=GFGZ1Q@mail.gmail.com>
2011-05-18 19:00     ` Xinliang David Li
2011-05-18 19:41       ` Mark Heffernan
2011-05-18 19:53         ` Xinliang David Li
2011-05-18 20:36           ` Mark Heffernan
2011-05-19 20:50             ` Xinliang David Li
2011-05-20 10:15               ` Richard Guenther
2011-05-20 16:37                 ` Xinliang David Li
2011-05-20 21:52                   ` Xinliang David Li
2011-05-18  7:50 Mark Heffernan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).