From patchwork Sun Jun 28 11:30:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 50402 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9DB84228D9 for ; Sun, 28 Jun 2015 11:31:14 +0000 (UTC) Received: by lagx9 with SMTP id x9sf11660300lag.2 for ; Sun, 28 Jun 2015 04:31:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type:x-original-sender :x-original-authentication-results; bh=wBDaC4PumQZXo319+ZdDNPzlMi783oqzxrHy70uZpjQ=; b=GP3tUThP7FSofpZbCgYWgbwVkGfHf9KdNuRVLoPGYk5ldvWWYwdUGsbZY3jKPduOwT oBed7CnKeRWF4ytI9C7jpnY2LIn7HDjokpA8+/RFiZwFPmozjHBp69j9DbfbN+zgD/9P z4au1QqiirqFavPbJ/zV3Sez/F7cHVfwoEniNldVoB0Y04zBbOQhJLs2xArvlWfTlyS1 27YRxVTlWve5Td6ErLLYAtQQhT1WgurdkFPzwVNk2c0MxF6fJA2q0i8dVryfX/71fMo6 6DV2iSNXdK9GKSMm/yLS0144ZBZYxRaQZglNUf2BiswSVTO66CtSlG6ubzbqftwvvqsJ i61g== X-Gm-Message-State: ALoCoQlPYWNpPOUGX73F0995K5PmcyW0bDvMsAkm170xkoCu72SyaBRzcOmUlMpdZfXRSTKirpzp X-Received: by 10.112.13.200 with SMTP id j8mr7540495lbc.14.1435491073241; Sun, 28 Jun 2015 04:31:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.9 with SMTP id ky9ls565991lab.98.gmail; Sun, 28 Jun 2015 04:31:12 -0700 (PDT) X-Received: by 10.152.44.193 with SMTP id g1mr9522973lam.15.1435491072891; Sun, 28 Jun 2015 04:31:12 -0700 (PDT) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com. [2a00:1450:4010:c03::235]) by mx.google.com with ESMTPS id wr11si20198159lbc.105.2015.06.28.04.31.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 04:31:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::235 as permitted sender) client-ip=2a00:1450:4010:c03::235; Received: by lagh6 with SMTP id h6so25554091lag.2 for ; Sun, 28 Jun 2015 04:31:12 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr9538598lbc.86.1435491072393; Sun, 28 Jun 2015 04:31:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1051991lbb; Sun, 28 Jun 2015 04:31:10 -0700 (PDT) X-Received: by 10.66.155.36 with SMTP id vt4mr21776969pab.32.1435491069941; Sun, 28 Jun 2015 04:31:09 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ci16si59377577pdb.76.2015.06.28.04.31.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 04:31:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-401491-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 83785 invoked by alias); 28 Jun 2015 11:30:55 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 83763 invoked by uid 89); 28 Jun 2015 11:30:51 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f49.google.com Received: from mail-pa0-f49.google.com (HELO mail-pa0-f49.google.com) (209.85.220.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 28 Jun 2015 11:30:50 +0000 Received: by pabvl15 with SMTP id vl15so91006521pab.1 for ; Sun, 28 Jun 2015 04:30:48 -0700 (PDT) X-Received: by 10.67.14.10 with SMTP id fc10mr21363771pad.51.1435491048501; Sun, 28 Jun 2015 04:30:48 -0700 (PDT) Received: from [10.1.1.6] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id jt2sm38824253pbc.21.2015.06.28.04.30.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 04:30:47 -0700 (PDT) Message-ID: <558FDAE4.4040808@linaro.org> Date: Sun, 28 Jun 2015 21:30:44 +1000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH 2/2] Set REG_EQUAL References: <558FD9D5.9070703@linaro.org> In-Reply-To: <558FD9D5.9070703@linaro.org> X-IsSubscribed: yes X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::235 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 This patch sets REG_EQUAL when emitting arm_emit_movpair. Thanks, Kugan gcc/testsuite/ChangeLog: 2015-06-26 Kugan Vivekanandarajah * gcc.target/arm/reg_equal_test.c: New test. gcc. 2015-06-26 Kugan Vivekanandarajah * config/arm/arm.c (arm_emit_movpair): Add REG_EQUAL notes to instruction. >From e90feaca4d7dfc893cb2a0142e1888655c9ffa1f Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah Date: Fri, 26 Jun 2015 17:22:22 +1000 Subject: [PATCH 2/2] Add REG_EQUAL note for arm_emit_movpair --- gcc/config/arm/arm.c | 14 +++++++++++--- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/arm/reg_equal_test.c | 24 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arm/reg_equal_test.c diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 83f3269..8a47c72 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -17884,19 +17884,27 @@ output_mov_long_double_arm_from_arm (rtx *operands) void arm_emit_movpair (rtx dest, rtx src) { + rtx insn; + /* If the src is an immediate, simplify it. */ if (CONST_INT_P (src)) { HOST_WIDE_INT val = INTVAL (src); emit_set_insn (dest, GEN_INT (val & 0x0000ffff)); if ((val >> 16) & 0x0000ffff) - emit_set_insn (gen_rtx_ZERO_EXTRACT (SImode, dest, GEN_INT (16), - GEN_INT (16)), - GEN_INT ((val >> 16) & 0x0000ffff)); + { + emit_set_insn (gen_rtx_ZERO_EXTRACT (SImode, dest, GEN_INT (16), + GEN_INT (16)), + GEN_INT ((val >> 16) & 0x0000ffff)); + insn = get_last_insn (); + set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src)); + } return; } emit_set_insn (dest, gen_rtx_HIGH (SImode, src)); emit_set_insn (dest, gen_rtx_LO_SUM (SImode, dest, src)); + insn = get_last_insn (); + set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src)); } /* Output a move between double words. It must be REG<-MEM diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b6486ac..8edb484 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-06-26 Kugan Vivekanandarajah + + * gcc.target/arm/reg_equal_test.c: New test. + 2015-06-25 Richard Biener * gcc.dg/tree-ssa/pr52631.c: Disable forwprop. diff --git a/gcc/testsuite/gcc.target/arm/reg_equal_test.c b/gcc/testsuite/gcc.target/arm/reg_equal_test.c new file mode 100644 index 0000000..58fa9dd --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/reg_equal_test.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-rtl-expand" } */ + +extern void abort (void); +unsigned int a = 1; + +int +main (void) +{ + unsigned int b, c, d; + + if (sizeof (int) != 4 || (int) 0xc7d24b5e > 0) + return 0; + + c = 0xc7d24b5e; + d = a | -2; + b = (d == 0) ? c : (c % d); + if (b != c) + abort (); + + return 0; +} + +/* { dg-final { scan-rtl-dump "expr_list:REG_EQUAL \\(const_int -942519458" "expand" } } */ -- 1.9.1