public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "guihaoc at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/68837] PowerPC switch statement performance
Date: Wed, 03 Jun 2020 09:08:08 +0000 [thread overview]
Message-ID: <bug-68837-4-30hfd1Y5U2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-68837-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68837
HaoChen Gui <guihaoc at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |guihaoc at gcc dot gnu.org
--- Comment #2 from HaoChen Gui <guihaoc at gcc dot gnu.org> ---
(In reply to David Edelsohn from comment #0)
> Improve performance of switch statements:
>
> 1) Heuristics for decision tree vs tablejump
>
> 2) Avoid sign extended lwa for offset
I think #1 was already implemented in current GC. Jump tables coexists with
conditional jumps. jump-table-max-growth-ratio-for-speed/size decide how large
a jump table could be and case-values-threshold defines if a jump table is
beneficial.
An example of GIMPLE switch
;; GIMPLE switch case clusters: 35 37 JT(values:5 comparisons:5 range:8
density: 62.50%):65-72 JT(values:6 comparisons:6 range:12 density:
50.00%):111-122
For #2, the offset could be negative in a multiple jump table case. Right now
it uses lwax and there is no overhead for sing extend, I think. Please correct
me if I am wrong.
next parent reply other threads:[~2020-06-03 9:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-68837-4@http.gcc.gnu.org/bugzilla/>
2020-06-03 9:08 ` guihaoc at gcc dot gnu.org [this message]
2020-06-04 15:43 ` dje at gcc dot gnu.org
2020-06-04 20:18 ` segher at gcc dot gnu.org
2020-06-11 5:15 ` guihaoc 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-68837-4-30hfd1Y5U2@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).