From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by sourceware.org (Postfix) with ESMTPS id B2D84385840B for ; Thu, 23 May 2024 22:16:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2D84385840B 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 B2D84385840B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::e36 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716502593; cv=none; b=dHtiYsc1n4bKsnGue+/PpvijEOyAz21TE3GCLD8TThVqsqq+yAFr4IpqP4vUnIyzjykp2DbWg24myQW6KgAPKriPplbe4nnO5q6GmJY8EQSsdG3YE2Trj/0VVm8ifn1XdvRl4+v3tPx6K/q2ShJytnv/vJtlddn+bpQQdYss2GQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716502593; c=relaxed/simple; bh=SAPb5IY0JXPTMSfCO/XZesrMOt+rMCCbTlZ0pyfsrKk=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=yECjzIRnC4R1NPPcqCCJsf6g56e5lfzxyKBdq+x4EQmqYM0Bmnka372Vdn0jwqF86jlQFbXp53wUYux88NSw2fnLvQoI/0EW/537UMHWzw9fthTJ4INfWINE94y0RDtNUYCtsArX5So93XsSz9xYAgbnbK3igqQzVINwuca16CE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-48a39d4b0f1so66024137.2 for ; Thu, 23 May 2024 15:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1716502591; x=1717107391; 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=CrzyHGJPgCP97P18qDybwIn3VWFf5enTuwAJTSJ4XRU=; b=AEZjM1iKTFOjPLWK1YzqrSaWubMNF9K/u2U3Lf5zA/T/TknUp3WuIhugzgYK7KAtsF rGYRYkk6AtmcFMkFXCYyqhHti5Xk4L+3QxD5gJcM/JaEVkqsyzsvSiU/qJ+ZUsb585Mp c1WeOGUxV2SznV03pMuGITHf83QX9dwiU9V3Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716502591; x=1717107391; 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=CrzyHGJPgCP97P18qDybwIn3VWFf5enTuwAJTSJ4XRU=; b=LWbLXhkBNGkXutOKiXo6Rd1elHja2WD/15kScX1kD83I+xkVPF/6RpltV5tKyB8Pp2 sLfW63G12qVNq0wOJFApjImiLueVG1T2en8FBOoRjtVpxIufotB0FwmUGqykW+5ukFop JePcZ+R0qdXLq2Mz/IozWh7qecop5WLT2xCNLQrCLUHVzxRl8flzB37op8SJ5LAtJU1F keIkgdtMzaU0xbsP/SJZnMRpByX+F7j1fCl22DkIElRf5mqETEUqOvmpweH0S1uVVUlz x7ZzvS9qKNN5uF04Gwd//xnO3qCJu3asQH2U1t2FJZ7jW9yOYE15C49V5EUFXqpi28+N 7+LA== X-Forwarded-Encrypted: i=1; AJvYcCVm2ViAxA5clFuXXlmUC2MkJZvFdH7ZsvSGccix6MuSZlIMqItzI+5ikNKTd883usYXqrRY3cS1lhX8J+2xxzrx4/ocBFk= X-Gm-Message-State: AOJu0YzqgPVsB0PIRhHbD5QEzxX/jgk4ffjpPBqoB5k+w7aNHlONaw+n lbDW9NwCTK5foO8OCWdlITh7mEWKWk4hc3E0/9jDzujO0Tjzr5rg+FkwIteZMknxUm5PBRP5LC7 7yMf03T5iRZI8VsHApP1sX0KCE+o6jGWEA7hn X-Google-Smtp-Source: AGHT+IG29mUyzbbBcLNYxXgClWcwCOt4o4P6EqWL+zu6gfB8WvhO2wk+0DuHyM2ak0Ewbs2CLiaw8lRK4hmB59xXj5w= X-Received: by 2002:a67:b609:0:b0:47f:3557:84fb with SMTP id ada2fe7eead31-48a386d2fe1mr698668137.26.1716502589513; Thu, 23 May 2024 15:16:29 -0700 (PDT) MIME-Version: 1.0 References: <20240510161405.194750-21-kmatsui@gcc.gnu.org> <20240511090130.248174-1-kmatsui@gcc.gnu.org> <21d0a54d-fc61-4782-b314-6626c273ef79@idea> In-Reply-To: <21d0a54d-fc61-4782-b314-6626c273ef79@idea> From: Ken Matsui Date: Thu, 23 May 2024 15:15:53 -0700 Message-ID: Subject: Re: [PATCH v26 01/13] libstdc++: Optimize std::is_const compilation performance To: Patrick Palka Cc: Ken Matsui , 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=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,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: On Thu, May 23, 2024 at 3:15=E2=80=AFPM Patrick Palka w= rote: > > On Sat, 11 May 2024, Ken Matsui wrote: > > > This patch optimizes the compilation performance of std::is_const > > by dispatching to the new __is_const built-in trait. > > This patch series LGTM Thank you! > > > > > libstdc++-v3/ChangeLog: > > > > * include/std/type_traits (is_const): Use __is_const built-in > > trait. > > (is_const_v): Likewise. > > > > Signed-off-by: Ken Matsui > > --- > > libstdc++-v3/include/std/type_traits | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/includ= e/std/type_traits > > index b441bf9908f..8df0cf3ac3b 100644 > > --- a/libstdc++-v3/include/std/type_traits > > +++ b/libstdc++-v3/include/std/type_traits > > @@ -835,6 +835,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > // Type properties. > > > > /// is_const > > +#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const) > > + template > > + struct is_const > > + : public __bool_constant<__is_const(_Tp)> > > + { }; > > +#else > > template > > struct is_const > > : public false_type { }; > > @@ -842,6 +848,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > template > > struct is_const<_Tp const> > > : public true_type { }; > > +#endif > > > > /// is_volatile > > template > > @@ -3331,10 +3338,15 @@ template > > inline constexpr bool is_member_pointer_v =3D is_member_pointer<_Tp>= ::value; > > #endif > > > > +#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const) > > +template > > + inline constexpr bool is_const_v =3D __is_const(_Tp); > > +#else > > template > > inline constexpr bool is_const_v =3D false; > > template > > inline constexpr bool is_const_v =3D true; > > +#endif > > > > #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function) > > template > > -- > > 2.44.0 > > > > >