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: 208226 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp221026dyb; Wed, 28 Feb 2024 23:08:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWxiZwSSdmvwltXiaUeQh9jBjcmcUj9SO2f80Ox40empX9yqS6iC4yRrluRV0Hgg1hCUrY/pMg0QLihC0s7JSODfFFkdA== X-Google-Smtp-Source: AGHT+IFBbHA5B5QscyDPEbkYXjUzqrI/IIjksj/bmLhP/etQ24UmIYCUUCJLa5cYc5St3NBeXZB6 X-Received: by 2002:ad4:5102:0:b0:690:308f:52aa with SMTP id g2-20020ad45102000000b00690308f52aamr1336148qvp.35.1709190501937; Wed, 28 Feb 2024 23:08:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709190501; cv=pass; d=google.com; s=arc-20160816; b=V5c1ArmTnCVckht+RK7nliqecFpwlzEP8K3OW7lvAEsaYTEaMbe6zOdSN6Axh0cN8y qww85gQkSo8dVag4X0w0dBuSn2fxsf4D5x4bovd8mI5+GTOk8mIyI6G8+HWgp/r0ToeY jpM2PrCo2h90yyHohqCYwHyLkXExjFs+hgCSjaxJprwxMxsbG7nC2FsYXV+cvhhc8xH/ /+7BRoYn8fpYHJad9sZOTJaT4bdFDB53SD+Mcch2YilQecNuivpXUT1/yd9sCiKVqAi9 0QW3AgJZ2UlUZPj32uEb17VcbIK2u0xkuZ/uqKh2C1HBALJE7xMVAh7GB4lfovM7OVxr BCFQ== 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=CJjcdcIyUOCM5NU9xT1sWyoou6OXZxFrnOe4KnPtl5U=; fh=ptzg5K9atjTLjswj8Yf0kYkJDhzi1Q4LEOAvT+B4ki0=; b=dLMovk/EadxAQV8QkzF8M5gBDqTX9KqRG9afFzHKFCAd5FYHn/eWZrUxqjdlZrTVmq F7IrhjFrzlfo+61Cw6GMLy8jDMlqPoiBx2sa3NSjYWzMFhvm+pqCAemBdVWUiQkalNEY Yg1AREcS+aqy2/IqkUuqPi0lFdfXJhEuBuABNyBCJO6ddvaWrIGShorOOF8F/UBSsmfQ 4r4mO9hI2V3sdXwfsTBWWY+CmOxpp6SIDQg60FEUBS2jSKJikfkacQZ20eETrer8g+bZ YH0iKMo8+SuB7JhLcYlkPNUAnrjsgUBfHiN7k+tBy1LHGzX1i86M/1UUZQy/EOhIBco+ 3ffg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=HyzoeJhM; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id js4-20020a0562142aa400b0068f62f01575si790544qvb.257.2024.02.28.23.08.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 23:08:21 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=HyzoeJhM; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E46A3858409 for ; Thu, 29 Feb 2024 07:08:21 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792216139796124877 X-GMAIL-MSGID: 1792216139796124877 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 { } {