From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJBov-0002Hy-Pc for qemu-devel@nongnu.org; Mon, 09 Sep 2013 20:28:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJBoo-0005mL-MN for qemu-devel@nongnu.org; Mon, 09 Sep 2013 20:28:41 -0400 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]:47687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJBoo-0005mE-Ez for qemu-devel@nongnu.org; Mon, 09 Sep 2013 20:28:34 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb10so6975725pad.37 for ; Mon, 09 Sep 2013 17:28:33 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 9 Sep 2013 17:28:19 -0700 Message-Id: <1378772902-4074-5-git-send-email-rth@twiddle.net> In-Reply-To: <1378772902-4074-1-git-send-email-rth@twiddle.net> References: <1378772902-4074-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH v2 4/7] tcg-ppc: Avoid code for nop move List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, "Vassili Karpov (malc)" , aurelien@aurel32.net, Richard Henderson While these are rare from code that's been through the optimizer, it's not uncommon within the tcg backend. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c index 24a8621..965108b 100644 --- a/tcg/ppc/tcg-target.c +++ b/tcg/ppc/tcg-target.c @@ -450,7 +450,9 @@ static const uint32_t tcg_to_bc[] = { static void tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg) { - tcg_out32 (s, OR | SAB (arg, ret, arg)); + if (ret != arg) { + tcg_out32(s, OR | SAB(arg, ret, arg)); + } } static void tcg_out_movi(TCGContext *s, TCGType type, -- 1.8.3.1