From patchwork Sun Jan 6 16:47:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1021080 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-493472-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="uLyr6wJ4"; dkim-atps=neutral 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 43Xkwb2TJmz9sBZ for ; Mon, 7 Jan 2019 03:47: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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=MTxP6K1SutG1A3Cuh8gdGkYJ/RxzhXjjJcQZSJABqQGomg+koZfOz Ek4jIWca3aRQeoKWvK6o8xk7L3BKcwqIZnxoMyYHiTqx8eHscKEbBvWFYqTr9MCr d+p4a5hQj/i0LxZRubYtGQvPFLdXY0ByPS5UlvchNKj+GSFkxS+mUM= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=MavOimpeuS65aygRpmT0kXUPIyA=; b=uLyr6wJ4kXjmZSg1dBhi phSebgciyDivW5vBQ+RIk3O7WuikMTBuFdFqBhBubyNJSvcj6oFfZI8WrP23bDxN 5EVUJInvthLx5rO3H31ArYekQDdUf+2KwUpTubNP07SyZqGs8FNdQqCQv+KiTt+r cLtL7/xaoeLmd35+F26JoPE= Received: (qmail 126712 invoked by alias); 6 Jan 2019 16:47:49 -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 126702 invoked by uid 89); 6 Jan 2019 16:47:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=transformed, factor, nest, transformations X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 06 Jan 2019 16:47:46 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 8EBD8281E56; Sun, 6 Jan 2019 17:47:44 +0100 (CET) Date: Sun, 6 Jan 2019 17:47:44 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Add forgotten options to -fprofile-use Message-ID: <20190106164744.4etcmssr3jg2opxc@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, I have noticed that we now enabled more loop transformations at -O3 but not for -fprofile-use. Like loop transforms we already have, they should be enabled because with profile they should be almost consistent win. I have checked that all the passes check profile except for loop interchange which I guess is Ok since the code size should not increase in general. Bootstrapped/regtested x86_64-linux, comitted. Honza * opts.c (enable_fdo_optimizations): Enable version-loops-for-strides, loop-interchange, unrol-and-jam and tree-loop-distribution. * invoke.texi: Document newly enabled options. Index: opts.c =================================================================== --- opts.c (revision 267601) +++ opts.c (working copy) @@ -1708,10 +1708,18 @@ enable_fdo_optimizations (struct gcc_opt opts->x_flag_tree_loop_vectorize = value; if (!opts_set->x_flag_tree_slp_vectorize) opts->x_flag_tree_slp_vectorize = value; + if (!opts_set->x_flag_version_loops_for_strides) + opts->x_flag_version_loops_for_strides = value; if (!opts_set->x_flag_vect_cost_model) opts->x_flag_vect_cost_model = VECT_COST_MODEL_DYNAMIC; if (!opts_set->x_flag_tree_loop_distribute_patterns) opts->x_flag_tree_loop_distribute_patterns = value; + if (!opts_set->x_flag_loop_interchange) + opts->x_flag_loop_interchange = value; + if (!opts_set->x_flag_unroll_jam) + opts->x_flag_unroll_jam = value; + if (!opts_set->x_flag_tree_loop_distribution) + opts->x_flag_tree_loop_distribution = value; } /* -f{,no-}sanitize{,-recover}= suboptions. */ Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 267603) +++ doc/invoke.texi (working copy) @@ -9499,6 +9499,8 @@ DO I = 1, N D(I) = E(I) * F ENDDO @end smallexample +This flag is enabled by default at @option{-O3}. +It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}. @item -ftree-loop-distribute-patterns @opindex ftree-loop-distribute-patterns @@ -9524,6 +9526,8 @@ DO I = 1, N ENDDO @end smallexample and the initialization loop is transformed into a call to memset zero. +This flag is enabled by default at @option{-O3}. +It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}. @item -floop-interchange @opindex floop-interchange @@ -9544,12 +9548,14 @@ for (int i = 0; i < N; i++) c[i][j] = c[i][j] + a[i][k]*b[k][j]; @end smallexample This flag is enabled by default at @option{-O3}. +It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}. @item -floop-unroll-and-jam @opindex floop-unroll-and-jam Apply unroll and jam transformations on feasible loops. In a loop nest this unrolls the outer loop by some factor and fuses the resulting multiple inner loops. This flag is enabled by default at @option{-O3}. +It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}. @item -ftree-loop-im @opindex ftree-loop-im @@ -10804,6 +10810,8 @@ else This is particularly useful for assumed-shape arrays in Fortran where (for example) it allows better vectorization assuming contiguous accesses. +This flag is enabled by default at @option{-O3}. +It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}. @item -ffunction-sections @itemx -fdata-sections