[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] tcg: Do not kill globals at conditional branches
From: |
Alex Bennée |
Subject: |
Re: [PATCH 1/2] tcg: Do not kill globals at conditional branches |
Date: |
Wed, 21 Oct 2020 14:29:10 +0100 |
User-agent: |
mu4e 1.5.6; emacs 28.0.50 |
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