From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100807 invoked by alias); 28 Nov 2017 11:34:18 -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 100789 invoked by uid 89); 28 Nov 2017 11:34:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=among X-Spam-User: qpsmtpd, 2 recipients X-HELO: homiemail-a52.g.dreamhost.com Received: from sub5.mail.dreamhost.com (HELO homiemail-a52.g.dreamhost.com) (208.113.200.129) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 11:34:16 +0000 Received: from homiemail-a52.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a52.g.dreamhost.com (Postfix) with ESMTP id D4CA56002C08; Tue, 28 Nov 2017 03:34:10 -0800 (PST) Received: from linaro-laptop.intra.reserved-bit.com (unknown [202.189.238.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by homiemail-a52.g.dreamhost.com (Postfix) with ESMTPSA id DB3176002C07; Tue, 28 Nov 2017 03:34:09 -0800 (PST) Subject: Re: [PATCH] [pr#83069] Keep profile_count for bb under real_bb_freq_max From: Siddhesh Poyarekar To: gcc-patches@gcc.gnu.org Cc: hubicka@gcc.gnu.org References: <1511525181-25726-1-git-send-email-siddhesh@gotplt.org> Message-ID: <92763fbb-ece2-ced8-0214-8c97f4dcc508@gotplt.org> Date: Tue, 28 Nov 2017 11:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1511525181-25726-1-git-send-email-siddhesh@gotplt.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg02392.txt.bz2 On Friday 24 November 2017 05:36 PM, Siddhesh Poyarekar wrote: > freq_max < 1, i.e. highest frequency among bbs in the function being > higher than real_bb_freq_max means that the bb ends up with a profile > count larger than real_bb_freq_max and then can go all the way up to > and beyond profile_count::max_count. > > Bootstrapped on aarch64, testsuite in progress. Tests came out clean (no new regressions) on aarch64 and x86_64. Ping? Siddhesh > > * gcc/predict.c (estimate_bb_frequencies): Don't reset freq_max. > * gcc/testsuite/gcc.dg/pr83069.c: New test case. > > --- > gcc/predict.c | 2 -- > gcc/testsuite/gcc.dg/pr83069.c | 15 +++++++++++++++ > 2 files changed, 15 insertions(+), 2 deletions(-) > create mode 100644 gcc/testsuite/gcc.dg/pr83069.c > > diff --git a/gcc/predict.c b/gcc/predict.c > index 0f34956..ff9b5a9 100644 > --- a/gcc/predict.c > +++ b/gcc/predict.c > @@ -3613,8 +3613,6 @@ estimate_bb_frequencies (bool force) > freq_max = BLOCK_INFO (bb)->frequency; > > freq_max = real_bb_freq_max / freq_max; > - if (freq_max < 16) > - freq_max = 16; > profile_count ipa_count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.ipa (); > cfun->cfg->count_max = profile_count::uninitialized (); > FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun), NULL, next_bb) > diff --git a/gcc/testsuite/gcc.dg/pr83069.c b/gcc/testsuite/gcc.dg/pr83069.c > new file mode 100644 > index 0000000..d43d78d > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/pr83069.c > @@ -0,0 +1,15 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O1" } */ > + > +void > +foo (unsigned long *res, unsigned long in) > +{ > + for (unsigned long a = 0; a < 98; a++) > + for (unsigned long b = 0; b < 98; b++) > + for (unsigned long c = 0; c < 98; c++) > + for (unsigned long d = 0; d < 98; d++) > + for (unsigned long e = 0; e < 98; e++) > + for (unsigned long f = 0; f < 98; f++) > + for (unsigned long g = 0; g < 98; g++) > + *res += a * in; > +} >