From: Kyrylo Tkachov <[email protected]>

The positive MIN narrowing test checks that a wide vector MIN is replaced
with a narrow vector MIN and a widening conversion.  The current V2SI to
V2DI case needs target support for the narrow vector MIN.  On 32-bit Arm,
late target lowering can remove the wide vector type and make the final dump
check pass even when the simplification did not run.

Limit the positive test to AArch64 and x86 targets.  Its x86 options and
int128 requirement select a suitable mode there.  I think this test gives too
much trouble on other targets (arm, sparc) that may not support the narrow
modes.

The shared-result test checks that the simplification leaves one MIN.  Check
the first forwprop dump, after the rule has run and before target lowering
can split the vector MIN.  This makes the count independent of the target
vector modes.

Bootstrapped and tested on aarch64-none-linux-gnu.
Ok for trunk?
Thanks,
Kyrill

gcc/testsuite/ChangeLog:

        * g++.dg/tree-ssa/vec-narrow-1.C: Restrict the test to AArch64 and
        x86 targets.
        * g++.dg/tree-ssa/vec-narrow-minmax-2.C: Scan before target lowering.

Signed-off-by: Kyrylo Tkachov <[email protected]>
---
 gcc/testsuite/g++.dg/tree-ssa/vec-narrow-1.C        | 2 +-
 gcc/testsuite/g++.dg/tree-ssa/vec-narrow-minmax-2.C | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/g++.dg/tree-ssa/vec-narrow-1.C 
b/gcc/testsuite/g++.dg/tree-ssa/vec-narrow-1.C
index 1f863b1d4a2..97e7580d63a 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/vec-narrow-1.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/vec-narrow-1.C
@@ -1,4 +1,4 @@
-// { dg-do compile }
+// { dg-do compile { target { aarch64*-*-* i?86-*-* x86_64-*-* } } }
 // { dg-options "-O2 -fdump-tree-optimized" }
 // { dg-additional-options "-msse4" { target { i?86-*-* x86_64-*-* } } }
 // { dg-require-effective-target int128 { target { i?86-*-* x86_64-*-* } } }
diff --git a/gcc/testsuite/g++.dg/tree-ssa/vec-narrow-minmax-2.C 
b/gcc/testsuite/g++.dg/tree-ssa/vec-narrow-minmax-2.C
index 7df25de0942..f5c0e670a5b 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/vec-narrow-minmax-2.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/vec-narrow-minmax-2.C
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-O2 -fdump-tree-optimized" }
+// { dg-options "-O2 -fdump-tree-forwprop1" }
 // { dg-additional-options "-msse4" { target { i?86-*-* x86_64-*-* } } }
 // { dg-require-effective-target int128 { target { i?86-*-* x86_64-*-* } } }
 
@@ -17,4 +17,4 @@ f (v2si a, v2si b, v2di *p)
 }
 
 // A shared wide MIN must not gain a second narrow MIN.
-// { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "optimized" } }
+// { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "forwprop1" } }
-- 
2.50.1 (Apple Git-155)

Reply via email to