From patchwork Sun Dec 1 15:13:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1202878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-514927-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="JGwMMZsB"; 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 47QsGK4prWz9sR7 for ; Mon, 2 Dec 2019 02:13:59 +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=hd5Qld0nzvJW3U8uYs2sn4VkunFNzRQAc9TaY0aQEbTULgbH0utAO /PwMRdD8VUwUQ6BBC7ldE/xWlVN+EVAZcGjhFp/uOK5h30NeV4cA1CKcE0X5CJ3H pPCCgw6zt8YK7tG+rVoFeIJB1jsfi6644U8IleEhhMP9H4bb1qDVCM= 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=nJc+jYxAezfDNENWySGRau0uXwM=; b=JGwMMZsBywn1zySpFTlM tEimnGX0uJ8AaA+D9O4WVZlnsvl45sdrJnl5NwouluvXAPNHGn/JS80Kku4vwJwY ixUiasv1ICwKSZY6tfn2VcoyGGIXeedsWnIAAO33rHmmm9LYHehiAR12l7Pj4HcA i/TGBaJNEYuKd6we7gbigPo= Received: (qmail 115762 invoked by alias); 1 Dec 2019 15:13:52 -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 115754 invoked by uid 89); 1 Dec 2019 15:13:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy= 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, 01 Dec 2019 15:13:51 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 23020280822; Sun, 1 Dec 2019 16:13:49 +0100 (CET) Date: Sun, 1 Dec 2019 16:13:49 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix profile_count comparsions with gcov_type Message-ID: <20191201151349.h3a5m7ec7eowbnvy@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, this patch fixes one extra (and I hope last) place where we mix up global and local porfile. Bootstrapped/regtested x86_64-linux, comitted. Honza * profile-count.h (profile_count::operator<): Use IPA value for comparsion. (profile_count::operator>): Likewise. (profile_count::operator<=): Likewise. (profile_count::operator>=): Likewise. * predict.c (maybe_hot_count_p): Do not convert to gcov_type. Index: profile-count.h =================================================================== --- profile-count.h (revision 278877) +++ profile-count.h (working copy) @@ -930,14 +930,14 @@ public: { gcc_checking_assert (ipa_p ()); gcc_checking_assert (other >= 0); - return initialized_p () && m_val < (uint64_t) other; + return ipa ().initialized_p () && ipa ().m_val < (uint64_t) other; } bool operator> (const gcov_type other) const { gcc_checking_assert (ipa_p ()); gcc_checking_assert (other >= 0); - return initialized_p () && m_val > (uint64_t) other; + return ipa ().initialized_p () && ipa ().m_val > (uint64_t) other; } bool operator<= (const profile_count &other) const @@ -968,14 +968,14 @@ public: { gcc_checking_assert (ipa_p ()); gcc_checking_assert (other >= 0); - return initialized_p () && m_val <= (uint64_t) other; + return ipa ().initialized_p () && ipa ().m_val <= (uint64_t) other; } bool operator>= (const gcov_type other) const { gcc_checking_assert (ipa_p ()); gcc_checking_assert (other >= 0); - return initialized_p () && m_val >= (uint64_t) other; + return ipa ().initialized_p () && ipa ().m_val >= (uint64_t) other; } /* Return true when value is not zero and can be used for scaling. Index: predict.c =================================================================== --- predict.c (revision 278877) +++ predict.c (working copy) @@ -184,7 +184,7 @@ maybe_hot_count_p (struct function *fun, /* Code executed at most once is not hot. */ if (count <= MAX (profile_info ? profile_info->runs : 1, 1)) return false; - return (count.to_gcov_type () >= get_hot_bb_threshold ()); + return (count >= get_hot_bb_threshold ()); } /* Return true if basic block BB of function FUN can be CPU intensive