From patchwork Wed Aug 30 09:06:17 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: 137153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4415243vqm; Wed, 30 Aug 2023 02:07:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfNGAm7FghHMcbvU6JHbTocKbKM365AaCraL0o9Z/+Wig5PjtU+j3AfLaovk7Tc2uCDwU/ X-Received: by 2002:a17:906:9746:b0:9a5:962c:cb6c with SMTP id o6-20020a170906974600b009a5962ccb6cmr5866976ejy.31.1693386437071; Wed, 30 Aug 2023 02:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693386437; cv=none; d=google.com; s=arc-20160816; b=hLLJxMdLZ4FeH9WJhMHjby5pKlGgctuzPwQHrvO0nC2MeC7kfg9unWkr2cfX8VAhRa pyILTkCklCCbQlpwc5iIGiCyk+jz/+DJrplPSpqTRvIWJmqwA2DMTqBLCmFzFxn3SdU1 uLlBB1buXXxv81QcIH2LpToDhrJAX1HIgDGqL/CNA5imHeQP9gEwn5UXmDVoIbvCqL11 8xvzBq1UFELpwyMQeCKgNTIm4jQGN5t09FQQkLD1o50nAk1hzutC2ZRcxbJFAzW0aXwo ij6ewUlXcst2fDMdzIVkhtNfM1q2nDlvrsckCAsT7bLNYD8mhTc0JP54HOCFLJw7vCi/ wH8w== 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:in-reply-to:cc :references:to:content-language:subject:user-agent:mime-version:date :message-id:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ajWrULaZE4v63VHRKU44ZPN3PJMcX+ajCOkgfb5Ma+M=; fh=Z+8/kjPbzboGhTQMFYyyjN/U00RNQh1yaEWpyQnXrVg=; b=UTKPdcD2EfDUJ/meCxnuf/Jxd0+W9L8nLzZlKh6d6oEHSbYEItViTJ9G9ZNMY2SMyh gyIUEhBujvAhIRhoSx0rzVKrB3G7mBeOGJDJcDbOVobXz3SmZZHZmbxu05pViGKioSUL 0SHSUv0de9buBdZHJ5vWyZoNCUkqwBmOEEHAPp/BpyaOmzZoAxeHkFQ/PqlR9mR3QJPc 44AxCsvSzO/yG4iHhBVLWpR7qpcTy8G2//zHpoUIFh5Wu1Vh6fK4oSZj0rzfMH5Z0/3Z K+2Ph2ActpANcjrLaZtmSJZ84Wvv97c/WBnxW5a0c7EIzfTbM2ADuzYhTldorHkB+nYh MIkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="I/+Vogss"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y19-20020aa7d513000000b00523372ace05si5301859edq.530.2023.08.30.02.07.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 02:07:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="I/+Vogss"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 0111E385800C for ; Wed, 30 Aug 2023 09:07:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0111E385800C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693386433; bh=ajWrULaZE4v63VHRKU44ZPN3PJMcX+ajCOkgfb5Ma+M=; h=Date:Subject:To:References:Cc:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=I/+VogssNMes5X4LZmoQqmeexM3dWRbVjiI3bUa9BAz0lWnDT7ITxgMmtDoVxoeSC adcxPY4snbqQF8rp6aQXO4JCtKZAsVCRwgx3EiZQza4tmjG9s9RSpbrj5eQvmzCu2e VKNsAP1bXPpwmGG7MeklC8g+QlMy14PDwLvyiDfg= 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 E901A3858C30 for ; Wed, 30 Aug 2023 09:06:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E901A3858C30 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 1DACE2F4; Wed, 30 Aug 2023 02:07:03 -0700 (PDT) Received: from [10.57.64.216] (unknown [10.57.64.216]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DEA573F64C; Wed, 30 Aug 2023 02:06:22 -0700 (PDT) Message-ID: <9c15446b-1f4d-62d7-9427-a19eb07ac8ee@arm.com> Date: Wed, 30 Aug 2023 10:06:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: [PATCH 1/8] parloops: Copy target and optimizations when creating a function clone Content-Language: en-US To: gcc-patches@gcc.gnu.org References: <73b53052-c3a4-4028-2836-ade419431eda@arm.com> Cc: Richard Sandiford , Richard Biener , "jakub@redhat.com" In-Reply-To: <73b53052-c3a4-4028-2836-ade419431eda@arm.com> X-Spam-Status: No, score=-14.0 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.30 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775644376349426323 X-GMAIL-MSGID: 1775644376349426323 SVE simd clones require to be compiled with a SVE target enabled or the argument types will not be created properly. To achieve this we need to copy DECL_FUNCTION_SPECIFIC_TARGET from the original function declaration to the clones. I decided it was probably also a good idea to copy DECL_FUNCTION_SPECIFIC_OPTIMIZATION in case the original function is meant to be compiled with specific optimization options. gcc/ChangeLog: * tree-parloops.cc (create_loop_fn): Copy specific target and optimization options to clone. diff --git a/gcc/tree-parloops.cc b/gcc/tree-parloops.cc index e495bbd65270bdf90bae2c4a2b52777522352a77..a35f3d5023b06e5ef96eb4222488fcb34dd7bd45 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);