From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id BB2443858D39 for ; Tue, 28 Sep 2021 16:09:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB2443858D39 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-Hc5hqQ8hORiOigpO9niShw-1; Tue, 28 Sep 2021 12:09:22 -0400 X-MC-Unique: Hc5hqQ8hORiOigpO9niShw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 35FAD1084681; Tue, 28 Sep 2021 16:09:21 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.86]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FFA460871; Tue, 28 Sep 2021 16:09:14 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.16.1/8.15.2) with ESMTPS id 18SG9C4F952967 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 28 Sep 2021 18:09:12 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 18SG9Bif952966; Tue, 28 Sep 2021 18:09:11 +0200 From: Aldy Hernandez To: Jeff Law Cc: Andrew MacLeod , GCC patches , Aldy Hernandez Subject: [PATCH] [PR102501] Adjust jump threading testcases for ppc64* and others. Date: Tue, 28 Sep 2021 18:09:03 +0200 Message-Id: <20210928160903.952916-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 16:09:25 -0000 I really don't know what to do here. This is a bit of whack-o-mole. The IL is sufficiently different for various architectures that any tweak can cause the number of jump threads to vary. For the pr7745-2.c testcase, we have less threading candidates because 2 of them now cross loop boundaries. Interestingly, this test matches "Jumps threaded", not threads registered, so the block copier can drop threads at copying time adding further confusion. For example, we can register N threads, but the old copier can cancel N-M threads while updating the CFG for a variety of different reasons (removed edges, threading through loop exits, etc). This makes the "Registering jump threads" not to match the total number of threads this test checks for with "Jumps threaded". The pr66752-3.c test OTOH, is just a matter of thread4 eliminating the "if". I had erroneously thought it would always be eliminated by thread3, but we really don't care where it gets cleaned up. All we know is that DCE can't depend on the early threaders doing this work, because it may cross loop boundaries. I've chosen thread4 arbitrarily, but we could just as easily pick the ".optimized" dump. Sorry, I'm really at my wits end here. I don't see any clean path forward, except rewrite these tests as gimple IL. They're close to useless as they sit. OK? gcc/testsuite/ChangeLog: PR testsuite/102501 * gcc.dg/tree-ssa/pr66752-3.c: Adjust. * gcc.dg/tree-ssa/pr77445-2.c: Adjust. --- gcc/testsuite/gcc.dg/tree-ssa/pr66752-3.c | 4 ++-- gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr66752-3.c b/gcc/testsuite/gcc.dg/tree-ssa/pr66752-3.c index 922a331b217..ba7025ae33b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr66752-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr66752-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-thread1-details -fdump-tree-thread3" } */ +/* { dg-options "-O2 -fdump-tree-thread1-details -fdump-tree-thread4" } */ extern int status, pt; extern int count; @@ -43,4 +43,4 @@ foo (int N, int c, int b, int *a) run after loop optimizations , can successfully eliminate the references to FLAG. Verify that ther are no references by the late threading passes. */ -/* { dg-final { scan-tree-dump-not "if .flag" "thread3"} } */ +/* { dg-final { scan-tree-dump-not "if .flag" "thread4"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c index 01a0f1f197d..18f7aab2be7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c @@ -123,7 +123,7 @@ enum STATES FMS( u8 **in , u32 *transitions) { aarch64 has the highest CASE_VALUES_THRESHOLD in GCC. It's high enough to change decisions in switch expansion which in turn can expose new jump threading opportunities. Skip the later tests on aarch64. */ -/* { dg-final { scan-tree-dump "Jumps threaded: 9" "thread1" } } */ +/* { dg-final { scan-tree-dump "Jumps threaded: \[7-9\]" "thread1" } } */ /* { dg-final { scan-tree-dump-times "Invalid sum" 1 "thread1" } } */ /* { dg-final { scan-tree-dump-not "optimizing for size" "thread1" } } */ /* { dg-final { scan-tree-dump-not "optimizing for size" "thread2" } } */ -- 2.31.1