qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 36/45] tcg: dynamically allocate optimizer gl


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [PATCH v2 36/45] tcg: dynamically allocate optimizer globals + fold into TCGContext
Date: Tue, 18 Jul 2017 00:33:50 -0400
User-agent: Mutt/1.5.24 (2015-08-30)

On Mon, Jul 17, 2017 at 17:53:33 -1000, Richard Henderson wrote:
> On 07/16/2017 10:04 AM, Emilio G. Cota wrote:
> >Groundwork for supporting multiple TCG contexts.
(snip)
> >  struct TCGContext {
> >      uint8_t *pool_cur, *pool_end;
> >      TCGPool *pool_first, *pool_current, *pool_first_large;
> >@@ -717,6 +725,10 @@ struct TCGContext {
> >      TCGTempSet free_temps[TCG_TYPE_COUNT * 2];
> >      TCGTemp temps[TCG_MAX_TEMPS]; /* globals first, temps after */
> >+    /* optimizer */
> >+    struct tcg_temp_info *opt_temps;
> >+    TCGTempSet opt_temps_used;
> 
> I would prefer either
> 
>   (1) Dynamic allocation.  I know we eschew that most places during,
>       but surely this is the exact situation for which it's handy.
> 
>   (2) Make opt_temps an array of TCG_MAX_TEMPS and drop the pointer.

Originally I implemented (2). But the array is pretty large and
realised that the init ctx doesn't use it at all. So I made
the allocation dynamic, i.e. tcg_optimize will allocate the
array if the ctx doesn't have it yet.

But I guess that's not what you mean with (1)? You mean to allocate
every single time we call tcg_optimize, allocating only the space
we need on each call?

> I think the TCGTempSet should be a local within tcg_optimize.

Will do.

                E.



reply via email to

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