[0/2] Optimize is_member_pointer trait performance

Message ID 20230912044638.14504-1-kmatsui@gcc.gnu.org
Headers
Series Optimize is_member_pointer trait performance |

Message

Ken Matsui Sept. 12, 2023, 4:26 a.m. UTC
  This patch series optimizes is_member_pointer trait
performance. The first patch implements __is_member_pointer
built-in trait. The second patch optimizes is_member_pointer
trait performance by using __is_member_pointer built-in trait
if available.

The performance improvement is shown in the following benchmark:

https://github.com/ken-matsui/gsoc23/blob/main/is_member_pointer_v.md#mon-sep-11-092927-pm-pdt-2023

Time: -47.2037% +/- 2.12936%
Peak Memory Usage: -39.4183% +/- 0.00217276%
Total Memory Usage: -41.9905% +/- 0%

Ken Matsui (2):
  c++: Implement __is_member_pointer built-in trait
  libstdc++: Optimize is_member_pointer trait performance

 gcc/cp/constraint.cc                         |  3 ++
 gcc/cp/cp-trait.def                          |  1 +
 gcc/cp/semantics.cc                          |  4 +++
 gcc/testsuite/g++.dg/ext/has-builtin-1.C     |  3 ++
 gcc/testsuite/g++.dg/ext/is_member_pointer.C | 30 ++++++++++++++++++++
 libstdc++-v3/include/std/type_traits         | 16 ++++++++++-
 6 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/g++.dg/ext/is_member_pointer.C