From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] tcg: Do not kill globals at conditional branches
Date: Wed, 21 Oct 2020 14:29:10 +0100 [thread overview]
Message-ID: <87blgvwvvd.fsf@linaro.org> (raw)
In-Reply-To: <20201013222330.173525-2-richard.henderson@linaro.org>
Richard Henderson <richard.henderson@linaro.org> writes:
> We can easily register allocate the entire extended basic block
> (in this case, the set of blocks connected by fallthru), simply
> by not discarding the register state at the branch.
>
> This does not help blocks starting with a label, as they are
> reached via a taken branch, and that would require saving the
> complete register state at the branch.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> include/tcg/tcg-opc.h | 7 +++---
> include/tcg/tcg.h | 4 +++-
> tcg/tcg.c | 55 +++++++++++++++++++++++++++++++++++++++++--
> 3 files changed, 60 insertions(+), 6 deletions(-)
>
<snip>
>
> +/*
> + * liveness analysis: conditional branch: all temps are dead,
> + * globals and local temps should be synced.
> + */
> +static void la_bb_sync(TCGContext *s, int ng, int nt)
> +{
> + la_global_sync(s, ng);
> +
> + for (int i = ng; i < nt; ++i) {
> + if (s->temps[i].temp_local) {
> + int state = s->temps[i].state;
> + s->temps[i].state = state | TS_MEM;
> + if (state != TS_DEAD) {
> + continue;
It took me a few scans of this function before I realised the continue
was to avoid the la_reset_pref at the end. Not sure if it can be made
any neater though:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
next prev parent reply other threads:[~2020-10-21 13:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 22:23 [PATCH 0/2] tcg: optimize across branches Richard Henderson
2020-10-13 22:23 ` [PATCH 1/2] tcg: Do not kill globals at conditional branches Richard Henderson
2020-10-21 13:29 ` Alex Bennée [this message]
2020-10-13 22:23 ` [PATCH 2/2] tcg/optimize: Flush data at labels not TCG_OPF_BB_END Richard Henderson
2020-10-21 14:57 ` Alex Bennée
2020-10-21 15:51 ` Richard Henderson
2020-10-19 23:04 ` [PATCH 0/2] tcg: optimize across branches 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=87blgvwvvd.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 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.