From patchwork Wed May 18 05:55:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Heffernan X-Patchwork-Id: 96124 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 200D11007D1 for ; Wed, 18 May 2011 15:55:25 +1000 (EST) Received: (qmail 23352 invoked by alias); 18 May 2011 05:55:21 -0000 Received: (qmail 23344 invoked by uid 22791); 18 May 2011 05:55:20 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 May 2011 05:55:07 +0000 Received: from wpaz29.hot.corp.google.com (wpaz29.hot.corp.google.com [172.24.198.93]) by smtp-out.google.com with ESMTP id p4I5t6Wn030073 for ; Tue, 17 May 2011 22:55:06 -0700 Received: from ywa8 (ywa8.prod.google.com [10.192.1.8]) by wpaz29.hot.corp.google.com with ESMTP id p4I5svhT030191 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 17 May 2011 22:55:05 -0700 Received: by ywa8 with SMTP id 8so569114ywa.23 for ; Tue, 17 May 2011 22:55:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.46.14 with SMTP id y14mr835121anj.37.1305698105301; Tue, 17 May 2011 22:55:05 -0700 (PDT) Received: by 10.101.107.5 with HTTP; Tue, 17 May 2011 22:55:05 -0700 (PDT) Date: Tue, 17 May 2011 22:55:05 -0700 Message-ID: Subject: [google] Increase inlining limits with FDO/LIPO From: Mark Heffernan To: Xinliang David Li , gcc-patches@gcc.gnu.org X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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); + } }