From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yuimd-0002x8-RN for qemu-devel@nongnu.org; Tue, 19 May 2015 10:46:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuimW-00057G-KH for qemu-devel@nongnu.org; Tue, 19 May 2015 10:46:15 -0400 Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]:34266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuimW-000574-FO for qemu-devel@nongnu.org; Tue, 19 May 2015 10:46:08 -0400 Received: by qgez61 with SMTP id z61so4428527qge.1 for ; Tue, 19 May 2015 07:46:08 -0700 (PDT) Sender: Richard Henderson Message-ID: <555B4CAC.30805@twiddle.net> Date: Tue, 19 May 2015 07:46:04 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1432031208-20020-1-git-send-email-aurelien@aurel32.net> In-Reply-To: <1432031208-20020-1-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] tcg: fix dead computation for repeated input arguments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-devel@nongnu.org On 05/19/2015 03:26 AM, Aurelien Jarno wrote: > @@ -1522,6 +1522,9 @@ static void tcg_liveness_analysis(TCGContext *s) > if (dead_temps[arg]) { > dead_args |= (1 << i); > } > + } > + for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { > + arg = args[i]; > dead_temps[arg] = 0; > } > s->op_dead_args[oi] = dead_args; How about another line of commentary for each loop? Something like /* Record arguments that die in this opcode. */ for the first and /* Input arguments are live for preceeding opcodes. */ for the second. As for the same loop for calls, you're right that it may well cause us to do a tiny bit of redundant work, but nothing else bad will happen. We'll enter temp_dead more times than necessary. I'm always skeptical about knowingly giving a compiler bad information though. You tend to not know how data is going to be used in future, and *then* get bad results. r~