From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78198 invoked by alias); 30 Jun 2017 06:53:46 -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 78151 invoked by uid 89); 30 Jun 2017 06:53:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Jun 2017 06:53:43 +0000 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v5U6huiI117729 for ; Fri, 30 Jun 2017 02:53:41 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bd4are4s6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 30 Jun 2017 02:53:41 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Jun 2017 07:53:40 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 30 Jun 2017 07:53:39 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v5U6rcGa40894592 for ; Fri, 30 Jun 2017 06:53:38 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F91452043 for ; Fri, 30 Jun 2017 06:50:09 +0100 (BST) Received: from maggie.emea.ibm.com (unknown [9.145.78.206]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id E5A6A5203F for ; Fri, 30 Jun 2017 06:50:08 +0100 (BST) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] profile-count.h: Fix typos and whitespace issues. Date: Fri, 30 Jun 2017 06:53:00 -0000 In-Reply-To: <20170629122741.GA13006@kam.mff.cuni.cz> References: <20170629122741.GA13006@kam.mff.cuni.cz> X-TM-AS-GCONF: 00 x-cbid: 17063006-0020-0000-0000-00000395EC53 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17063006-0021-0000-0000-0000421812E7 Message-Id: <20170630065337.14131-1-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-30_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706300108 X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg02354.txt.bz2 I noticed a couple of typos and whitespace issues in profile-count.h. I've committed the following patch to fix them. gcc/ChangeLog: 2017-06-30 Andreas Krebbel * profile-count.h (enum profile_quality): Fix typos and whitespace issues. --- gcc/profile-count.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/gcc/profile-count.h b/gcc/profile-count.h index 461dac6..6a10315 100644 --- a/gcc/profile-count.h +++ b/gcc/profile-count.h @@ -21,15 +21,15 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_PROFILE_COUNT_H #define GCC_PROFILE_COUNT_H -/* Quality of the proflie count. Because gengtype does not support enums - inside of clases, this is in global namespace. */ +/* Quality of the profile count. Because gengtype does not support enums + inside of classes, this is in global namespace. */ enum profile_quality { /* Profile is based on static branch prediction heuristics. It may or may not reflect the reality. */ profile_guessed = 0, /* Profile was determined by autofdo. */ profile_afdo = 1, - /* Profile was originally based on feedback but it was adjusted + /* Profile was originally based on feedback but it was adjusted by code duplicating optimization. It may not precisely reflect the particular code path. */ profile_adjusted = 2, @@ -43,13 +43,13 @@ enum profile_quality { #define RDIV(X,Y) (((X) + (Y) / 2) / (Y)) -/* Data type to hold probabilities. It implement fixed point arithmetics +/* Data type to hold probabilities. It implements fixed point arithmetics with capping so probability is always in range [0,1] and scaling requiring values greater than 1 needs to be represented otherwise. In addition to actual value the quality of profile is tracked and propagated through all operations. Special value UNINITIALIZED is used for probabilities - that has not been detemrined yet (for example bacause of + that has not been determined yet (for example bacause of -fno-guess-branch-probability) Typically probabilities are derived from profile feedback (via @@ -68,15 +68,15 @@ enum profile_quality { - always Named probabilities except for never/always are assumed to be statically - guessed and thus not necessarily acurate. The difference between never - and guessedn never is that the first one should be used only in case that + guessed and thus not necessarily accurate. The difference between never + and guessed_never is that the first one should be used only in case that well behaving program will very likely not execute the "never" path. For example if the path is going to abort () call or it exception handling. - Alawyas and guessted_always probabilities are symmetric. + Always and guessed_always probabilities are symmetric. For legacy code we support conversion to/from REG_BR_PROB_BASE based fixpoint - integer arithmetics. Once the code is converted to branch probabiitlies, + integer arithmetics. Once the code is converted to branch probabilities, these conversions will probably go away because they are lossy. */ @@ -175,7 +175,7 @@ public: } /* Conversion from and to REG_BR_PROB_BASE integer fixpoint arithmetics. - this is mostly to support legacy code and hsould go away. */ + this is mostly to support legacy code and should go away. */ static profile_probability from_reg_br_prob_base (int v) { profile_probability ret; @@ -199,7 +199,7 @@ public: if (val1 > val2) ret.m_val = max_probability; else - ret.m_val = RDIV (val1 * max_probability, val2); + ret.m_val = RDIV (val1 * max_probability, val2); ret.m_quality = profile_precise; return ret; } @@ -237,7 +237,7 @@ public: else { m_val = MIN ((uint32_t)(m_val + other.m_val), max_probability); - m_quality = MIN (m_quality, other.m_quality); + m_quality = MIN (m_quality, other.m_quality); } return *this; } @@ -263,7 +263,7 @@ public: else { m_val = m_val >= other.m_val ? m_val - other.m_val : 0; - m_quality = MIN (m_quality, other.m_quality); + m_quality = MIN (m_quality, other.m_quality); } return *this; } @@ -288,8 +288,8 @@ public: return *this = profile_probability::uninitialized (); else { - m_val = RDIV ((uint64_t)m_val * other.m_val, max_probability); - m_quality = MIN (m_quality, other.m_quality); + m_val = RDIV ((uint64_t)m_val * other.m_val, max_probability); + m_quality = MIN (m_quality, other.m_quality); } return *this; } @@ -307,7 +307,7 @@ public: else { gcc_checking_assert (other.m_val); - ret.m_val = MIN (RDIV ((uint64_t)m_val * max_probability, + ret.m_val = MIN (RDIV ((uint64_t)m_val * max_probability, other.m_val), max_probability); } @@ -329,11 +329,11 @@ public: else { gcc_checking_assert (other.m_val); - m_val = MIN (RDIV ((uint64_t)m_val * max_probability, + m_val = MIN (RDIV ((uint64_t)m_val * max_probability, other.m_val), max_probability); } - m_quality = MIN (m_quality, other.m_quality); + m_quality = MIN (m_quality, other.m_quality); } return *this; } @@ -591,7 +591,7 @@ public: else { m_val += other.m_val; - m_quality = MIN (m_quality, other.m_quality); + m_quality = MIN (m_quality, other.m_quality); } return *this; } @@ -615,7 +615,7 @@ public: else { m_val = m_val >= other.m_val ? m_val - other.m_val: 0; - m_quality = MIN (m_quality, other.m_quality); + m_quality = MIN (m_quality, other.m_quality); } return *this; } @@ -727,9 +727,9 @@ public: profile_count ret; /* Take care for overflows! */ if (num.m_val < max_safe_multiplier || m_val < max_safe_multiplier) - ret.m_val = RDIV (m_val * num.m_val, den.m_val); + ret.m_val = RDIV (m_val * num.m_val, den.m_val); else - ret.m_val = RDIV (m_val * RDIV (num.m_val * max_safe_multiplier, + ret.m_val = RDIV (m_val * RDIV (num.m_val * max_safe_multiplier, den.m_val), max_safe_multiplier); ret.m_quality = MIN (m_quality, profile_adjusted); return ret; @@ -748,7 +748,7 @@ public: if (overall < m_val) ret.m_val = profile_probability::max_probability; else - ret.m_val = RDIV (m_val * profile_probability::max_probability, + ret.m_val = RDIV (m_val * profile_probability::max_probability, overall.m_val); ret.m_quality = MIN (m_quality, overall.m_quality); return ret; -- 2.9.1