public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Alex Coplan <alex.coplan@arm.com>
Cc: gcc-patches@gcc.gnu.org,
	Richard Earnshaw <richard.earnshaw@arm.com>,
	Kyrylo Tkachov <kyrylo.tkachov@arm.com>,
	Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PATCH v2] aarch64: Fix SVE ACLE builtins with LTO [PR99216]
Date: Fri, 26 Mar 2021 16:43:35 +0000	[thread overview]
Message-ID: <mptczvlq30o.fsf@arm.com> (raw)
In-Reply-To: <20210309154058.5u6cvoo52yrijpue@arm.com> (Alex Coplan's message of "Tue, 9 Mar 2021 15:41:00 +0000")

Alex Coplan <alex.coplan@arm.com> writes:
> Hi all,
>
> Here is a v2 patch which provides a more obviously fake answer to
> TARGET_BUILTIN_DECL: this can hopefully go in for GCC 11. For GCC 12, it
> seems that we should consider removing the target hook.
>
> Original patch:
> https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566405.html
>
> ---
>
> As discussed in the PR, we currently have two different numbering
> schemes for SVE builtins: one for C, and one for C++. This is
> problematic for LTO, where we end up getting confused about which
> intrinsic we're talking about. This patch inserts placeholders into the
> registered_functions vector to ensure that there is a consistent
> numbering scheme for both C and C++.
>
> This patch uses integer_zero_node as a placeholder node instead of
> building a function decl. This is safe because the node is only returned
> by the TARGET_BUILTIN_DECL hook, which (on AArch64) is only used for
> validation when builtin decls are streamed into lto1.
>
> Bootstrapped and regtested on aarch64-linux-gnu, OK for trunk?
>
> Thanks,
> Alex
>
> gcc/ChangeLog:
>
> 	PR target/99216
> 	* config/aarch64/aarch64-sve-builtins.cc
> 	(function_builder::add_function): Add placeholder_p argument, use
> 	placeholder decls if this is set.
> 	(function_builder::add_unique_function): Instead of conditionally adding
> 	direct overloads, unconditionally add either a direct overload or a
> 	placeholder.
> 	(function_builder::add_overloaded_function): Set placeholder_p if we're
> 	using C++ overloads. Use the obstack for string storage instead
> 	of relying on the tree nodes.
> 	(function_builder::add_overloaded_functions): Don't return early for
> 	m_direct_overloads: we need to add placeholders.
> 	* config/aarch64/aarch64-sve-builtins.h
> 	(function_builder::add_function): Add placeholder_p argument.
>
> gcc/testsuite/ChangeLog:
>
> 	PR target/99216
> 	* g++.target/aarch64/sve/pr99216.C: New test.

OK, thanks, and sorry for the delay in reviewing.

Richard

      parent reply	other threads:[~2021-03-26 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 15:41 Alex Coplan
2021-03-23 11:52 ` Alex Coplan
2021-03-26 16:43 ` Richard Sandiford [this message]

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=mptczvlq30o.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=alex.coplan@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=richard.earnshaw@arm.com \
    --cc=richard.guenther@gmail.com \
    /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).