From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60962 invoked by alias); 16 Jun 2015 14:04:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 60942 invoked by uid 89); 16 Jun 2015 14:04:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS,T_MANY_HDRS_LCASE autolearn=no version=3.3.2 X-HELO: mailout4.w1.samsung.com Received: from mailout4.w1.samsung.com (HELO mailout4.w1.samsung.com) (210.118.77.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 16 Jun 2015 14:04:48 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NQ1007XZJ3WN890@mailout4.w1.samsung.com> for gcc-patches@gcc.gnu.org; Tue, 16 Jun 2015 15:04:44 +0100 (BST) Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id A5.22.04846.CFC20855; Tue, 16 Jun 2015 15:04:44 +0100 (BST) Received: from samsung.com ([106.109.129.221]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NQ100EJUJ3UXX20@eusync1.samsung.com>; Tue, 16 Jun 2015 15:04:44 +0100 (BST) Received: by samsung.com (sSMTP sendmail emulation); Tue, 16 Jun 2015 17:04:42 +0300 From: Yury Usishchev To: gcc-patches Cc: Vyacheslav Barinov Subject: [PATCH][ARM] PR/66433: Reduce cost of memory instructions with autoincrement Date: Tue, 16 Jun 2015 14:11:00 -0000 Message-id: <87bngfwxz9.fsf@samsung.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-version: 1.0 Content-type: multipart/mixed; boundary="=-=-=" X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg01135.txt.bz2 --=-=-= Content-Type: text/plain Content-length: 372 Hello! Following patch fixes PR target/66433. As described in PR, cost of memory operation with autoincrement is considered to be greater than same operation without autoincrement. This causes auto-inc-dec pass not to optimize vector memory operations like vld and vst. Bootstrapped and regtested on armv7l-linux-gnueabi on trunk. OK for trunk? -- BR, Yury Usishchev --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=pr_66433.CL Content-length: 303 gcc/ 2015-06-16 Yury Usishchev PR target/66433 * config/arm/arm.c (arm_new_rtx_costs): Reduce cost of memory instructions with autoincrement. gcc/testsuite/ 2015-06-16 Yury Usishchev PR target/66433 * gcc.target/arm/pr66433.c: New test. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=pr_66433.patch Content-length: 1425 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f5050cb..a8dc0ed 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -9444,7 +9444,9 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, case MEM: /* A memory access costs 1 insn if the mode is small, or the address is a single register, otherwise it costs one insn per word. */ - if (REG_P (XEXP (x, 0))) + if (REG_P (XEXP (x, 0)) + || (GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == RTX_AUTOINC + && REG_P (XEXP (XEXP (x, 0), 0)))) *cost = COSTS_N_INSNS (1); else if (flag_pic && GET_CODE (XEXP (x, 0)) == PLUS diff --git a/gcc/testsuite/gcc.target/arm/pr66433.c b/gcc/testsuite/gcc.target/arm/pr66433.c new file mode 100644 index 0000000..22ba158 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr66433.c @@ -0,0 +1,21 @@ +/* Test the optimization of `vld*' ARM NEON intrinsic with autoincrement. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-options "-O2" } */ +/* { dg-add-options arm_neon } */ + +#include + +void test_vld_autoinc (uint32_t *__restrict__ a, uint32_t *__restrict__ b) +{ + int i; + for(i = 0; i < 1000000; i++) { + vst1q_u32 (b, vld1q_u32 (a)); + a += 4; + b += 4; + } +} + +/* { dg-final { scan-assembler "vld1\.32.*!.*\n" } } */ +/* { dg-final { scan-assembler "vst1\.32.*!.*\n" } } */ --=-=-=--