From patchwork Mon Sep 5 13:15:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 995 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp173119wrt; Mon, 5 Sep 2022 06:16:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR6cYs59e6jiOw7TC+ZJK1zUMWL9zCNryaKgEKsyIwsfPI5k1R3PfIU6fAvfjbBrx0wR5clW X-Received: by 2002:a17:906:c150:b0:751:288b:671d with SMTP id dp16-20020a170906c15000b00751288b671dmr10886002ejc.549.1662383804495; Mon, 05 Sep 2022 06:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662383804; cv=none; d=google.com; s=arc-20160816; b=zzGvi+H9p6h7MkIMaP7fW0MnI85HdT87gsujLSAnzXkOpsUdMo9rwAZTmN5GPkz6Vd PvZ6cXjXmGx6xzOwChO+bF/PDsgzO6TI6XImlbXu32Z0NehJj+nUoxp+pZakenWdzcHE 7dEENm5BFJXvFbJuHbDovHQyNCYP9pjqp3spmkQ9FjIJQcUou+ILDgdETyOu4Mu7S8eL Nl1jEmvPjsMvpV3ydAUYGO9zTJut/safomWCtpSAFICB7k+KDS8avY9CqJyd1/C8l09n nnTV8xiXHllGMLN4nWTkmADeETH61q439mETBVKjvFSjR81EwUpcR7LiXDxkY8WEmH0Z RSKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:subject:mail-followup-to:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=d1ezanzcAtjNDFQXNbuAhBjI0ZyQEADHpnW5wb7vLjs=; b=v6Ij538khODGiygOMyOigzRlBinMDn+B/RF2KAOh3mQw1x9vQ8+S/VeF3QtWnIk8UL lfbSphxNdGyRgzuMhihwfPj0of0sTVHzvUvB2R2ovmm1pgNFuaD3X4+FqkDMasjKZspj oNEJ1gMjRKRRXPvK31QjqPeqQQp4EDu8QYlXgv/WKcqvyOCZBqrMmiMfmMD1ibyw/GsE veA4WYbRr7g1ejpzGp3WxXRuSUa6Qg6n38fhKMf32iuRXpbIAosEU/W8z6gJdlfgWNyP 19oMqp6x+AdcUBDiONtd2is8iyvAA4EZ1q0g/oclEB4Y2EK17XvU5gcRM1DVOEbonEXv Tz4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=C1Vr6gPB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id js17-20020a17090797d100b0072f1c8d0ec4si8116633ejc.584.2022.09.05.06.16.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 06:16:44 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=C1Vr6gPB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 682493857017 for ; Mon, 5 Sep 2022 13:16:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 682493857017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662383803; bh=d1ezanzcAtjNDFQXNbuAhBjI0ZyQEADHpnW5wb7vLjs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=C1Vr6gPBEyEaPTV6KV42WI9zOiheyjn496sG37PWraVXrMtrYsRTPKj4R10qqacK7 8e7/dLUjj3bR/W9gx8WMF2ltddToxEtMSwlN9pJNnLB6Ao4HUSzhoCVl3yuKeZax7V sBmltO1Qf8ADQ7mdz8z7J+sCN7Ee8qcjfcPstuus= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 37D593858CDA for ; Mon, 5 Sep 2022 13:15:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 37D593858CDA Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C3630ED1 for ; Mon, 5 Sep 2022 06:16:04 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2E9133F7B4 for ; Mon, 5 Sep 2022 06:15:58 -0700 (PDT) To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [pushed] aarch64: Remove lazy SIMD builtin initialisation Date: Mon, 05 Sep 2022 14:15:56 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-49.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Sandiford via Gcc-patches From: Richard Sandiford Reply-To: Richard Sandiford Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1743135760402736190?= X-GMAIL-MSGID: =?utf-8?q?1743135760402736190?= At one time the aarch64 port registered the Advanced SIMD builtins lazily, when we first encountered a set of target flags that includes +simd. These days we always initialise them at start-up, temporarily forcing a conducive set of flags if necessary. This patch removes some vestiges of the old way of doing things. Tested on aarch64-linux-gnu & pushed. Richard gcc/ * config/aarch64/aarch64-protos.h (aarch64_init_simd_builtins): Remove prototype. * config/aarch64/aarch64-builtins.cc (aarch64_simd_builtins_initialized_p): Delete. (aarch64_init_simd_builtins): Make static. Remove protection against multiple calls. * config/aarch64/aarch64-c.cc (aarch64_pragma_target_parse): Remove lazy SIMD builtin initialization. * config/aarch64/aarch64.cc (aarch64_option_valid_attribute_p): Likewise. --- gcc/config/aarch64/aarch64-builtins.cc | 9 +-------- gcc/config/aarch64/aarch64-c.cc | 13 ------------- gcc/config/aarch64/aarch64-protos.h | 1 - gcc/config/aarch64/aarch64.cc | 12 ------------ 4 files changed, 1 insertion(+), 34 deletions(-) diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index f90fda4ca97..5eef5aaa402 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -1300,8 +1300,6 @@ aarch64_get_attributes (unsigned int f, machine_mode mode) return aarch64_add_attribute ("leaf", attrs); } -static bool aarch64_simd_builtins_initialized_p = false; - /* Due to the architecture not providing lane variant of the lane instructions for fcmla we can't use the standard simd builtin expansion code, but we still want the majority of the validation that would normally be done. */ @@ -1586,14 +1584,9 @@ handle_arm_neon_h (void) aarch64_init_simd_intrinsics (); } -void +static void aarch64_init_simd_builtins (void) { - if (aarch64_simd_builtins_initialized_p) - return; - - aarch64_simd_builtins_initialized_p = true; - aarch64_init_simd_builtin_types (); /* Strong-typing hasn't been implemented for all AdvSIMD builtin intrinsics. diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index 3d2fb5ec2ef..52ed4a218a8 100644 --- a/gcc/config/aarch64/aarch64-c.cc +++ b/gcc/config/aarch64/aarch64-c.cc @@ -270,19 +270,6 @@ aarch64_pragma_target_parse (tree args, tree pop_target) if (pop_target) aarch64_save_restore_target_globals (pop_target); - /* Initialize SIMD builtins if we haven't already. - Set current_target_pragma to NULL for the duration so that - the builtin initialization code doesn't try to tag the functions - being built with the attributes specified by any current pragma, thus - going into an infinite recursion. */ - if (TARGET_SIMD) - { - tree saved_current_target_pragma = current_target_pragma; - current_target_pragma = NULL; - aarch64_init_simd_builtins (); - current_target_pragma = saved_current_target_pragma; - } - return true; } diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 99af10ad534..5ecdb8af863 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -907,7 +907,6 @@ void aarch64_sve_expand_vector_init (rtx, rtx); void aarch64_init_cumulative_args (CUMULATIVE_ARGS *, const_tree, rtx, const_tree, unsigned, bool = false); void aarch64_init_expanders (void); -void aarch64_init_simd_builtins (void); void aarch64_emit_call_insn (rtx); void aarch64_register_pragmas (void); void aarch64_relayout_simd_types (void); diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index b12f13f4f22..2311ad0e2b8 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -18898,18 +18898,6 @@ aarch64_option_valid_attribute_p (tree fndecl, tree, tree args, int) if (ret) { aarch64_override_options_internal (&global_options); - /* Initialize SIMD builtins if we haven't already. - Set current_target_pragma to NULL for the duration so that - the builtin initialization code doesn't try to tag the functions - being built with the attributes specified by any current pragma, thus - going into an infinite recursion. */ - if (TARGET_SIMD) - { - tree saved_current_target_pragma = current_target_pragma; - current_target_pragma = NULL; - aarch64_init_simd_builtins (); - current_target_pragma = saved_current_target_pragma; - } new_target = build_target_option_node (&global_options, &global_options_set); }