From patchwork Sun Jan 4 04:29:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 425144 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AE0931400A0 for ; Sun, 4 Jan 2015 15:29:57 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=O412xuY06XoumnuDO93sYpS5WarYzIAcogD9wSELtOHSqa fS7JxvNfw5R3iAibguBTKQCNRfjwydF79rQklc1zmxmjhCpiV0A1yw34ovl00odQ 33tDlnxlJ+vtB1FWvd/WDjS94gw2kSwlm8GiQA3uZ8Gm7BSwz9yTRJPPN6GJI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=DrTdSyNkdQaPrql/Igpymq8Utys=; b=o/i/S2CjaA81PFCMPc+A X2JDP0x4V8q0/fkx+ptF/KhIjlTBhooq424fpZaAQXCf2jB39bLNdn+RFKLeFJHA nuU8F7jDxwkWfoTMdGqdIxzBs1UeOgbRoNo8ruC8+YnGjlUBmbovl1Ll7kPkYtNp +lJ6aUcySrciP9ZZXUzDADQ= Received: (qmail 21440 invoked by alias); 4 Jan 2015 04:29:48 -0000 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 Received: (qmail 21418 invoked by uid 89); 4 Jan 2015 04:29:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 04 Jan 2015 04:29:42 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Y7cos-0005ON-Td from Sandra_Loosemore@mentor.com for gcc-patches@gcc.gnu.org; Sat, 03 Jan 2015 20:29:38 -0800 Received: from [IPv6:::1] (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.3.224.2; Sat, 3 Jan 2015 20:29:38 -0800 Message-ID: <54A8C1AD.5070408@codesourcery.com> Date: Sat, 3 Jan 2015 21:29:33 -0700 From: Sandra Loosemore User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: GCC Patches Subject: [doc, committed] clean up -fauto-profile documentation I saw that the documentation for the new -fauto-profile option needed a lot of work -- it had formatting and markup problems, terminology problems (e.g., "linux" is not a proper name by GNU documentation standards), and content problems like failure to document the filename default. I removed the previously documented optional requirement (?) for "An Intel processor with last branch record (LBR) support" as IIUC that is a property of perf and/or create_gcov and not of GCC's support for this option, which seems to have no target-specific component. I also did minor cleanup on the -fprofile-generate and -fprofile-use options, which also had some of the same markup problems. I've committed this under the "obvious fix" rule. -Sandra 2015-01-03 Sandra Loosemore gcc/ * doc/invoke.texi ([-fprofile-generate], [-fprofile-use]): Fix markup, light copy-editing. ([-fauto-profile]): Rewrite to fix formatting and content problems. Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 219170) +++ gcc/doc/invoke.texi (working copy) @@ -9325,7 +9325,7 @@ profile useful for later recompilation w optimization. You must use @option{-fprofile-generate} both when compiling and when linking your program. -The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}. +The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}. If @var{path} is specified, GCC looks at the @var{path} to find the profile feedback data files. See @option{-fprofile-dir}. @@ -9333,12 +9333,12 @@ the profile feedback data files. See @op @item -fprofile-use @itemx -fprofile-use=@var{path} @opindex fprofile-use -Enable profile feedback directed optimizations, and optimizations -generally profitable only with profile feedback available. - -The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt}, -@code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize}, -@code{ftree-loop-distribute-patterns} +Enable profile feedback-directed optimizations, +and the following optimizations +which are generally profitable only with profile feedback available: +@option{-fbranch-probabilities}, @option{-fvpt}, +@option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, +@option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}. By default, GCC emits an error message if the feedback profiles do not match the source code. This error can be turned into a warning by using @@ -9351,37 +9351,39 @@ the profile feedback data files. See @op @item -fauto-profile @itemx -fauto-profile=@var{path} @opindex fauto-profile -Enable sampling based feedback directed optimizations, and optimizations -generally profitable only with profile feedback available. - -The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt}, -@code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize}, -@code{-finline-functions}, @code{-fipa-cp}, @code{-fipa-cp-clone}, -@code{-fpredictive-commoning}, @code{-funswitch-loops}, -@code{-fgcse-after-reload}, @code{-ftree-loop-distribute-patterns}, - -If @var{path} is specified, GCC looks at the @var{path} to find -the profile feedback data files. - -In order to collect AutoFDO profile, you need to have: - -1. A linux system with linux perf support -2. (optional) An Intel processor with last branch record (LBR) support. This is - to guarantee accurate instruction level profile, which is important for - AutoFDO performance. - -To collect the profile, first use linux perf to collect raw profile -(see @uref{https://perf.wiki.kernel.org/}). +Enable sampling-based feedback-directed optimizations, +and the following optimizations +which are generally profitable only with profile feedback available: +@option{-fbranch-probabilities}, @option{-fvpt}, +@option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, +@option{-ftree-vectorize}, +@option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone}, +@option{-fpredictive-commoning}, @option{-funswitch-loops}, +@option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}. + +@var{path} is the name of a file containing AutoFDO profile information. +If omitted, it defaults to @file{fbdata.afdo} in the current directory. + +Producing an AutoFDO profile data file requires running your program +with the @command{perf} utility on a supported GNU/Linux target system. +For more information, see @uref{https://perf.wiki.kernel.org/}. E.g. -@code{perf record -e br_inst_retired:near_taken -b -o perf.data -- your_program} +@smallexample +perf record -e br_inst_retired:near_taken -b -o perf.data \ + -- your_program +@end smallexample -Then use create_gcov tool, which takes raw profile and unstripped binary to -generate AutoFDO profile that can be used by GCC. -(see @uref{https://github.com/google/autofdo}). +Then use the @command{create_gcov} tool to convert the raw profile data +to a format that can be used by GCC.@ You must also supply the +unstripped binary for your program to this tool. +See @uref{https://github.com/google/autofdo}. E.g. -@code{create_gcov --binary=your_program.unstripped --profile=perf.data --gcov=profile.afdo} +@smallexample +create_gcov --binary=your_program.unstripped --profile=perf.data \ + --gcov=profile.afdo +@end smallexample @end table The following options control compiler behavior regarding floating-point