From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00641c01.pphosted.com (mx0b-00641c01.pphosted.com [205.220.177.146]) by sourceware.org (Postfix) with ESMTPS id DD45B3858D3C; Sat, 23 Dec 2023 21:36:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD45B3858D3C 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 DD45B3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.177.146 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703367365; cv=none; b=R1zXmhTbeBHcUCYWji9eGFzmBpafBFWHiLff9k+FS+klh0dJoJi+krfwWP7jD5LY3fjCe1lXHGWhrE8+ZiBmcZx/BMmrdLC6a0GQmlHSR47Tz+AbSYURwjtT/QIy4UssIrXgf4A3ClWmJ6A5yIkFNCWv/mwARQpiNXt1YmvaXLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703367365; c=relaxed/simple; bh=GmUZ/I+hxhnyIKJFire0XuGHRCiKEODV7OqXhkmFoHE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=jr5TRtq8Smau3iXiDWoL7UsWy6qYXYfxNGDjymfqgfrrmhvHSt/iHUPHGupw/kHS1EdFib3Ysv0srGmPNQIVj/KGucVUITl5I3kQUAhrt6SF7OTVUbVxBMWUHlKa0JFhrEB9xLfLte/DvfDFw65BQTUDMLwNjok9EvrYgQkksLg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0247476.ppops.net [127.0.0.1]) by mx0a-00641c01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BNLSOfM027825; Sat, 23 Dec 2023 21:36:03 GMT Received: from mxout24.cac.washington.edu (mxout24.cac.washington.edu [140.142.234.158]) by mx0a-00641c01.pphosted.com (PPS) with ESMTPS id 3v5r01k4ar-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 23 Dec 2023 21:36:02 +0000 Received: from smtp.washington.edu (smtp.washington.edu [128.208.60.54]) by mxout24.cac.washington.edu (8.14.4+UW20.07/8.14.4+UW22.04) with ESMTP id 3BNLZnLg023192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 23 Dec 2023 13:35:49 -0800 X-Auth-Received: from kmatsui-ThinkPad-X1-Carbon-Gen-9.dhcp4.washington.edu ([10.154.74.194]) (authenticated authid=kmatsui) by smtp.washington.edu (8.16.1+UW21.10/8.14.4+UW19.10) with ESMTPSA id 3BNLZnnQ027526 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 23 Dec 2023 13:35:49 -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 0/8] Optimize more type traits Date: Sat, 23 Dec 2023 13:20:25 -0800 Message-ID: <20231223213542.448971-1-kmatsui@gcc.gnu.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: Hq6euM7y1dJXxTKSwzT5gDqZavcHmtSV X-Proofpoint-ORIG-GUID: Hq6euM7y1dJXxTKSwzT5gDqZavcHmtSV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-23_10,2023-12-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=231 adultscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 clxscore=1034 lowpriorityscore=0 phishscore=0 spamscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312230170 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NEUTRAL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This patch series implements __is_const, __is_volatile, __is_pointer, and __is_unbounded_array built-in traits, which were isolated from my previous patch series "Optimize type traits compilation performance" because they contained performance regression. I confirmed that this patch series does not cause any performance regression. The main reason of the performance regression were the exhaustiveness of the benchmarks and the instability of the benchmark results. Here are new benchmark results: is_const: https://github.com/ken-matsui/gcc-bench/blob/main/is_const.md#sat-dec-23-090605-am-pst-2023 time: -4.36603%, peak memory: -0.300891%, total memory: -0.247934% is_volatile_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_volatile_v.md#sat-dec-23-091518-am-pst-2023 time: -4.06816%, peak memory: -0.609298%, total memory: -0.659134% is_pointer: https://github.com/ken-matsui/gcc-bench/blob/main/is_pointer.md#sat-dec-23-124903-pm-pst-2023 time: -2.47124%, peak memory: -2.98207%, total memory: -4.0811% is_unbounded_array_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_unbounded_array_v.md#sat-dec-23-010046-pm-pst-2023 time: -1.50025%, peak memory: -1.07386%, total memory: -2.32394% Ken Matsui (8): c++: Implement __is_const built-in trait libstdc++: Optimize std::is_const compilation performance c++: Implement __is_volatile built-in trait libstdc++: Optimize std::is_volatile compilation performance c++: Implement __is_pointer built-in trait libstdc++: Optimize std::is_pointer compilation performance c++: Implement __is_unbounded_array built-in trait libstdc++: Optimize std::is_unbounded_array compilation performance gcc/cp/constraint.cc | 12 +++ gcc/cp/cp-trait.def | 4 + gcc/cp/semantics.cc | 16 ++++ gcc/testsuite/g++.dg/ext/has-builtin-1.C | 12 +++ gcc/testsuite/g++.dg/ext/is_const.C | 19 +++++ gcc/testsuite/g++.dg/ext/is_pointer.C | 51 +++++++++++++ gcc/testsuite/g++.dg/ext/is_unbounded_array.C | 37 ++++++++++ gcc/testsuite/g++.dg/ext/is_volatile.C | 19 +++++ libstdc++-v3/include/bits/cpp_type_traits.h | 29 ++++++++ libstdc++-v3/include/std/type_traits | 73 +++++++++++++++++-- 10 files changed, 264 insertions(+), 8 deletions(-) create mode 100644 gcc/testsuite/g++.dg/ext/is_const.C create mode 100644 gcc/testsuite/g++.dg/ext/is_pointer.C create mode 100644 gcc/testsuite/g++.dg/ext/is_unbounded_array.C create mode 100644 gcc/testsuite/g++.dg/ext/is_volatile.C -- 2.43.0