From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRdyh-0006ss-L9 for qemu-devel@nongnu.org; Mon, 25 Jul 2016 07:23:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRdyf-0005kj-IE for qemu-devel@nongnu.org; Mon, 25 Jul 2016 07:23:18 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:33499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRdyf-0005kf-C3 for qemu-devel@nongnu.org; Mon, 25 Jul 2016 07:23:17 -0400 Date: Mon, 25 Jul 2016 13:23:16 +0200 From: Aurelien Jarno Message-ID: <20160725112315.GA16110@aurel32.net> References: <1466740107-15042-1-git-send-email-rth@twiddle.net> <1466740107-15042-5-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466740107-15042-5-git-send-email-rth@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v3 4/9] tcg: Compress liveness data to 16 bits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com On 2016-06-23 20:48, Richard Henderson wrote: > This reduces both memory usage and per-insn cacheline usage > during code generation. > > Signed-off-by: Richard Henderson > --- > tcg/tcg.c | 58 ++++++++++++++++++++++------------------------------------ > tcg/tcg.h | 16 ++++++++++------ > 2 files changed, 32 insertions(+), 42 deletions(-) > > diff --git a/tcg/tcg.c b/tcg/tcg.c > index 64060c6..400e69c 100644 > --- a/tcg/tcg.c > +++ b/tcg/tcg.c > @@ -1329,7 +1329,7 @@ static inline void tcg_la_bb_end(TCGContext *s, uint8_t *dead_temps, > } > } > > -/* Liveness analysis : update the opc_dead_args array to tell if a > +/* Liveness analysis : update the opc_arg_life array to tell if a > given input arguments is dead. Instructions updating dead > temporaries are removed. */ > static void tcg_liveness_analysis(TCGContext *s) > @@ -1338,9 +1338,8 @@ static void tcg_liveness_analysis(TCGContext *s) > int oi, oi_prev, nb_ops; > > nb_ops = s->gen_next_op_idx; > - s->op_dead_args = tcg_malloc(nb_ops * sizeof(uint16_t)); > - s->op_sync_args = tcg_malloc(nb_ops * sizeof(uint8_t)); > - > + s->op_arg_life = tcg_malloc(nb_ops * sizeof(TCGLifeData)); > + > dead_temps = tcg_malloc(s->nb_temps); > mem_temps = tcg_malloc(s->nb_temps); > tcg_la_func_end(s, dead_temps, mem_temps); > @@ -1349,8 +1348,7 @@ static void tcg_liveness_analysis(TCGContext *s) > int i, nb_iargs, nb_oargs; > TCGOpcode opc_new, opc_new2; > bool have_opc_new2; > - uint16_t dead_args; > - uint8_t sync_args; > + TCGLifeData arg_life = 0; A small improvement, probably for later: we can zero the s->op_arg_life structure, and then access it directly instead of using the arg_life temporary variable. Reviewed-by: Aurelien Jarno -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net