Re: Re: [PATCH 08/14] libstdc++: Optimize std::is_compound compilation performance

2024-01-10 Thread Ken Matsui
On 01-10 (21:21), Jonathan Wakely wrote:
> On Wed, 10 Jan 2024 at 19:41, Ken Matsui  wrote:
> >
> > This patch optimizes the compilation performance of std::is_compound
> > by dispatching to the new __is_arithmetic built-in trait.
> 
> OK for trunk (no need to wait for anything else to be approved).
> 
Thank you for your all reviews!  This commit message is not quite accurate,
so I will update it before committing.

> >
> > libstdc++-v3/ChangeLog:
> >
> > * include/std/type_traits (is_compound): Do not use __not_.
> > (is_compound_v): Use is_fundamental_v instead.
> >
> > Signed-off-by: Ken Matsui 
> > ---
> >  libstdc++-v3/include/std/type_traits | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libstdc++-v3/include/std/type_traits 
> > b/libstdc++-v3/include/std/type_traits
> > index 1c560d97e85..6294f5af533 100644
> > --- a/libstdc++-v3/include/std/type_traits
> > +++ b/libstdc++-v3/include/std/type_traits
> > @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >/// is_compound
> >template
> >  struct is_compound
> > -: public __not_>::type { };
> > +: public __bool_constant::value> { };
> >
> >/// is_member_pointer
> >  #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
> > @@ -3358,7 +3358,7 @@ template 
> >  template 
> >inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
> >  template 
> > -  inline constexpr bool is_compound_v = is_compound<_Tp>::value;
> > +  inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
> >
> >  #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
> >  template 
> > --
> > 2.43.0
> >
> 


Re: [PATCH 08/14] libstdc++: Optimize std::is_compound compilation performance

2024-01-10 Thread Jonathan Wakely
On Wed, 10 Jan 2024 at 19:41, Ken Matsui  wrote:
>
> This patch optimizes the compilation performance of std::is_compound
> by dispatching to the new __is_arithmetic built-in trait.

OK for trunk (no need to wait for anything else to be approved).

>
> libstdc++-v3/ChangeLog:
>
> * include/std/type_traits (is_compound): Do not use __not_.
> (is_compound_v): Use is_fundamental_v instead.
>
> Signed-off-by: Ken Matsui 
> ---
>  libstdc++-v3/include/std/type_traits | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/include/std/type_traits 
> b/libstdc++-v3/include/std/type_traits
> index 1c560d97e85..6294f5af533 100644
> --- a/libstdc++-v3/include/std/type_traits
> +++ b/libstdc++-v3/include/std/type_traits
> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>/// is_compound
>template
>  struct is_compound
> -: public __not_>::type { };
> +: public __bool_constant::value> { };
>
>/// is_member_pointer
>  #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
> @@ -3358,7 +3358,7 @@ template 
>  template 
>inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
>  template 
> -  inline constexpr bool is_compound_v = is_compound<_Tp>::value;
> +  inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
>
>  #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
>  template 
> --
> 2.43.0
>



[PATCH 08/14] libstdc++: Optimize std::is_compound compilation performance

2024-01-10 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_compound
by dispatching to the new __is_arithmetic built-in trait.

libstdc++-v3/ChangeLog:

* include/std/type_traits (is_compound): Do not use __not_.
(is_compound_v): Use is_fundamental_v instead.

Signed-off-by: Ken Matsui 
---
 libstdc++-v3/include/std/type_traits | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/std/type_traits 
b/libstdc++-v3/include/std/type_traits
index 1c560d97e85..6294f5af533 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_compound
   template
 struct is_compound
-: public __not_>::type { };
+: public __bool_constant::value> { };
 
   /// is_member_pointer
 #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
@@ -3358,7 +3358,7 @@ template 
 template 
   inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
 template 
-  inline constexpr bool is_compound_v = is_compound<_Tp>::value;
+  inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
 
 #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
 template 
-- 
2.43.0