From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKYBp-0006SL-IM for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:43:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKYBg-0004Bu-8q for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:43:01 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:36809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKYBg-0004B2-3e for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:42:52 -0400 Received: by wicgb10 with SMTP id gb10so216844048wic.1 for ; Wed, 29 Jul 2015 13:42:51 -0700 (PDT) References: <1437755447-10537-1-git-send-email-aurelien@aurel32.net> <1437755447-10537-5-git-send-email-aurelien@aurel32.net> <87k2tjlz7a.fsf@linaro.org> <20150729162757.GB1655@aurel32.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <20150729162757.GB1655@aurel32.net> Date: Wed, 29 Jul 2015 21:42:48 +0100 Message-ID: <87io92n19z.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH for-2.5 04/10] tcg/optimize: allow constant to have copies List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org, Richard Henderson Aurelien Jarno writes: > On 2015-07-29 17:12, Alex Bennée wrote: >> >> Aurelien Jarno writes: >> >> > Now that copies and constants are tracked separately, we can allow >> > constant to have copies, deferring the choice to use a register or a >> > constant to the register allocation pass. This prevent this kind of >> > regular constant reloading: >> > >> > -OUT: [size=338] >> > +OUT: [size=298] >> > mov -0x4(%r14),%ebp >> > test %ebp,%ebp >> > jne 0x7ffbe9cb0ed6 >> > mov $0x40002219f8,%rbp >> > mov %rbp,(%r14) >> > - mov $0x40002219f8,%rbp >> > mov $0x4000221a20,%rbx >> > mov %rbp,(%rbx) >> > mov $0x4000000000,%rbp >> > mov %rbp,(%r14) >> > --- a/tcg/optimize.c >> > +++ b/tcg/optimize.c >> > @@ -237,11 +237,6 @@ static void tcg_opt_gen_mov(TCGContext *s, TCGOp *op, TCGArg *args, >> > return; >> > } >> > >> > - if (temp_is_const(src)) { >> > - tcg_opt_gen_movi(s, op, args, dst, temps[src].val); >> > - return; >> > - } >> > - >> >> That looks suspicious, surely we only want to drop the move if we >> already have the const somewhere else? > > That's actually the while point of this patchset, to avoid converting > mov into moving for constant values and thus loosing the link between > temps. I get that, I guess I didn't follow the previous loading of the constant value. Maybe showing the ops in the commit message will make it clearer. > > At this moment point of the code, the only way to know that the source > temp is a constant is when it has been set using a movi before. OK. -- Alex Bennée