From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: gcc-patches@gcc.gnu.org, "Martin Liška" <mliska@suse.cz>
Cc: Jason Merrill <jason@redhat.com>,Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] Improve predictions for hot and cold labels ([[likely]], [[unlikely]]).
Date: Thu, 06 Dec 2018 08:26:00 -0000 [thread overview]
Message-ID: <0BBB0656-0D20-4299-B15D-CBC39A84DC23@gmail.com> (raw)
In-Reply-To: <cbe66900-a132-7157-99f1-765c43368295@suse.cz>
On 30 November 2018 10:47:45 CET, "Martin Liška" <mliska@suse.cz> wrote:
>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,
next prev parent reply other threads:[~2018-12-06 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 9:47 Martin Liška
2018-12-06 8:26 ` Bernhard Reutner-Fischer [this message]
2018-12-28 18:00 ` Martin Liška
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0BBB0656-0D20-4299-B15D-CBC39A84DC23@gmail.com \
--to=rep.dot.nop@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=jason@redhat.com \
--cc=mliska@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).