From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 456F5386C58E for ; Wed, 10 Jan 2024 21:22:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 456F5386C58E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 456F5386C58E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704921735; cv=none; b=Oxon81cN/hUD22io4FEYGUxNmSQl/CSVcO9jLgHjKqqIFA/TLZgpKGPXJDd6M4Qu0CuzIon7ka2/7GeB42QVtajJIPtO0K9bUPdRGDWwouq/YIyv5hfWsE6o6c0UBYjudEvGqZKaOV6WhQRSDjWNfioDSNeuUGGUvxB68QZ1mHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704921735; c=relaxed/simple; bh=jgYR8F2beeRSQM2qQUmQtNQ8hpKdD10J057t9nZMc7k=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=eBULyWBygq29WVsVu3xwdJf1vX9a1Qw9zvyAQvshRKyx01dIcqn6CUpEbOILf3C3a4hxjVQjubPFyOx1hZosZZCqUk5QV/X3JvKfIQ6jCXZok31KMsp+WXekFtTzyJ4A+Sa6cS5p/Iemt5LDrQOU8lT4kWjuveUBRA7SXTzlH/o= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704921734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QkmmZULqe+551QXyuyeiECDdnJ+w1qxsyAqXXKaxMrc=; b=RFNbi86FBQVfIter6psvXlGxCRst2zA9irHS0+HrtTaZeurd2tcn/ydmCEnq3EGVFSScZ4 RvBYs4CCnQfeYLsnZ/Eac2FoFsbti+XmZ6eEMvQEf9cj9KmXFeg44erux8kawiejCF3Trk OilM1uJEpBtisF0ng+pnfSY43q+THjY= Received: from mail-yb1-f197.google.com (mail-yb1-f197.google.com [209.85.219.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-oyVLutP2P8ufGAbfNLkmZQ-1; Wed, 10 Jan 2024 16:22:13 -0500 X-MC-Unique: oyVLutP2P8ufGAbfNLkmZQ-1 Received: by mail-yb1-f197.google.com with SMTP id 3f1490d57ef6-dbf3d102221so150031276.1 for ; Wed, 10 Jan 2024 13:22:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704921732; x=1705526532; h=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=QkmmZULqe+551QXyuyeiECDdnJ+w1qxsyAqXXKaxMrc=; b=V6LBdYs+aUJFAy57Md41BHw2dJGls9lv3x2Jzf8fWLF1e4MoENEwcnSww++rPQeZhb me1KlUNhmGzi/uCyK4s3g8YbSuW8AhOtunYv+uQyJnFKRERSzJ4eWp2BPfX1kY88ZK/p kmA40KiibbeFIf2b9ShgyYAsowGg0qOLQSq/+svoA2Pc/ymvDHbTVBn1B4EEXJL2C8z9 kdEMgY3v2apmYV/1JmkFShvvOjmmBKMcnj2ekIbY1j0Hwgt3GXGH4jusht5FHYZlnkfW PhJ84Jtj6cZQpidhgQDH8AXpKHqJbgeFNokpBH/6uTE7xoHsiPhaXOqgjZQl2Ytu9Saq fKyA== X-Gm-Message-State: AOJu0YxLgfe7zy0t8ybqouVxFE6rMSVbwR3hPPtHLVe6TwF1BfoERLEL 3L9G0mHoMqaolon8H4uDQR7ymT2412se2Cc+8hVOO/s1n9JvS10pl+Gf6bGK1rYAnZgNuEtY0Mu Ffk4yLO4+un82l2ZPHJbJb5c3g86l3f8j3ko2KvgcwQ== X-Received: by 2002:a5b:c0e:0:b0:dbe:a5b7:a8dc with SMTP id f14-20020a5b0c0e000000b00dbea5b7a8dcmr231760ybq.106.1704921732166; Wed, 10 Jan 2024 13:22:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYjFf7UEcEFhh+6H1bxs5a+y7t+6+eJdD6eekUdwa/7ZLIg896WLU43dq02XC/+8cL6ePtzbugBgRltSQjASs= X-Received: by 2002:a5b:c0e:0:b0:dbe:a5b7:a8dc with SMTP id f14-20020a5b0c0e000000b00dbea5b7a8dcmr231748ybq.106.1704921731873; Wed, 10 Jan 2024 13:22:11 -0800 (PST) MIME-Version: 1.0 References: <20240110194031.2384005-1-kmatsui@gcc.gnu.org> <20240110194031.2384005-9-kmatsui@gcc.gnu.org> In-Reply-To: <20240110194031.2384005-9-kmatsui@gcc.gnu.org> From: Jonathan Wakely Date: Wed, 10 Jan 2024 21:21:56 +0000 Message-ID: Subject: Re: [PATCH 08/14] libstdc++: Optimize std::is_compound compilation performance To: Ken Matsui Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-15.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 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 >