[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.
- Re: [Qemu-devel] [PATCH v2 29/45] exec-all: rename tb_free to tb_remove, (continued)
- [Qemu-devel] [PATCH v2 14/45] tcg: define CF_PARALLEL and use it for TB hashing, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 35/45] gen-icount: fold exitreq_label into TCGContext, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 16/45] target/hppa: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 15/45] target/arm: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 36/45] tcg: dynamically allocate optimizer globals + fold into TCGContext, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 31/45] tci: move tci_regs to tcg_qemu_tb_exec's stack, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 43/45] tcg: introduce regions to split code_gen_buffer, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 24/45] exec-all: introduce TB_PAGE_ADDR_FMT, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 25/45] translate-all: define and use DEBUG_TB_INVALIDATE_GATE, Emilio G. Cota, 2017/07/16