public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at kam dot mff.cuni.cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/105973] Wrong branch prediction for if (COND) { if(x) noreturn1(); else noreturn2(); }
Date: Wed, 15 Jun 2022 10:12:03 +0000	[thread overview]
Message-ID: <bug-105973-4-xmkwqpTPjY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105973-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from hubicka at kam dot mff.cuni.cz ---
> possibly the noreturn predictor doesn't trigger here
The problem here is that we handle throw1 and throw2 as two independent
reason for code path to be unlikely.  This makes us to look for
conditional controling the code path and we predict the inner if both
ways as unlikely so they cancel out.

I suppose we could be smarter here and teach path predictor to check for
this situation and if both directions of a branch are considered bad for
same reason continue propagating up.  This shoudl not be hard to
implement.

  parent reply	other threads:[~2022-06-15 10:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14 11:46 [Bug tree-optimization/105973] New: " redi at gcc dot gnu.org
2022-06-14 11:49 ` [Bug tree-optimization/105973] " redi at gcc dot gnu.org
2022-06-14 11:54 ` redi at gcc dot gnu.org
2022-06-15  9:07 ` rguenth at gcc dot gnu.org
2022-06-15 10:12 ` hubicka at kam dot mff.cuni.cz [this message]
2022-06-15 10:56 ` redi at gcc dot gnu.org
2022-06-16 14:08 ` marxin at gcc dot gnu.org
2022-06-17 18:40 ` hubicka at kam dot mff.cuni.cz
2023-01-11 10:27 ` marxin at gcc dot gnu.org
2023-03-16 14: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-105973-4-xmkwqpTPjY@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).