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: 183977 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp2884876dyb; Fri, 29 Dec 2023 17:42:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeiNbESdSBqJJup7QuRNbtj+gxech2K8XQ8A0B5GkuPIgbzFD3nDa0vb0Q37JCPDOL9SnM X-Received: by 2002:ad4:46cc:0:b0:67f:eac6:1be8 with SMTP id pm12-20020ad446cc000000b0067feac61be8mr9870008qvb.99.1703900538081; Fri, 29 Dec 2023 17:42:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703900538; cv=pass; d=google.com; s=arc-20160816; b=WN4PsRp31yHMmKOkFvspDKCXAb4QSMq/3EwfJQw8i9F4C+OT/nTKlJkEOOxdxUk7UY wfoOaQRsSxoDka7YsvcVUvfN1H7dqJyR93T9Qr4lPNQ1LXfowQrPAb8A4DEGASpshZ9Y zNdmHS0/zmz5HbZ+rpANWrkQgmj47bnoI5ukOWV2pUxz3siN0Y6LhE10m410XQCddtnd RrPkjA9JUNN3sPRSnhG0hZinbhnYae4eScpseosIlpP8GF1WKNhS9K8/Pm8iOFU0Pb1U LF9tNMENCJ1LWf1u3QdVSnQCV5Qy9yGoWIXyGqiUcsQjOHTlsq+1TOfNZnhATTbCH0H6 JMjw== 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:mime-version:user-agent :message-id:subject:to:from:date:arc-filter:dmarc-filter :delivered-to; bh=8B2/xilM8+rmS0qzggfwtljHl0/rgYOJj1DTAc27DBU=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=wwIjjPDalK8gjVnHM6PCm4WcPyB/uKp0/TlW5vysSaxSoJy80xw5c7mTjD9ieULc3m f6R82OLNAeBUxhVzVz3Mw7KRgpD+gzAvNmbfKIpCGis3FxkNysr08l4efSI7y7Bl2Q8+ ahFupQ2wzQJZ3ILGttYIIbA9gVjG0qcUMzuVseDcijZk/CWNAUDm5R3CMm8q/ptmhnvT FlxdAhmFOmkxu/GqH4L8tNo9nlXZ7P49OU0dJsboB+1zMCZuPbJX9zsjU+yU3P3G7wCa d0659ieaitvyW008oU93iQ5X9QO9vfraWpFjjVADbO0xiOwwfHvKHWuL6d33wbFyGkAO SRig== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n15-20020a0cdc8f000000b0067f862a3d21si3783453qvk.260.2023.12.29.17.42.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 17:42:18 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2FBC3858C54 for ; Sat, 30 Dec 2023 01:42:17 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786669210438012830 X-GMAIL-MSGID: 1786669210438012830 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 );