From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGABx-0002bJ-L9 for qemu-devel@nongnu.org; Sun, 01 Sep 2013 12:08:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGABr-00041f-KB for qemu-devel@nongnu.org; Sun, 01 Sep 2013 12:07:57 -0400 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]:63332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGABr-00041Y-Cl for qemu-devel@nongnu.org; Sun, 01 Sep 2013 12:07:51 -0400 Received: by mail-pd0-f171.google.com with SMTP id g10so3787465pdj.16 for ; Sun, 01 Sep 2013 09:07:50 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Sun, 1 Sep 2013 09:07:36 -0700 Message-Id: <1378051658-3393-3-git-send-email-rth@twiddle.net> In-Reply-To: <1378051658-3393-1-git-send-email-rth@twiddle.net> References: <1378051658-3393-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 2/4] 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: "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 9a73d06..b0fbc54 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