From patchwork Thu Feb 29 07:06:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 1906198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=xry111.site header.i=@xry111.site header.a=rsa-sha256 header.s=default header.b=HyzoeJhM; dkim-atps=neutral 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 4Tlj3j18DNz23hR for ; Thu, 29 Feb 2024 18:08:01 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 249BA3858C32 for ; Thu, 29 Feb 2024 07:07:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id C915D3858408 for ; Thu, 29 Feb 2024 07:07:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C915D3858408 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C915D3858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709190450; cv=none; b=v3zuxM4JMtTOUeyiTaviNs3pc+qTopXvFgO+T/o1rMfjOu8rVHA32bMd7Y0WIqsVYYtYgWrbl3ofyBSAs4PtC+a3QSQlP9W6tvLlUYRhEjIRHKQriAtw0NAytWkIod0Sw7xPZ4bJowZEAtbW9BJdC5b5IJotLgwY3Glvnk5qtrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709190450; c=relaxed/simple; bh=3gOf24YpburXOanh/3r6x2JqhWwM/wnX32kIdtisF4U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=bxOPwScA/r/koFo/SbuVxuRpqSur3Kc9QwyUNKwu2w/aJQkYRzT7PeeR77Q5js5qUpOcjX/qQ1tjeHFZL/BaBDe1KJUHUfYCLrPcqGS1tjElhS9BzVe0Y48Vm+TbaF8xu0TVk0IManjXjeeRFKCD4kyVvuQVkYVPY4yGh6NX20I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1709190447; bh=3gOf24YpburXOanh/3r6x2JqhWwM/wnX32kIdtisF4U=; h=From:To:Cc:Subject:Date:From; b=HyzoeJhMyaUmbZtCfPZgwy6VaQqaurRmp/2LE6uY2qzBenpiADtdpfmbCnetcKJ7g YNxhqNAfMRJ3/hSQ/XlnH4yFnnthH3L0woxLmkL8eT/07/bOj35tOmRlMkJXloFHPi UngRmOoiJNxMsEd7K+o4GE18HmneIlJXZLvRhP0U= Received: from stargazer.. (unknown [IPv6:240e:358:11be:c900:dc73:854d:832e:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id D293266A74; Thu, 29 Feb 2024 02:07:22 -0500 (EST) From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: Andrew Pinski , "Kewen . Lin" , Jakub Jelinek , chenxiaolong@loongson.cn, Xi Ruoyao Subject: [PATCH v2] testsuite: Make pr104992.c irrelated to target vector feature [PR113418] Date: Thu, 29 Feb 2024 15:06:07 +0800 Message-ID: <20240229070701.56554-1-xry111@xry111.site> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, LIKELY_SPAM_FROM, SPF_HELO_PASS, 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 The vect_int_mod target selector is evaluated with the options in DEFAULT_VECTCFLAGS in effect, but these options are not automatically passed to tests out of the vect directories. So this test fails on targets where integer vector modulo operation is supported but requiring an option to enable, for example LoongArch. In this test case, the only expected optimization not happened in original is in corge because it needs forward propogation. So we can scan the forwprop2 dump (where the vector operation is not expanded to scalars yet) instead of optimized, then we don't need to consider vect_int_mod or not. gcc/testsuite/ChangeLog: PR testsuite/113418 * gcc.dg/pr104992.c (dg-options): Use -fdump-tree-forwprop2 instead of -fdump-tree-optimized. (dg-final): Scan forwprop2 dump instead of optimized, and remove the use of vect_int_mod. * lib/target-supports.exp (check_effective_target_vect_int_mod): Remove because it's not used anymore. --- v1->v2: Remove check_effective_target_vect_int_mod as it's now unused. This fixes the test failure on loongarch64-linux-gnu. Also tested on x86_64-linux-gnu. Ok for trunk? gcc/testsuite/gcc.dg/pr104992.c | 5 ++--- gcc/testsuite/lib/target-supports.exp | 13 ------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/gcc/testsuite/gcc.dg/pr104992.c b/gcc/testsuite/gcc.dg/pr104992.c index 82f8c75559c..6fd513d34b2 100644 --- a/gcc/testsuite/gcc.dg/pr104992.c +++ b/gcc/testsuite/gcc.dg/pr104992.c @@ -1,6 +1,6 @@ /* PR tree-optimization/104992 */ /* { dg-do compile } */ -/* { dg-options "-O2 -Wno-psabi -fdump-tree-optimized" } */ +/* { dg-options "-O2 -Wno-psabi -fdump-tree-forwprop2" } */ #define vector __attribute__((vector_size(4*sizeof(int)))) @@ -54,5 +54,4 @@ __attribute__((noipa)) unsigned waldo (unsigned x, unsigned y, unsigned z) { return x / y * z == x; } -/* { dg-final { scan-tree-dump-times " % " 9 "optimized" { target { ! vect_int_mod } } } } */ -/* { dg-final { scan-tree-dump-times " % " 6 "optimized" { target vect_int_mod } } } */ +/* { dg-final { scan-tree-dump-times " % " 6 "forwprop2" } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 4138cc9a662..ae33c4f1e3a 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -9064,19 +9064,6 @@ proc check_effective_target_vect_long_mult { } { return $answer } -# Return 1 if the target supports vector int modulus, 0 otherwise. - -proc check_effective_target_vect_int_mod { } { - return [check_cached_effective_target_indexed vect_int_mod { - expr { ([istarget powerpc*-*-*] - && [check_effective_target_has_arch_pwr10]) - || [istarget amdgcn-*-*] - || ([istarget loongarch*-*-*] - && [check_effective_target_loongarch_sx]) - || ([istarget riscv*-*-*] - && [check_effective_target_riscv_v]) }}] -} - # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise. proc check_effective_target_vect_extract_even_odd { } {