From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7934) id 62A29386D63A; Sat, 16 Dec 2023 17:00:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62A29386D63A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702746014; bh=5SvwWwZfXudXqR+JC+jmIHiKTQZbtZHfoGh0QGEqpfo=; h=From:To:Subject:Date:From; b=bciuMszdPlxs1b+nZuSjJvDtK8T+4QHi66YMT2aTBdglJeS6wlExgosR6Lrd8oS39 hwFzzwGKK2gPT4ShC3EKekYkD09a26w344p4yUAcEbbCfx1kUAjwmDS8L8ATasnZtL 75XTe8tRfaEaBIAk/JPg3LM/kn61ndbrWVJv2lRs= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Ken Matsui To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-6624] libstdc++: Optimize std::is_bounded_array compilation performance X-Act-Checkin: gcc X-Git-Author: Ken Matsui X-Git-Refname: refs/heads/master X-Git-Oldrev: 7fd9c349e455345a8b94d8fcee1c92b5c92873a5 X-Git-Newrev: 8843cff6c98cb0789a1ec6f51be6c5122fc1b5e9 Message-Id: <20231216170014.62A29386D63A@sourceware.org> Date: Sat, 16 Dec 2023 17:00:14 +0000 (GMT) List-Id: https://gcc.gnu.org/g:8843cff6c98cb0789a1ec6f51be6c5122fc1b5e9 commit r14-6624-g8843cff6c98cb0789a1ec6f51be6c5122fc1b5e9 Author: Ken Matsui Date: Mon Sep 11 19:15:21 2023 -0700 libstdc++: Optimize std::is_bounded_array compilation performance This patch optimizes the compilation performance of std::is_bounded_array by dispatching to the new __is_bounded_array built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_bounded_array_v): Use __is_bounded_array built-in trait. Signed-off-by: Ken Matsui Reviewed-by: Jonathan Wakely Diff: --- libstdc++-v3/include/std/type_traits | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 64f9d67fe29..2a1a0aa80ff 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -3506,11 +3506,16 @@ template /// True for a type that is an array of known bound. /// @ingroup variable_templates /// @since C++20 +# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_bounded_array) + template + inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp); +# else template inline constexpr bool is_bounded_array_v = false; template inline constexpr bool is_bounded_array_v<_Tp[_Size]> = true; +# endif /// True for a type that is an array of unknown bound. /// @ingroup variable_templates