From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel <qemu-devel@nongnu.org>, qemu-ppc@nongnu.org
Subject: [Qemu-devel] TCG and branches
Date: Sun, 31 Jul 2016 09:53:03 +1000 [thread overview]
Message-ID: <1469922783.5978.331.camel@kernel.crashing.org> (raw)
Hi Richard !
So in my discovery of TCG, one thing I noticed is the horrendous amount
of code generated for branches, especially conditional ones.
I have a patch at least to remove a bunch of dead gunk on target-ppc
for non-conditional ones (we still generated the "else" of the
condition even when never branching to it).
However, I wonder if there are ways to do better.
The first obvious thing that comes to mind is to avoid stopping the
TB on a non-taken conditional branch. The reason that can't be done
today, from my limited understanding of things, is because we only
support index 0 and 1 today for gen_goto_tb().
Now I haven't completely figured out how TB linkage works under the
hood but do you know of any fundamental reason why we have that limit ?
Could we, for example, have a limit of, for example, 8 and only break
the TB after a branch if we have less than 2 left ?
Or are there deeper reasons why we really can't link more than 2 ?
With the current implementation, a non-taken branch results in three
branches: One to "skip over" the condition-true case, one to the new TB
and one in the header of that new TB to check for exits. We could
reduce to one in most cases.
Cheers,
Ben.
next reply other threads:[~2016-07-30 23:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-30 23:53 Benjamin Herrenschmidt [this message]
2016-07-31 18:25 ` [Qemu-devel] [Qemu-ppc] TCG and branches Nikunj A Dadhania
2016-07-31 18:31 ` Nikunj A Dadhania
2016-08-06 2:43 ` [Qemu-devel] " Richard Henderson
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=1469922783.5978.331.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.