From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124238 invoked by alias); 7 Oct 2015 16:28:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 124224 invoked by uid 89); 7 Oct 2015 16:28:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mailout2.w1.samsung.com Received: from mailout2.w1.samsung.com (HELO mailout2.w1.samsung.com) (210.118.77.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 07 Oct 2015 16:28:25 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NVU00E8TZ39K170@mailout2.w1.samsung.com> for gcc-patches@gcc.gnu.org; Wed, 07 Oct 2015 17:28:21 +0100 (BST) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id C4.81.04846.52845165; Wed, 7 Oct 2015 17:28:21 +0100 (BST) Received: from [106.109.128.167] by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NVU00LQYZ38F080@eusync3.samsung.com>; Wed, 07 Oct 2015 17:28:21 +0100 (BST) Subject: Re: [RFC, PATCH] Disable -fprofile-use related optimizations if corresponding .gcda file not found. To: Andrew Pinski References: <5615442E.9090200@partner.samsung.com> Cc: GCC Patches , Vyacheslav Barinov , Nikolay Bozhenov , Slava Garbuzov From: Maxim Ostapenko Message-id: <56154822.9070703@partner.samsung.com> Date: Wed, 07 Oct 2015 16:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00727.txt.bz2 On 07/10/15 19:18, Andrew Pinski wrote: > On Wed, Oct 7, 2015 at 9:11 AM, Maxim Ostapenko > wrote: >> Hi, >> >> when testing OpenSSL performance, I found out that sometimes PGO-built >> binaries can actually introduce performance regressions. We could identify >> affected object files and disable PGO for them by simply removing >> corresponding .gcda file. However, even if profile data is not presented, >> GCC doesn't switch back -fprofile-use dependent optimizations (e.g. >> -fbranch-probabilities, -fvpt, etc). This may also lead to performance >> degradations. >> >> The issue had already raised quite time ago >> (https://gcc.gnu.org/ml/gcc-patches/2009-09/msg02119.html), but for some >> reasons wasn't discussed. >> >> Here a draft patch that disables -fprofile-use related optimizations if >> profile data wasn't found (perhaps it makes sense to introduce a special >> switch for this?). Does this look reasonable? > I thought if profile is not present, then branch probabilities goes > back to the original heuristics? > Which option is really causing the performance degradation here? -fprofile-use enabled -fpeel-loops that in turn enabled -frename-registers. This caused the scheduler to transform the code in sched2 pass. > Also I think your patch is very incomplete as someone could use > -frename-registers with -fprofile-use and then you just turned it off. > > Thanks, > Andrew Pinski Doesn't -fprofile-use enable -frename-registers transitively through -fpeel-loops? >> Thanks, >> -Maxim