From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0cw5-0006xe-5o for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:44:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0cw4-0001e2-6W for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:44:25 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:101::1]:45911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0cw4-0001dv-0F for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:44:24 -0400 Date: Thu, 4 Jun 2015 23:44:20 +0200 From: Aurelien Jarno Message-ID: <20150604214420.GA6313@aurel32.net> References: <1433447607-31184-1-git-send-email-aurelien@aurel32.net> <1433447607-31184-5-git-send-email-aurelien@aurel32.net> <5570BE19.7090000@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5570BE19.7090000@twiddle.net> 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: Richard Henderson Cc: qemu-devel@nongnu.org On 2015-06-04 14:07, Richard Henderson wrote: > 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. If the state of a temp is TCG_TEMP_CONST, it can't be a copy as its state should be TCG_TEMP_COPY for that. But it's true that the original code is checking first for copies and then for constants. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net