From patchwork Fri Jan 2 23:03:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 425072 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 836BD140081 for ; Sat, 3 Jan 2015 10:03:50 +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=urbCWi7C5XaXn5S+D0aagYWZMCmIZJ5yYmYx2QmNw+ac/f WsGQk5YhTJQZgewa2bpygYsmEfRRq1ydvVmApYQXAzxYsOMg/Ju5k07utJTyU/pp /L71Wiolhn7kCxcM1zPpR/xMcsVAHYXTjUtjYRJ/G+h+belt1X36WgYS8Il5I= 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=sUjmCWuHMXHJ+mSmVdh81mLLfKI=; b=Ub+YPDRCHZvgOBSAWoHE yCUfooeg3AKu82jGz02v/HiqhGc7ATS8VYJaZzMd5fO9tfieUpCqxNvg9MKe3oaw 2yPwpi6QoGIv7Cg01zP14IJHIQhjwW+/T8sT1eZyfJOi9/Mh4QBEBJS39Ss2u5Yw gYy3vSihxwXavTIQhA9rSLk= Received: (qmail 27533 invoked by alias); 2 Jan 2015 23:03:42 -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 27519 invoked by uid 89); 2 Jan 2015 23:03:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham 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; Fri, 02 Jan 2015 23:03:39 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1Y7BFn-0005Zu-Up from Sandra_Loosemore@mentor.com for gcc-patches@gcc.gnu.org; Fri, 02 Jan 2015 15:03:36 -0800 Received: from [IPv6:::1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.224.2; Fri, 2 Jan 2015 15:03:35 -0800 Message-ID: <54A723C4.9080004@codesourcery.com> Date: Fri, 2 Jan 2015 16:03:32 -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] tidy -fopt-info documentation I noticed that the documentation for -fopt-info in invoke.texi had numerous markup problems. While I was tidying that up, I saw that it also said contradictory things about the defaults in different paragraphs, so I fixed that as well by consolidating the discussion (and checking the source code for what the default really is). I also did some light copy-editing. I've checked this in as an obvious cleanup, since it's boring tech writer stuff and not a substantive change. ;-) -Sandra 2015-01-02 Sandra Loosemore gcc/ * doc/invoke.texi ([-fopt-info]): Fix markup, consolidate discussion of defaults, light copy-editing. Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 219119) +++ gcc/doc/invoke.texi (working copy) @@ -6772,52 +6772,37 @@ Enable all the available tree dumps with @opindex fopt-info Controls optimization dumps from various optimization passes. If the @samp{-@var{options}} form is used, @var{options} is a list of -@samp{-} separated options to select the dump details and -optimizations. If @var{options} is not specified, it defaults to -@option{optimized} for details and @option{optall} for optimization -groups. If the @var{filename} is not specified, it defaults to -@file{stderr}. Note that the output @var{filename} will be overwritten -in case of multiple translation units. If a combined output from -multiple translation units is desired, @file{stderr} should be used -instead. +@samp{-} separated option keywords to select the dump details and +optimizations. -The options can be divided into two groups, 1) options describing the -verbosity of the dump, and 2) options describing which optimizations +The @var{options} can be divided into two groups: options describing the +verbosity of the dump, and options describing which optimizations should be included. The options from both the groups can be freely mixed as they are non-overlapping. However, in case of any conflicts, -the latter options override the earlier options on the command -line. Though multiple -fopt-info options are accepted, only one of -them can have @option{=filename}. If other filenames are provided then -all but the first one are ignored. +the later options override the earlier options on the command +line. -The dump verbosity has the following options +The following options control the dump verbosity: @table @samp @item optimized Print information when an optimization is successfully applied. It is up to a pass to decide which information is relevant. For example, the -vectorizer passes print the source location of loops which got +vectorizer passes print the source location of loops which are successfully vectorized. @item missed Print information about missed optimizations. Individual passes -control which information to include in the output. For example, - -@smallexample -gcc -O2 -ftree-vectorize -fopt-info-vec-missed -@end smallexample - -will print information about missed optimization opportunities from -vectorization passes on stderr. +control which information to include in the output. @item note Print verbose information about optimizations, such as certain transformations, more detailed messages about decisions etc. @item all Print detailed optimization information. This includes -@var{optimized}, @var{missed}, and @var{note}. +@samp{optimized}, @samp{missed}, and @samp{note}. @end table -The second set of options describes a group of optimizations and may -include one or more of the following. +One or more of the following option keywords can be used to describe a +group of optimizations: @table @samp @item ipa @@ -6833,47 +6818,69 @@ Enable dumps from all optimizations. Thi the optimization groups listed above. @end table -For example, +If @var{options} is +omitted, it defaults to @samp{optimized-optall}, which means to dump all +info about successful optimizations from all the passes. + +If the @var{filename} is provided, then the dumps from all the +applicable optimizations are concatenated into the @var{filename}. +Otherwise the dump is output onto @file{stderr}. Though multiple +@option{-fopt-info} options are accepted, only one of them can include +a @var{filename}. If other filenames are provided then all but the +first such option are ignored. + +Note that the output @var{filename} is overwritten +in case of multiple translation units. If a combined output from +multiple translation units is desired, @file{stderr} should be used +instead. + +In the following example, the optimization info is output to +@file{stderr}: + +@smallexample +gcc -O3 -fopt-info +@end smallexample + +This example: @smallexample gcc -O3 -fopt-info-missed=missed.all @end smallexample +@noindent outputs missed optimization report from all the passes into -@file{missed.all}. +@file{missed.all}, and this one: -As another example, @smallexample -gcc -O3 -fopt-info-inline-optimized-missed=inline.txt +gcc -O2 -ftree-vectorize -fopt-info-vec-missed @end smallexample -will output information about missed optimizations as well as -optimized locations from all the inlining passes into -@file{inline.txt}. - -If the @var{filename} is provided, then the dumps from all the -applicable optimizations are concatenated into the @file{filename}. -Otherwise the dump is output onto @file{stderr}. If @var{options} is -omitted, it defaults to @option{all-optall}, which means dump all -available optimization info from all the passes. In the following -example, all optimization info is output on to @file{stderr}. +@noindent +prints information about missed optimization opportunities from +vectorization passes on @file{stderr}. +Note that @option{-fopt-info-vec-missed} is equivalent to +@option{-fopt-info-missed-vec}. +As another example, @smallexample -gcc -O3 -fopt-info +gcc -O3 -fopt-info-inline-optimized-missed=inline.txt @end smallexample -Note that @option{-fopt-info-vec-missed} behaves the same as -@option{-fopt-info-missed-vec}. +@noindent +outputs information about missed optimizations as well as +optimized locations from all the inlining passes into +@file{inline.txt}. -As another example, consider +Finally, consider: @smallexample gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt @end smallexample +@noindent Here the two output filenames @file{vec.miss} and @file{loop.opt} are in conflict since only one output file is allowed. In this case, only the first option takes effect and the subsequent options are -ignored. Thus only the @file{vec.miss} is produced which contains +ignored. Thus only @file{vec.miss} is produced which contains dumps from the vectorizer about missed opportunities. @item -frandom-seed=@var{number}