public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v2] testsuite: Make pr104992.c irrelated to target vector feature [PR113418]
@ 2024-02-29  7:06 Xi Ruoyao
  2024-03-03 22:00 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Xi Ruoyao @ 2024-02-29  7:06 UTC (permalink / raw)
  To: gcc-patches
  Cc: Andrew Pinski, Kewen . Lin, Jakub Jelinek, chenxiaolong, Xi Ruoyao

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 { } {
-- 
2.44.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] testsuite: Make pr104992.c irrelated to target vector feature [PR113418]
  2024-02-29  7:06 [PATCH v2] testsuite: Make pr104992.c irrelated to target vector feature [PR113418] Xi Ruoyao
@ 2024-03-03 22:00 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2024-03-03 22:00 UTC (permalink / raw)
  To: Xi Ruoyao, gcc-patches
  Cc: Andrew Pinski, Kewen . Lin, Jakub Jelinek, chenxiaolong



On 2/29/24 00:06, Xi Ruoyao wrote:
> 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(-)
While not strictly a regression, it's just the testsuite so I think this 
is OK for the trunk, even though we're in stage4.

jeff


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-03 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29  7:06 [PATCH v2] testsuite: Make pr104992.c irrelated to target vector feature [PR113418] Xi Ruoyao
2024-03-03 22:00 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).