From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 04E44388207E for ; Thu, 13 Jun 2024 12:42:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04E44388207E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 04E44388207E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718282534; cv=none; b=lR2MuEkq617zoo7OJLr0S6Jmzcwr1Ytjg9p5xibWFEUIAlyXcjg3JAzEm47RAEdB6oZy4eOxridKbcEaGVrC5boMNN3xE4fDp/V24MpdGejrVvLTi7RBRpO5J9lmZ1or8RrEYKzkNBpHa1mVXMclePX30mY4iYlzXu4uYEeRop8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718282534; c=relaxed/simple; bh=ULGyTHwmSVMsUMJ5c+gETK9n3m0puzuESFlSmJ1NYY4=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=U1OgaQVbBkQhKeZpMNopzAhRrVDdikrfTGp65pim7BE9jQH0XuFYVwZIhkkX4yq5voiE8VYrh9h7vAE+IT21TsD8X+moRkL1cjikQR8t6XnU8mReqd/J7K0zJh/oDahkZL6EICaKFgz0QEcEw6C1jHjLDgK6CBrVftGqJ46ML1s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718282532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aYd1lpiaiDmEYiIZSzJgLJTFLVBycZnYgWILE/wVYJk=; b=NTDmencJeelJRIO6cFqOYwOAUAAGFK0qPx7WwMo5co2AtUdmdw+sCaf+4pLltxIBA1ku1A eoMTjcBpSHyJ9T1B+sJQYam5J7avw8ULc8mMUYrpY+NeBajll0LW1XvfQAWNT9VbeLVBMm zxahVHVuvXKjFIN3AXlFMkjdqKawhQc= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-413-29IaM5H4N-GeuoszFNrj3A-1; Thu, 13 Jun 2024 08:42:09 -0400 X-MC-Unique: 29IaM5H4N-GeuoszFNrj3A-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8F6A41955DD4; Thu, 13 Jun 2024 12:42:08 +0000 (UTC) Received: from localhost (unknown [10.39.192.128]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ED32E19560BF; Thu, 13 Jun 2024 12:42:07 +0000 (UTC) Date: Thu, 13 Jun 2024 13:42:06 +0100 From: Jonathan Wakely To: Ken Matsui Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH v26 12/13] libstdc++: Optimize std::is_invocable compilation performance Message-ID: References: <20240510161405.194750-21-kmatsui@gcc.gnu.org> <20240511090130.248174-1-kmatsui@gcc.gnu.org> <20240511090130.248174-12-kmatsui@gcc.gnu.org> MIME-Version: 1.0 In-Reply-To: <20240511090130.248174-12-kmatsui@gcc.gnu.org> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/05/24 02:01 -0700, Ken Matsui wrote: >This patch optimizes the compilation performance of std::is_invocable >by dispatching to the new __is_invocable built-in trait. I'm excited for this one, as I hope it will make a big difference to compilation times for and in C++20. OK, thanks. >libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_invocable): Use __is_invocable > built-in trait. > * testsuite/20_util/is_invocable/incomplete_args_neg.cc: Handle > the new error from __is_invocable. > * testsuite/20_util/is_invocable/incomplete_neg.cc: Likewise. > >Signed-off-by: Ken Matsui >--- > libstdc++-v3/include/std/type_traits | 4 ++++ > .../testsuite/20_util/is_invocable/incomplete_args_neg.cc | 1 + > libstdc++-v3/testsuite/20_util/is_invocable/incomplete_neg.cc | 1 + > 3 files changed, 6 insertions(+) > >diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits >index e9313205550..502032787bd 100644 >--- a/libstdc++-v3/include/std/type_traits >+++ b/libstdc++-v3/include/std/type_traits >@@ -3239,7 +3239,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// std::is_invocable > template > struct is_invocable >+#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable) >+ : public __bool_constant<__is_invocable(_Fn, _ArgTypes...)> >+#else > : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type >+#endif > { > static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}), > "_Fn must be a complete class or an unbounded array"); >diff --git a/libstdc++-v3/testsuite/20_util/is_invocable/incomplete_args_neg.cc b/libstdc++-v3/testsuite/20_util/is_invocable/incomplete_args_neg.cc >index a575750f9e9..9619129b817 100644 >--- a/libstdc++-v3/testsuite/20_util/is_invocable/incomplete_args_neg.cc >+++ b/libstdc++-v3/testsuite/20_util/is_invocable/incomplete_args_neg.cc >@@ -18,6 +18,7 @@ > // . > > // { dg-error "must be a complete class" "" { target *-*-* } 0 } >+// { dg-prune-output "invalid use of incomplete type" } > > #include > >diff --git a/libstdc++-v3/testsuite/20_util/is_invocable/incomplete_neg.cc b/libstdc++-v3/testsuite/20_util/is_invocable/incomplete_neg.cc >index 05848603555..b478ebce815 100644 >--- a/libstdc++-v3/testsuite/20_util/is_invocable/incomplete_neg.cc >+++ b/libstdc++-v3/testsuite/20_util/is_invocable/incomplete_neg.cc >@@ -18,6 +18,7 @@ > // . > > // { dg-error "must be a complete class" "" { target *-*-* } 0 } >+// { dg-prune-output "invalid use of incomplete type" } > > #include > >-- >2.44.0 >