This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Improve predictions for hot and cold labels ([[likely]], [[unlikely]]).
- From: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org,Martin Liška <mliska at suse dot cz>
- Cc: Jason Merrill <jason at redhat dot com>,Jan Hubicka <hubicka at ucw dot cz>
- Date: Thu, 06 Dec 2018 09:23:56 +0100
- Subject: Re: [PATCH] Improve predictions for hot and cold labels ([[likely]], [[unlikely]]).
- References: <firstname.lastname@example.org>
On 30 November 2018 10:47:45 CET, "Martin Liška" <email@example.com> wrote:
>This patch is a reaction to Jason's commit where he introduced new C++
>First I would like to align cold/hot to __builtin_expect, so I adjusted
>and made the predictors first match predictors.
>Second I fixed how we consider the predictors in switch statements, so
>we can correctly predict situation in predict-3.
>Honza is fine with the patch, I'll install it later if there are no
>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),
+/* Branches to cold labels are extremely unlikely. */
+DEF_PREDICTOR (PRED_COLD_LABEL, "cold label", HITRATE (90),
I would have expected cold labels to have a rather low hitrate, like maybe 2 or 7, not 90 ?