From patchwork Wed Mar 8 16:21:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andre Vieira (lists)" X-Patchwork-Id: 1754197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=oI32GXRu; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PWyJV4F8zz1yWs for ; Thu, 9 Mar 2023 03:22:17 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 804193851159 for ; Wed, 8 Mar 2023 16:22:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 804193851159 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678292535; bh=GjUELMLl3ytd81e6lo2zqQwzrUu+ttuf4Hji063jqu0=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=oI32GXRuEogGu/HVk1TL1G1LsG2LgaaAF4TvCvLqEpbcO8yywyAUOqw+/rpMEqEjP qyMigshBsWVo098u2pMmA1iCQrKgJCDwoIpqlG7I5xcNnPZlHPgROq92vt8WIG7efQ ZGsdcWb2EOhqej5qsDrADyffgeJWhUDjhEfqJ8eo= 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 365393858D33 for ; Wed, 8 Mar 2023 16:21:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 365393858D33 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 5C3731063; Wed, 8 Mar 2023 08:22:37 -0800 (PST) Received: from [10.57.79.24] (unknown [10.57.79.24]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C7C03F71A; Wed, 8 Mar 2023 08:21:53 -0800 (PST) Message-ID: <08d8c50f-6338-38dc-6248-ecd9ecd54f51@arm.com> Date: Wed, 8 Mar 2023 16:21:47 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 2/X] parloops: Copy target and optimizations when creating a function clone Content-Language: en-US To: "gcc-patches@gcc.gnu.org" Cc: "jakub@redhat.com" , Richard Sandiford , Richard Biener References: In-Reply-To: X-Spam-Status: No, score=-15.9 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 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: "Andre Vieira \(lists\) via Gcc-patches" From: "Andre Vieira (lists)" Reply-To: "Andre Vieira \(lists\)" Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch makes sure we copy over DECL_FUNCTION_SPECIFIC_{TARGET,OPTIMIZATION} in parloops when creating function clones. This is required for SVE clones as we will need to enable +sve for them, regardless of the current target options. I don't actually need the 'OPTIMIZATION' for this patch, but it sounds like a nice feature to have, so you can use pragmas to better control options used in simd_clone generation. gcc/ChangeLog: * tree-parloops.cc (create_loop_fn): Copy specific target and optimization options when creating a function clone. Is this OK for stage 1? diff --git a/gcc/tree-parloops.cc b/gcc/tree-parloops.cc index dfb75c369d6d00d893ddd6fc28f189ec0d774711..02c1ed3220a949c1349536ef3f74bb497bf76f71 100644 --- a/gcc/tree-parloops.cc +++ b/gcc/tree-parloops.cc @@ -2203,6 +2203,11 @@ create_loop_fn (location_t loc) DECL_CONTEXT (t) = decl; TREE_USED (t) = 1; DECL_ARGUMENTS (decl) = t; + DECL_FUNCTION_SPECIFIC_TARGET (decl) + = DECL_FUNCTION_SPECIFIC_TARGET (act_cfun->decl); + DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) + = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (act_cfun->decl); + allocate_struct_function (decl, false);