From patchwork Thu Feb 15 15:20:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Matsui X-Patchwork-Id: 1899453 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=rwls2dFb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TbJqb4ZH3z23j4 for ; Fri, 16 Feb 2024 02:28:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 930BE38654B5 for ; Thu, 15 Feb 2024 15:28:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 930BE38654B5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708010905; bh=bhLIroQpfQRMMmEh8w1SQkSn8meTZCDKfX7V6LeIOQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rwls2dFbut2VmZCqRKCMpXQEJS0GiLKWC8P+kyg17/OII5WIHqRcG6K6FKPduZT48 PkkvJiwrd6eLqR8ymcg7/gKuQHl4nwyMj5j4BkjUrJUvz400rL7kcxDhPf8AdS5vOy mIr86iJSHUXVtnvnhxyMUC3xBNLdC3ODWH/u01mI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00641c01.pphosted.com (mx0a-00641c01.pphosted.com [205.220.165.146]) by sourceware.org (Postfix) with ESMTPS id AE36E3865C28; Thu, 15 Feb 2024 15:21:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AE36E3865C28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gcc.gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AE36E3865C28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.165.146 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708010483; cv=none; b=Nhk/CHR4qS5BvTFWORqyFNoQu3g4IyxSXIUoPkNXtp/x3XguSArdPGD+Kpbu5kD32MAoIZvYyBT8ERScUaxhKg0w3F9JnaoUL31rKjfi2NY7CNzJY7F8GwbQIAlfA2psjiKoCP5SdCPTr8vkX7VuvPVEtkCn8F6Rn2VharOld44= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708010483; c=relaxed/simple; bh=YsIlhNgET1sj/t8gOptVc4RjRONQSkiZ59dCfMwaZeo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=LUUBzVGKzYj3LIC1j36hT4iuiqHj9kdF2IXVDGwFc5ez1D8SXHn64WG2HC9IWjc1NeWhVZpo3dwBwMy3z5XA3E8WyFfOlSW4B/BuiiqDer8udxqql8xP9fMLr795Uxdt9QwKgkQqELx3Vh7lIT/CbOXFKoXOCC7+MzeQquiLczQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0247472.ppops.net [127.0.0.1]) by mx0a-00641c01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41FFEx5K002315; Thu, 15 Feb 2024 15:21:09 GMT Received: from mxout25.s.uw.edu (mxout25.s.uw.edu [140.142.234.175]) by mx0a-00641c01.pphosted.com (PPS) with ESMTPS id 3w98pqbbey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 15:21:09 +0000 Received: from smtp.washington.edu (smtp.washington.edu [140.142.234.157]) by mxout25.s.uw.edu (8.14.4+UW20.07/8.14.4+UW24.02) with ESMTP id 41FFKlkL030364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 07:20:47 -0800 X-Auth-Received: from kmatsui-ThinkPad-X1-Carbon-Gen-9.dhcp4.washington.edu ([10.154.74.143]) (authenticated authid=kmatsui) by smtp.washington.edu (8.16.1+UW21.10/8.14.4+UW24.02) with ESMTPSA id 41FFKkgo029956 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 07:20:47 -0800 X-UW-Orig-Sender: kmatsui@smtp.washington.edu From: Ken Matsui To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Ken Matsui Subject: [PATCH v5 04/14] libstdc++: Optimize std::remove_extent compilation performance Date: Thu, 15 Feb 2024 07:20:27 -0800 Message-ID: <20240215152037.720162-4-kmatsui@gcc.gnu.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240215152037.720162-1-kmatsui@gcc.gnu.org> References: <20240215045258.3025806-1-kmatsui@gcc.gnu.org> <20240215152037.720162-1-kmatsui@gcc.gnu.org> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: kv54N8qXCacyOvd0MUWq7psluIDffZkS X-Proofpoint-GUID: kv54N8qXCacyOvd0MUWq7psluIDffZkS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_14,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 priorityscore=1501 phishscore=0 mlxlogscore=606 malwarescore=0 clxscore=1034 suspectscore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150123 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org This patch optimizes the compilation performance of std::remove_extent by dispatching to the new __remove_extent built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_extent): Use __remove_extent built-in trait. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_traits | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 3bde7cb8ba3..0fb1762186c 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2064,6 +2064,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Array modifications. /// remove_extent +#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_extent) + template + struct remove_extent + { using type = __remove_extent(_Tp); }; +#else template struct remove_extent { using type = _Tp; }; @@ -2075,6 +2080,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct remove_extent<_Tp[]> { using type = _Tp; }; +#endif /// remove_all_extents template