public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/101301] Improving sparse switch statement
Date: Tue, 06 Jul 2021 16:35:34 +0000	[thread overview]
Message-ID: <bug-101301-4-uZlkO6GJQa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101301-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301

--- Comment #9 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #8)
> (In reply to Segher Boessenkool from comment #7)
>  
> > Yeah :-)  Of course in your testing the nine named cases have the same
> > probability,
> > which is not very true in practice (but is there any better guess possible),
> > and
> > the "default" case has that same probability for GCC (is there a better
> > estimate
> > for that, maybe?)
> 
> I think that we should leave something to do for the hardware branch
> predictors.  Any pattern should lead to better predictions. The test
> case is rather brutal because it is random.

Heh.  My question is if we would get better code if we assumed the default case
is more likely than the other cases, in general, on actual code "in the wild".
There is bound to be some literature about that, hrm...

> > (I expect there just is some typo or thinko somewhere in the pass, fwiw :-) )
> 
> As I have demonstrated above, such a thinko is rather easy to make :-)

Ha :-)  Too bad we can only warn "invalid sum of incoming frequencies", it
still
happens too often (read: at all) to actually error on it...  that would perhaps
grab people's attention :-)

  parent reply	other threads:[~2021-07-06 16:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 15:32 [Bug tree-optimization/101301] New: " tkoenig at gcc dot gnu.org
2021-07-03 10:41 ` [Bug tree-optimization/101301] " tkoenig at gcc dot gnu.org
2021-07-03 18:42 ` tkoenig at gcc dot gnu.org
2021-07-03 19:34 ` segher at gcc dot gnu.org
2021-07-03 21:57 ` tkoenig at gcc dot gnu.org
2021-07-04 17:37 ` segher at gcc dot gnu.org
2021-07-05  5:33 ` tkoenig at gcc dot gnu.org
2021-07-05 17:33 ` segher at gcc dot gnu.org
2021-07-06 13:39 ` tkoenig at gcc dot gnu.org
2021-07-06 16:35 ` segher at gcc dot gnu.org [this message]
2021-08-12 10:31 ` marxin at gcc dot gnu.org
2022-11-30 13:04 ` cvs-commit at gcc dot gnu.org
2023-04-03  9:04 ` marxin at gcc dot gnu.org

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-101301-4-uZlkO6GJQa@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).