qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 02/48] tcg/optimize: Split out OptContext


From: Alex Bennée
Subject: Re: [PATCH v2 02/48] tcg/optimize: Split out OptContext
Date: Tue, 19 Oct 2021 16:25:18 +0100
User-agent: mu4e 1.7.0; emacs 28.0.60

Richard Henderson <richard.henderson@linaro.org> writes:

> Provide what will become a larger context for splitting
> the very large tcg_optimize function.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  tcg/optimize.c | 77 ++++++++++++++++++++++++++------------------------
>  1 file changed, 40 insertions(+), 37 deletions(-)
>
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index 148e360fc6..b76991215e 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
> @@ -44,6 +44,10 @@ typedef struct TempOptInfo {
>      uint64_t z_mask;  /* mask bit is 0 if and only if value bit is 0 */
>  } TempOptInfo;
>  
> +typedef struct OptContext {
> +    TCGTempSet temps_used;
> +} OptContext;
> +
>  static inline TempOptInfo *ts_info(TCGTemp *ts)
>  {
>      return ts->state_ptr;
> @@ -90,15 +94,15 @@ static void reset_temp(TCGArg arg)
>  }
>  
<snip>
> @@ -605,7 +609,7 @@ void tcg_optimize(TCGContext *s)
>  {
>      int nb_temps, nb_globals, i;
>      TCGOp *op, *op_next, *prev_mb = NULL;
> -    TCGTempSet temps_used;
> +    OptContext ctx = {};
>  
>      /* Array VALS has an element for each temp.
>         If this temp holds a constant then its value is kept in VALS' element.
> @@ -615,7 +619,6 @@ void tcg_optimize(TCGContext *s)
>      nb_temps = s->nb_temps;
>      nb_globals = s->nb_globals;
>  
> -    memset(&temps_used, 0, sizeof(temps_used));

Did you mean to drop this memset entirely given I see it being done
later on?

<snip>
> @@ -1302,7 +1305,7 @@ void tcg_optimize(TCGContext *s)
>                                             op->args[1], op->args[2]);
>              if (tmp != 2) {
>                  if (tmp) {
> -                    memset(&temps_used, 0, sizeof(temps_used));
> +                    memset(&ctx.temps_used, 0, sizeof(ctx.temps_used));
>                      op->opc = INDEX_op_br;
>                      op->args[0] = op->args[3];
>                  } else {

Otherwise:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]