public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andre Simoes Dias Vieira <avieira@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-4762] parloops: Copy target and optimizations when creating a function clone
Date: Thu, 19 Oct 2023 17:30:46 +0000 (GMT)	[thread overview]
Message-ID: <20231019173046.860DC38582B0@sourceware.org> (raw)

https://gcc.gnu.org/g:87d97e26076a131541e8562932248bc24590e38f

commit r14-4762-g87d97e26076a131541e8562932248bc24590e38f
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date:   Thu Oct 19 18:26:45 2023 +0100

    parloops: Copy target and optimizations when creating a function clone
    
    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:
---
 gcc/tree-parloops.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/tree-parloops.cc b/gcc/tree-parloops.cc
index e495bbd65270..a35f3d5023b0 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);

                 reply	other threads:[~2023-10-19 17:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231019173046.860DC38582B0@sourceware.org \
    --to=avieira@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).