From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31672 invoked by alias); 6 Dec 2018 08:26:16 -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 31638 invoked by uid 89); 6 Dec 2018 08:26:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=cet, U*mliska, CET, mliska@suse.cz X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Dec 2018 08:26:14 +0000 Received: by mail-wr1-f67.google.com with SMTP id b14so8716315wru.12 for ; Thu, 06 Dec 2018 00:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:in-reply-to:references:mime-version:content-transfer-encoding :subject:to:cc:from:message-id; bh=Jl7aZvONRW6NomZOkOq1uzdb3xhFTnLf1KefxlAcOWw=; b=IkLod6eo4DTDqBeqJAA5qSmqEfULKgXds2rkNynpUjEhwDaauj74ufRhKHp0Qs0gDf T3QtDXw7f+Y26i+QFccIuvfsokglbHEiRy/lxymoLk0boiVuWka8j/oDkJeHTiJ+MCzZ sp6WVRudRk4+Rm5QRu3K2/FMg4+6uNrUn5Klb58+YdN2wS6xQVGmtDYUiWtK5NJwJ4RF zeQ8WfkEwW0ydLEPwCN3y7BCXOIWo6Xziy4O1yP19KAqC7L2fxcHJeDDt4gvxIUXUr1V SM4KKfSqBZRk3DpfpM2bkvL1TkaeBjsuJQGe9NbZHevKshTqHvGwm5dFtwUM+n8tcPFW 0Zjw== Return-Path: Received: from [10.48.174.115] (089144208100.atnat0017.highway.a1.net. [89.144.208.100]) by smtp.gmail.com with ESMTPSA id j8sm17578962wrt.40.2018.12.06.00.26.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 00:26:11 -0800 (PST) Date: Thu, 06 Dec 2018 08:26:00 -0000 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] Improve predictions for hot and cold labels ([[likely]], [[unlikely]]). To: gcc-patches@gcc.gnu.org,=?UTF-8?Q?Martin_Li=C5=A1ka?= CC: Jason Merrill ,Jan Hubicka From: Bernhard Reutner-Fischer Message-ID: <0BBB0656-0D20-4299-B15D-CBC39A84DC23@gmail.com> X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00343.txt.bz2 On 30 November 2018 10:47:45 CET, "Martin Li=C5=A1ka" wrot= e: >Hi. > >This patch is a reaction to Jason's commit where he introduced new C++ >attributes. >First I would like to align cold/hot to __builtin_expect, so I adjusted >probability >and made the predictors first match predictors. > >Second I fixed how we consider the predictors in switch statements, so >that >we can correctly predict situation in predict-3. > >Honza is fine with the patch, I'll install it later if there are no >objections. >Survives tests and bootstrap on xc86_64-linux-gnu. I don't have the sources at hand but in: +/* Branches to hot labels are likely. */ +DEF_PREDICTOR (PRED_HOT_LABEL, "hot label", HITRATE (90), + PRED_FLAG_FIRST_MATCH) + +/* Branches to cold labels are extremely unlikely. */ +DEF_PREDICTOR (PRED_COLD_LABEL, "cold label", HITRATE (90), + PRED_FLAG_FIRST_MATCH) + I would have expected cold labels to have a rather low hitrate, like maybe = 2 or 7, not 90 ? Thanks,