From patchwork Sat Dec 30 01:41:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 1881263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4T24jZ4NKqz1ySy for ; Sat, 30 Dec 2023 12:41:54 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59E413858420 for ; Sat, 30 Dec 2023 01:41:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from arjuna.pair.com (arjuna.pair.com [209.68.5.131]) by sourceware.org (Postfix) with ESMTPS id 231E63858CDB; Sat, 30 Dec 2023 01:41:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 231E63858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bitrange.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bitrange.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 231E63858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.68.5.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703900490; cv=none; b=m54hel/EIOJewnN+xjdovaXJ9Y7TYkCP/s3BgpqFchgGlD5ou4Rdzzn/fCUgRBDVYUrA/Jt6tOJzhXvl1TKRdV4/m8tP9j1Uxht04WprGNlL9EBhntzO3/po8yESLdULXThrsLGHJXvcVNqv4dK12fiY696UzmOyIKE58lTHWp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703900490; c=relaxed/simple; bh=98lEDFN6qTDGwMmNfLc+MHEkM1WqoQH/ce7ybGV/6wI=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=cTDz39v/vt0CyE/hzKebLUyCg+XtZS4Agjfj3whDSTqvxEYwi7efBBL1YdHRRrwZiKdx/+W4ivKd9a0+iSHSXFuLMZYDfman0S7XWy/aSVQYf0r6FA3Jsb8BesPDsj/2ldGQChk6AlrZz0rB7/c4lRdJ3KLTNbR89Vzh7XciGkw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by arjuna.pair.com (Postfix, from userid 3006) id 569368A7AF; Fri, 29 Dec 2023 20:41:26 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id 55F8D8A799; Fri, 29 Dec 2023 20:41:26 -0500 (EST) Date: Fri, 29 Dec 2023 20:41:26 -0500 (EST) From: Hans-Peter Nilsson X-X-Sender: hp@arjuna.pair.com To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++ testsuite/std/ranges/iota/max_size_type.cc: Reduce /10 for simulators Message-ID: User-Agent: Alpine 2.20.16 (BSF 172 2016-09-29) MIME-Version: 1.0 X-Scanned-By: mailmunge 3.11 on 209.68.5.131 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, 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 I'm not completely sure I got the intent of the "log2_limit", or whether "limit" is sane to decrease like this; it just looked like an obvious and safe reduction. Also, I verified the 10+ minute runtime, on this same host (clocked at 11:43.61 elapsed time) for a r12-2797-g307e0d40367996 build that I happened to have kept around; likely the build that led up to that commit. Now it's 58:45.78 elapsed time for a successful run. Looks like a 5x performance regression. Worrisome; PR mentioned below. Incidentally, a parallel build and a serial test-run takes 9 hours on that laptop, so that's almost 2 hours just for one test, if just updating the timeout to fit. IOW, currently 48 minutes out of 9 hours for one test that just times out. (That was just mentioned for comparison purposed: when suitable, I test with `nprocs`-1 in parallel.) I'll put it on the back-burner to investigate. I think I'll try to graft that version of libstdc++-v3 to this version and see if I can shift the blame away from MMIX code generation onto libstdc++-v3. ;) Or perhaps the cause is known? With this, the test successfully completes in ~34 seconds. Ok to commit? -- >8 -- Looks like the MMIX port code quality and/or libstdc++ performance of this test has regressed since r12-2799-ge9b639c4b53221 by a factor 5. Anyway what was 11+ minutes runtime then, is now at r14-6859-gd1eacedc6d9ba9 close to 60 minutes. Better prune the test, not just increase timeouts. Also of course, investigate the performance regression, logged as PR113175. * testsuite/std/ranges/iota/max_size_type.cc: Adjust limits from -1000..1000 to -100..100 for simulators. --- .../std/ranges/iota/max_size_type.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc b/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc index a1fbc3241dca..38fa6323d47e 100644 --- a/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc +++ b/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc @@ -16,6 +16,7 @@ // . // { dg-do run { target c++20 } } +// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } } // { dg-timeout-factor 4 } #include @@ -31,6 +32,14 @@ using signed_rep_t = __int128; using signed_rep_t = long long; #endif +#ifdef SIMULATOR_TEST +#define LIMIT 100 +#define LOG2_CEIL_LIMIT 7 +#else +#define LIMIT 1000 +#define LOG2_CEIL_LIMIT 10 +#endif + static_assert(sizeof(max_size_t) == sizeof(max_diff_t)); static_assert(sizeof(rep_t) == sizeof(signed_rep_t)); @@ -199,8 +208,8 @@ test02() using max_type = std::conditional_t; using shorten_type = std::conditional_t; const int hw_type_bit_size = sizeof(hw_type) * __CHAR_BIT__; - const int limit = 1000; - const int log2_limit = 10; + const int limit = LIMIT; + const int log2_limit = LOG2_CEIL_LIMIT; static_assert((1 << log2_limit) >= limit); const int min = (signed_p ? -limit : 0); const int max = limit; @@ -257,8 +266,8 @@ test03() using max_type = std::conditional_t; using base_type = std::conditional_t; constexpr int hw_type_bit_size = sizeof(hw_type) * __CHAR_BIT__; - constexpr int limit = 1000; - constexpr int log2_limit = 10; + constexpr int limit = LIMIT; + constexpr int log2_limit = LOG2_CEIL_LIMIT; static_assert((1 << log2_limit) >= limit); const int min = (signed_p ? -limit : 0); const int max = limit; @@ -312,7 +321,7 @@ test03() void test04() { - constexpr int limit = 1000; + constexpr int limit = LIMIT; for (int i = -limit; i <= limit; i++) { VERIFY( -max_size_t(-i) == i );