From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0cMb-0003tW-Tg for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:07:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0cMX-0006HX-TU for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:07:45 -0400 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:33337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0cMX-0006HR-PG for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:07:41 -0400 Received: by qkhg32 with SMTP id g32so30751853qkh.0 for ; Thu, 04 Jun 2015 14:07:41 -0700 (PDT) Sender: Richard Henderson Message-ID: <5570BE19.7090000@twiddle.net> Date: Thu, 04 Jun 2015 14:07:37 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1433447607-31184-1-git-send-email-aurelien@aurel32.net> <1433447607-31184-5-git-send-email-aurelien@aurel32.net> In-Reply-To: <1433447607-31184-5-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 4/5] tcg/optimize: fold constant test in tcg_opt_gen_mov List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-devel@nongnu.org On 06/04/2015 12:53 PM, Aurelien Jarno wrote: > + > static void tcg_opt_gen_mov(TCGContext *s, TCGOp *op, TCGArg *args, > TCGArg dst, TCGArg src) > { > + if (temps[src].state == TCG_TEMP_CONST) { > + tcg_opt_gen_movi(s, op, args, dst, temps[src].val); > + return; > + } > + > if (temps_are_copies(dst, src)) { > tcg_op_remove(s, op); > return; I was going to comment re patch 3/5, but here's better, since it actually tidies up all the places I would have pointed out. I think you should check for copies first, and only then do the TEMP_CONST check. That way we get to remove an op. r~