From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55120 invoked by alias); 7 Jul 2015 12:54:50 -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 55108 invoked by uid 89); 7 Jul 2015 12:54:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jul 2015 12:54:48 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-5-PsOCfrfyQmqhjXgxREAMWA-1; Tue, 07 Jul 2015 13:54:43 +0100 Received: from e104437-lin ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 7 Jul 2015 13:54:42 +0100 References: From: Jiong Wang To: gcc-patches Subject: [AArch64][2/2] Define TARGET_UNSPEC_MAY_TRAP_P for AArch64 Date: Tue, 07 Jul 2015 12:54:00 -0000 In-reply-to: Message-ID: MIME-Version: 1.0 X-MC-Unique: PsOCfrfyQmqhjXgxREAMWA-1 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2015-07/txt/msg00494.txt.bz2 --=-=-= Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-length: 605 A second patch to improve rtl loop iv on AArch64. We should define this to tell gcc the pattern hidden by these GOT unspec is safe from trap, so gcc could make more positive decision when handling them, for example in RTL loop iv pass, when deciding whether one instruction is invariant candidate, may_trap_or_fault_p will be invoked which will call this target hook. OK for trunk? 2015-07-07 Jiong Wang gcc/ * config/aarch64/aarch64.c (aarch64_unspec_may_trap_p): New function. (TARGET_UNSPEC_MAY_TRAP_P): Define as aarch64_unspec_may_trap_p. =20=20 --=20 Regards, Jiong --=-=-= Content-Type: text/x-diff; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename=notrap_p.patch Content-length: 1090 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index e180daa..c7c12ee 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -11943,6 +11943,24 @@ aarch64_use_pseudo_pic_reg (void) return aarch64_cmodel =3D=3D AARCH64_CMODEL_SMALL_SPIC; } =20 +/* Implement TARGET_UNSPEC_MAY_TRAP_P. */ + +static int +aarch64_unspec_may_trap_p (const_rtx x, unsigned flags) +{ + switch (XINT (x, 1)) + { + case UNSPEC_GOTSMALLPIC: + case UNSPEC_GOTSMALLPIC28K: + case UNSPEC_GOTTINYPIC: + return 0; + default: + break; + } + + return default_unspec_may_trap_p (x, flags); +} + #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST aarch64_address_cost =20 @@ -12221,6 +12239,9 @@ aarch64_use_pseudo_pic_reg (void) #undef TARGET_SCHED_FUSION_PRIORITY #define TARGET_SCHED_FUSION_PRIORITY aarch64_sched_fusion_priority =20 +#undef TARGET_UNSPEC_MAY_TRAP_P +#define TARGET_UNSPEC_MAY_TRAP_P aarch64_unspec_may_trap_p + #undef TARGET_USE_PSEUDO_PIC_REG #define TARGET_USE_PSEUDO_PIC_REG aarch64_use_pseudo_pic_reg =20 --=-=-=--