public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jmcguiness at liquidcapital dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66584] gcc differs in static, branch-prediction cost from icc in switch.
Date: Thu, 18 Jun 2015 16:25:00 -0000 [thread overview]
Message-ID: <bug-66584-4-vUSMyLzhmQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66584-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66584
--- Comment #7 from Jason McG <jmcguiness at liquidcapital dot com> ---
(In reply to Andrew Pinski from comment #6)
> If someone cares so much about the static branch predictor, they would be a
...
I am not a compiler developer and I do care about this in the code I work upon.
I occasionally have switch statements that I statically know have a more
commonly used case label (e.g. could be made the default) that static
branch-prediction would reduce the cost of calling. It would have saved me some
time if the documentation I was requesting were present in a more accessible
form that writing test code & reviewing the assembler that gcc generates.
Aside: I have read
https://ols.fedoraproject.org/GCC/Reprints-2008/sayle-reprint.pdf and no-where
does this article describe, apart from in passing, the effect of mis-predicted
branches that using static branch-prediction could avoid by clearly
implementing a "preferred branch" e.g. the default upon their cost models. If I
had time I'd research this, unfortunately I do not.
next prev parent reply other threads:[~2015-06-18 16:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 10:16 [Bug c++/66584] New: " jmcguiness at liquidcapital dot com
2015-06-18 14:24 ` [Bug c++/66584] " ebotcazou at gcc dot gnu.org
2015-06-18 14:44 ` pinskia at gcc dot gnu.org
2015-06-18 15:23 ` jmcguiness at liquidcapital dot com
2015-06-18 15:33 ` jmcguiness at liquidcapital dot com
2015-06-18 15:46 ` pinskia at gcc dot gnu.org
2015-06-18 16:25 ` jmcguiness at liquidcapital dot com [this message]
2015-06-18 16:27 ` jmcguiness at liquidcapital dot com
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=bug-66584-4-vUSMyLzhmQ@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/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).