From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJ8Hh-0004QU-5S for qemu-devel@nongnu.org; Sat, 25 Jul 2015 18:51:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJ8Hg-0006qO-6L for qemu-devel@nongnu.org; Sat, 25 Jul 2015 18:51:13 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:33283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJ8Hf-0006nS-W9 for qemu-devel@nongnu.org; Sat, 25 Jul 2015 18:51:12 -0400 Date: Sun, 26 Jul 2015 00:51:00 +0200 From: Aurelien Jarno Message-ID: <20150725225100.GA28706@aurel32.net> References: <1437780852-1549-1-git-send-email-aurelien@aurel32.net> <55B4084B.4060804@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55B4084B.4060804@twiddle.net> Subject: Re: [Qemu-devel] [PATCH for-2.4] tcg: correctly mark dead inputs for mov with a constant List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org On 2015-07-25 15:06, Richard Henderson wrote: > On 07/24/2015 04:34 PM, Aurelien Jarno wrote: > > ots->val_type = TEMP_VAL_CONST; > > ots->val = ts->val; > >+ if (IS_DEAD_ARG(1)) { > >+ temp_dead(s, args[1]); > >+ } > > Aren't we also missing > > if (NEED_SYNC_ARG(0)) { > temp_sync(s, args[0], allocated_regs); > } > > along this path? I don't think so, I guess it's covered by the first part of this function: | if (((NEED_SYNC_ARG(0) || ots->fixed_reg) && ts->val_type != TEMP_VAL_REG) | || ts->val_type == TEMP_VAL_MEM) { It means after this block, a value that need to be synced will always be in a register, including in the constant case. > Seems like there's room for cleanup here, at least for 2.5... I agree we might want to clean a bit the code. It might even go beyond this function, as we repeatedly have almost the same code in various places of tcg.c. For example we can imagine a function "move this temp whatever it is (mem, const, reg) in this register". If we declare it inline, we can leave the compiler do the few optimizations we have done. But indeed that's for 2.5. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net