From patchwork Mon Feb 19 13:51:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Matsui X-Patchwork-Id: 203099 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1295417dyc; Mon, 19 Feb 2024 05:55:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU0uJ8UhIs7Lnig1igP1VFFVNnQ2ckP2KU+zq5BBbOy1djqpXwvyTYuQCH9hn5EsXmxZykCmpigga7FKODL54PE2siGfw== X-Google-Smtp-Source: AGHT+IFj3AGRHBIaEP5vh9j3zIsu8Tq/0QvGO1+1zJPAnExIqxPgkf/5a93RidUFbLp2ru4XwDHB X-Received: by 2002:a81:8706:0:b0:607:dfc7:abd8 with SMTP id x6-20020a818706000000b00607dfc7abd8mr11507995ywf.21.1708350910349; Mon, 19 Feb 2024 05:55:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708350910; cv=pass; d=google.com; s=arc-20160816; b=0wwJb5YuC6ZMPO5Mg+QqZxP51H2fzlMhY+9FrjUykPWoKRHTOlPVWhT0s94gTXw+Sb XvTZMZTAMs6Xr50yLpCOKt1CpfViSpSIpX4rGH5fdMFzakx4yBmk3TAPIYjsvqLmf0/o +7gSTyUyAOONjj5AkgTFdX/5Uh9PXwffP4vHrjUJRQmu5xeSbMKXyz88jMgAP2CBrqpX CWK521SVdnuCOcSWPMxp4aV0ugF/kNJowOidjg99e2FCFnzbFNz5dJm837p2Rxj0k98h i0BHZwce7JVVlpXG6eAjgX89zkU9yxwdCMcBInMDbbkXxW8L5YFoxVoe5w34y2qFTqDz GvUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:arc-filter:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=Tx5ITed+Uh47pQDOHhaKfuf6rkKipYwdxTElZnXyEvg=; fh=kSSy/oyUXqQD15FLeKdymIgDBFPFITPA1Gj52CNOxRQ=; b=R7ykbZLU74oqqpg5KFKK2JqZ/Y409+cwWNMO6C19V+iWRYKu4vVohkKSXS/JDaESSy Nun9i+3m8ZJSBFzKqZFCYt92Ai6ZVg9SaMFXIR088AJA5w+jaJKHKA9r94XGGzVdFhH0 gzftT75CbNhMuFh0C+ddelNMIk/DxMUFx+M599owO0JrXr+MD68IObpBtybsyhUNGJD4 PVIl98/AQ6Rng0+IHt6g127sHS1smZhZRKbTmdhwS2U+/quS2xnU96VnCTZgumQAYr/w TyFy2Pe/WJmW+sEDimb4NnHJwrEa9Sx2WZGcyqYFFncVlnJqEMiBdIWdb0kNpiIokgYZ Dvog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Sz0jEOg0; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v16-20020a05622a131000b0042dfef499d6si4724473qtk.553.2024.02.19.05.55.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 05:55:10 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Sz0jEOg0; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0627638654AD for ; Mon, 19 Feb 2024 13:55:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0627638654AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708350910; bh=Tx5ITed+Uh47pQDOHhaKfuf6rkKipYwdxTElZnXyEvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Sz0jEOg0n4KiDVQft/DEeXeWISpEFOlvB5D8+uqTxxorFBsGYyQ4k5YilSk+xvlqj QOc6WizoLJQ7CgY5udBnygKgtQPI3kqSTrP1AbzJvBlkCfMqnZdZErZpZhoT/Ou8ag jCdDgYYZNtCWqwnEKXlmaqZVoPVaY7x3zNzk3Ypg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00641c01.pphosted.com (mx0b-00641c01.pphosted.com [205.220.177.146]) by sourceware.org (Postfix) with ESMTPS id 1BA0C384DEC2; Mon, 19 Feb 2024 13:51:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BA0C384DEC2 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 1BA0C384DEC2 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=1708350701; cv=none; b=elTwjJOxlpf2GbL4S+I/zgRJpI9aKcpYi9eUx6MfD+3GDEx8Y3+wyfu+SL9xvl6ZSJksENm0aDkK8zwPv5O+Ppc2Mw7MPNA0oRf9YzAU0OXR2GxZwRDwFw6w8aJoLXqKRCT8es/hoDKtTjyY+UFIsREbvqzHsWaftg02wvRtaJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708350701; c=relaxed/simple; bh=TtR29RbqI5/S2zhTNSHywl6CX8wHfgAq92kW8Jr2XSo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=xYR7lCng/6Osq3rd9EigWHsDIQQXk6mw/8VNmPNdz0x10yFYC93jzBW30rejOWF4edfeTccrLypRRArL4fvMKIg4A5MSeE5QRfWw44fWekTsUsZ+XbGnKurreamKVZNrj5kzyiub2/JnEtspPrAGTQVoYxY/L/Z/wFvAOc3scEg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0247480.ppops.net [127.0.0.1]) by mx0a-00641c01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41JDoHIr028614; Mon, 19 Feb 2024 13:51:38 GMT Received: from mxout24.cac.washington.edu (mxout24.cac.washington.edu [140.142.234.158]) by mx0a-00641c01.pphosted.com (PPS) with ESMTPS id 3wb6vpxv4y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Feb 2024 13:51:38 +0000 Received: from smtp.washington.edu (smtp.washington.edu [140.142.234.157]) by mxout24.cac.washington.edu (8.14.4+UW20.07/8.14.4+UW24.02) with ESMTP id 41JDpaUc001139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 05:51:36 -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 41JDpZRU001026 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Feb 2024 05:51:36 -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 v7 12/22] libstdc++: Optimize std::remove_extent compilation performance Date: Mon, 19 Feb 2024 05:51:19 -0800 Message-ID: <20240219135129.3635809-12-kmatsui@gcc.gnu.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240219135129.3635809-1-kmatsui@gcc.gnu.org> References: <20240106050754.3054782-1-kmatsui@gcc.gnu.org> <20240219135129.3635809-1-kmatsui@gcc.gnu.org> MIME-Version: 1.0 X-Proofpoint-GUID: wbE1w0UF8dR9WtfEPBpAmxCx-3KHZ9YA X-Proofpoint-ORIG-GUID: wbE1w0UF8dR9WtfEPBpAmxCx-3KHZ9YA 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-19_09,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1034 adultscore=0 lowpriorityscore=0 mlxscore=0 phishscore=0 spamscore=0 priorityscore=1501 mlxlogscore=552 bulkscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190103 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791335764107432354 X-GMAIL-MSGID: 1791335764107432354 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 6346d1daee2..73ddce351fd 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2092,6 +2092,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; }; @@ -2103,6 +2108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct remove_extent<_Tp[]> { using type = _Tp; }; +#endif /// remove_all_extents template