From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) by sourceware.org (Postfix) with ESMTPS id B4C083856975 for ; Tue, 24 Oct 2023 02:07:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B4C083856975 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.washington.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.washington.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B4C083856975 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::936 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698113269; cv=none; b=BmzYefmnUt/Jaj+R6t/5CisRwLU9R9iJdSTYwEqbIzv0RY9JtClLUqv2Vbru0RecO7Qf45kj3fYo2gf+3w7C7Y9Ii+1j5J0jpK5fi9d4Sl4/aWVyKWpQbE8h3Ky5ap0Dld0VZORYMniNJsgyoKadFAYHVNLJY9g/6r9kgSdV7yA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698113269; c=relaxed/simple; bh=yzxsm5d6fCeDd53SenMsNaJSxhD/LoKpoaNiwfUsSl8=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=XRQ8jLGtjEsKVIEK34qKeD6uZvluCxZjf76wmOW63LVRbXk4lmn0AstRFUFnMrg1WxVp2P98rskP1c7dHKMZ2IP1GysKxIM4tzrpIJGGAG9hBKN7fng0bBNBUxD8NjwUmjJPXtXtCnDwQWs7iyBCbC91NVyfhO+7X+SxFrs5lRA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-7afc13d58c6so1545038241.1 for ; Mon, 23 Oct 2023 19:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1698113266; x=1698718066; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mHmGemtOFLI8MN+xMKgNfvnVJOdBGKOMLwbi+jOAjvw=; b=CLP+86DFTmUp5qgvRsyWomisdq7BnusuRnYN6WPVFPEcK3Xhe9nsqqbodVNgWd8bWO 6P7smrUX8Nnt/FL0IasP+ryoVT7I3qBTTdkogG2t9zvHB7zp6RlMQYEUZXYZomjbRXWU 5t3G8u5aZWUUdDROkJ6Z8rYdnuxMNtYoVTOSI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698113266; x=1698718066; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mHmGemtOFLI8MN+xMKgNfvnVJOdBGKOMLwbi+jOAjvw=; b=b0qLKa7x3Hw1aYgipZ2cEWU55CF32gFJH1FgX8FDxup3IG8suyX0mC82Ir+REa+RUE 2u5Lp/xHex3l/TXU9Mjps5rlrVOuZjucSS5u8xUDwsc11UbccTlYOt+Wa5EhghFa4KJc 1Zs/WZOqD/jCTjsj2wvlRDk+MmyFODkyXSh6pDnyBIPxr4W93KbaJ7q7bYIIndLyARjE PV7TfO7iyNzwg8bDBUGMqsoruLMyLyrwChHle1cERcpTfxslTepHKY6AqqSRfFC42QCW WC8+rDtqLyfGQTR4rYQ53GPOHCPw1LwF6jVpXo5qoQ/3jDKMNKWZxfO146mj3jWCK1nX PHHQ== X-Gm-Message-State: AOJu0Yx+qjy6TsSg7855QtQuDeUU0ftEVANln5C+wRQYA5SMFFPmwpZu txnmIbfLmgDVW+SnUKCOiJdNZA323eNlQ/1utEdeZA== X-Google-Smtp-Source: AGHT+IGP8YnwPalcersEBQU1kMfYxWAXh5R2iZh4qpCwo6hKJg6nk2tiCZGq4dlTPQVPolpaXHliGff8eilb0JjCg44= X-Received: by 2002:a67:a405:0:b0:452:b96c:313b with SMTP id n5-20020a67a405000000b00452b96c313bmr10278029vse.13.1698113265967; Mon, 23 Oct 2023 19:07:45 -0700 (PDT) MIME-Version: 1.0 References: <20231020162115.2307797-1-kmatsui@gcc.gnu.org> <20231024020424.699427-1-kmatsui@gcc.gnu.org> In-Reply-To: <20231024020424.699427-1-kmatsui@gcc.gnu.org> From: Ken Matsui Date: Mon, 23 Oct 2023 19:07:09 -0700 Message-ID: Subject: Re: [PATCH v25 00/33] Optimize type traits compilation performance To: Ken Matsui Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: I accidentally sent is_invocable patches as well, but those have no changes= . On Mon, Oct 23, 2023 at 7:04=E2=80=AFPM Ken Matsui wr= ote: > > This patch series optimizes type traits compilation performance by > implementing built-in type traits and using them in libstdc++. > > Changes in v25: > > * Optimized the __is_pointer implementation in cpp_type_traits.h. > * Fix compilation error in cpp_type_traits.h with Clang 16. > * Wrapped commit messages at 75 columns. > * Used & instead of && for the new IDENTIFIER_TRAIT_P macro. > * Made cp_lexer_peek_trait not to take cp_token. > * Fixed indentation error in cp_lexer_peek_trait. > > Changes in v24: > > * Fixed the way to handle an incomplete type error from __is_invo= cable > in the test cases so that we can correctly test both the use of > built-in and vice-versa. > > Changes in v23: > > * Improved the comment in cp-tree.h. > * Moved the definition of cp_traits to lex.cc from parser.cc. > * Implemented __is_invocable built-in trait. > > Changes in v22: > > * Included a missing patch in v21. > > Changes in v21: > > * Used _GLIBCXX_USE_BUILTIN_TRAIT instead of __has_builtin in > cpp_type_traits.h. > * Added const char* name to struct cp_trait, and loop over cp_tra= its > in init_cp_traits to get the name. > * Isolated patches for integral-related built-in traits from > this patch series since they are not ready for review yet. > * Implemented __is_object built-in trait. > > Changes in v20: > > * Used identifier node instead of gperf to look up built-in > traits. > > Changes in v19: > > * Fixed a typo. > * Rebased on top of trunk. > * Improved clarity of the commit message. > > Changes in v18: > > * Removed all RID values for built-in traits and used cik_trait > instead. > * Improved to handle the use of non-function-like built-in trait > identifiers. > * Reverted all changes to conflicted identifiers with new built-i= ns > in the existing code base. > > Changes in v17: > > * Rebased on top of trunk. > * Improved clarity of the commit message. > * Simplified Make-lang.in. > * Made ridpointers for RID_TRAIT_EXPR and RID_TRAIT_TYPE empty. > > Changes in v16: > > * Rebased on top of trunk. > * Improved clarity of the commit message. > * Simplified Make-lang.in and gperf struct. > * Supply -k option to gperf to support older versions than 2.8. > > Changes in v15: > > * Rebased on top of trunk. > * Use gperf to look up traits instead of enum rid. > > Changes in v14: > > * Added padding calculation to the commit message. > > Changes in v13: > > * Fixed ambiguous commit message and comment. > > Changes in v12: > > * Evaluated all paddings affected by the enum rid change. > > Changes in v11: > > * Merged all patches into one patch series. > * Rebased on top of trunk. > * Unified commit message style. > * Used _GLIBCXX_USE_BUILTIN_TRAIT. > > Ken Matsui (33): > c++: Sort built-in traits alphabetically > c-family, c++: Look up built-in traits via identifier node > c++: Accept the use of built-in trait identifiers > c++: Implement __is_const built-in trait > libstdc++: Optimize std::is_const compilation performance > c++: Implement __is_volatile built-in trait > libstdc++: Optimize std::is_volatile compilation performance > c++: Implement __is_array built-in trait > libstdc++: Optimize std::is_array compilation performance > c++: Implement __is_unbounded_array built-in trait > libstdc++: Optimize std::is_unbounded_array compilation performance > c++: Implement __is_bounded_array built-in trait > libstdc++: Optimize std::is_bounded_array compilation performance > c++: Implement __is_scoped_enum built-in trait > libstdc++: Optimize std::is_scoped_enum compilation performance > c++: Implement __is_member_pointer built-in trait > libstdc++: Optimize std::is_member_pointer compilation performance > c++: Implement __is_member_function_pointer built-in trait > libstdc++: Optimize std::is_member_function_pointer compilation > performance > c++: Implement __is_member_object_pointer built-in trait > libstdc++: Optimize std::is_member_object_pointer compilation > performance > c++: Implement __is_reference built-in trait > libstdc++: Optimize std::is_reference compilation performance > c++: Implement __is_function built-in trait > libstdc++: Optimize std::is_function compilation performance > c++: Implement __is_object built-in trait > libstdc++: Optimize std::is_object compilation performance > c++: Implement __remove_pointer built-in trait > libstdc++: Optimize std::remove_pointer compilation performance > c++: Implement __is_pointer built-in trait > libstdc++: Optimize std::is_pointer compilation performance > c++: Implement __is_invocable built-in trait > libstdc++: Optimize std::is_invocable compilation performance > > gcc/c-family/c-common.cc | 7 - > gcc/c-family/c-common.h | 5 - > gcc/cp/constraint.cc | 109 ++++-- > gcc/cp/cp-objcp-common.cc | 8 +- > gcc/cp/cp-trait.def | 25 +- > gcc/cp/cp-tree.h | 32 +- > gcc/cp/lex.cc | 34 ++ > gcc/cp/method.h | 28 ++ > gcc/cp/parser.cc | 120 ++++--- > gcc/cp/semantics.cc | 284 ++++++++++++--- > gcc/testsuite/g++.dg/ext/has-builtin-1.C | 113 ++++-- > gcc/testsuite/g++.dg/ext/is_array.C | 28 ++ > gcc/testsuite/g++.dg/ext/is_bounded_array.C | 38 ++ > gcc/testsuite/g++.dg/ext/is_const.C | 19 + > gcc/testsuite/g++.dg/ext/is_function.C | 58 +++ > gcc/testsuite/g++.dg/ext/is_invocable1.C | 337 ++++++++++++++++++ > gcc/testsuite/g++.dg/ext/is_invocable2.C | 139 ++++++++ > gcc/testsuite/g++.dg/ext/is_invocable3.C | 51 +++ > gcc/testsuite/g++.dg/ext/is_invocable4.C | 33 ++ > .../g++.dg/ext/is_member_function_pointer.C | 31 ++ > .../g++.dg/ext/is_member_object_pointer.C | 30 ++ > gcc/testsuite/g++.dg/ext/is_member_pointer.C | 30 ++ > gcc/testsuite/g++.dg/ext/is_object.C | 29 ++ > gcc/testsuite/g++.dg/ext/is_pointer.C | 51 +++ > gcc/testsuite/g++.dg/ext/is_reference.C | 34 ++ > gcc/testsuite/g++.dg/ext/is_scoped_enum.C | 67 ++++ > gcc/testsuite/g++.dg/ext/is_unbounded_array.C | 37 ++ > gcc/testsuite/g++.dg/ext/is_volatile.C | 19 + > gcc/testsuite/g++.dg/ext/remove_pointer.C | 51 +++ > libstdc++-v3/include/bits/cpp_type_traits.h | 29 ++ > libstdc++-v3/include/std/type_traits | 219 +++++++++++- > .../is_invocable/incomplete_args_neg.cc | 1 + > .../20_util/is_invocable/incomplete_neg.cc | 1 + > 33 files changed, 1901 insertions(+), 196 deletions(-) > create mode 100644 gcc/cp/method.h > create mode 100644 gcc/testsuite/g++.dg/ext/is_array.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_bounded_array.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_const.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_function.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_invocable1.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_invocable2.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_invocable3.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_invocable4.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_member_function_pointer.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_member_object_pointer.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_member_pointer.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_object.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_pointer.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_reference.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_scoped_enum.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_unbounded_array.C > create mode 100644 gcc/testsuite/g++.dg/ext/is_volatile.C > create mode 100644 gcc/testsuite/g++.dg/ext/remove_pointer.C > > -- > 2.42.0 >