[v14,00/40] Optimize type traits performance

Message ID 20230915235353.19378-1-kmatsui@gcc.gnu.org
Headers
Series Optimize type traits performance |

Message

Ken Matsui Sept. 15, 2023, 11:50 p.m. UTC
  This patch series optimizes type traits performance by implementing
built-in type traits and using them in libstdc++.

Changes in v14:

	* Attached the benchmark results of the enum rid change

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 (40):
  c++: Sort built-in identifiers alphabetically
  c++: Implement __is_const built-in trait
  libstdc++: Optimize is_const trait performance
  c++: Implement __is_volatile built-in trait
  libstdc++: Optimize is_volatile trait performance
  c++: Implement __is_array built-in trait
  libstdc++: Optimize is_array trait performance
  c++: Implement __is_unbounded_array built-in trait
  libstdc++: Optimize is_unbounded_array trait performance
  c++: Implement __is_bounded_array built-in trait
  libstdc++: Optimize is_bounded_array trait performance
  c++: Implement __is_scoped_enum built-in trait
  libstdc++: Optimize is_scoped_enum trait performance
  c++: Implement __is_member_pointer built-in trait
  libstdc++: Optimize is_member_pointer trait performance
  c, c++: Use 16 bits for all use of enum rid for more keyword space
  c-family: Fix C_SET_RID_CODE to handle 16-bit rid code correctly
  c++: Implement __is_member_function_pointer built-in trait
  libstdc++: Optimize is_member_function_pointer trait performance
  c++: Implement __is_member_object_pointer built-in trait
  libstdc++: Optimize is_member_object_pointer trait performance
  c++: Implement __is_reference built-in trait
  libstdc++: Optimize is_reference trait performance
  c++: Implement __is_function built-in trait
  libstdc++: Optimize is_function trait performance
  libstdc++: Optimize is_object trait performance
  c++: Implement __remove_pointer built-in trait
  libstdc++: Optimize remove_pointer trait performance
  c++, libstdc++: Implement __is_pointer built-in trait
  libstdc++: Optimize is_pointer trait performance
  c++, libstdc++: Implement __is_arithmetic built-in trait
  libstdc++: Optimize is_arithmetic trait performance
  libstdc++: Optimize is_fundamental trait performance
  libstdc++: Optimize is_compound trait performance
  c++: Implement __is_unsigned built-in trait
  libstdc++: Optimize is_unsigned trait performance
  c++, libstdc++: Implement __is_signed built-in trait
  libstdc++: Optimize is_signed trait performance
  c++, libstdc++: Implement __is_scalar built-in trait
  libstdc++: Optimize is_scalar trait performance

 gcc/c-family/c-common.h                       |   2 +-
 gcc/c-family/c-indentation.h                  |   2 +-
 gcc/c/c-parser.cc                             |   6 +-
 gcc/c/c-parser.h                              |  14 +-
 gcc/cp/constraint.cc                          | 112 +++++--
 gcc/cp/cp-trait.def                           |  27 +-
 gcc/cp/parser.h                               |   8 +-
 gcc/cp/semantics.cc                           | 157 +++++++---
 gcc/testsuite/g++.dg/ext/has-builtin-1.C      | 117 ++++++--
 gcc/testsuite/g++.dg/ext/is_arithmetic.C      |  33 ++
 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 ++++
 .../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_pointer.C         |  51 ++++
 gcc/testsuite/g++.dg/ext/is_reference.C       |  34 +++
 gcc/testsuite/g++.dg/ext/is_scalar.C          |  31 ++
 gcc/testsuite/g++.dg/ext/is_scoped_enum.C     |  67 +++++
 gcc/testsuite/g++.dg/ext/is_signed.C          |  47 +++
 gcc/testsuite/g++.dg/ext/is_unbounded_array.C |  37 +++
 gcc/testsuite/g++.dg/ext/is_unsigned.C        |  47 +++
 gcc/testsuite/g++.dg/ext/is_volatile.C        |  19 ++
 gcc/testsuite/g++.dg/ext/remove_pointer.C     |  51 ++++
 gcc/testsuite/g++.dg/tm/pr46567.C             |  48 +--
 gcc/testsuite/g++.dg/torture/20070621-1.C     |   4 +-
 gcc/testsuite/g++.dg/torture/pr57107.C        |   8 +-
 libcpp/include/cpplib.h                       |   7 +-
 libstdc++-v3/include/bits/charconv.h          |   2 +-
 libstdc++-v3/include/bits/cpp_type_traits.h   |  18 +-
 libstdc++-v3/include/bits/deque.tcc           |   6 +-
 libstdc++-v3/include/bits/locale_facets.tcc   |   6 +-
 libstdc++-v3/include/bits/stl_algobase.h      |  14 +-
 libstdc++-v3/include/bits/uniform_int_dist.h  |   4 +-
 libstdc++-v3/include/bits/valarray_array.h    |   2 +-
 libstdc++-v3/include/c_global/cmath           |  48 +--
 libstdc++-v3/include/c_std/cmath              |  24 +-
 libstdc++-v3/include/ext/numeric_traits.h     |  18 +-
 libstdc++-v3/include/std/type_traits          | 284 ++++++++++++++++--
 libstdc++-v3/include/tr1/cmath                |  24 +-
 42 files changed, 1356 insertions(+), 257 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/ext/is_arithmetic.C
 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_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_pointer.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_reference.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_scalar.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_scoped_enum.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_signed.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_unbounded_array.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_unsigned.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_volatile.C
 create mode 100644 gcc/testsuite/g++.dg/ext/remove_pointer.C