Adjust more testcases for O2 vectorization enabling.
Commit Message
Pushed to trunk.
libgomp/ChangeLog:
* testsuite/libgomp.c++/scan-10.C: Add option -fvect-cost-model=cheap.
* testsuite/libgomp.c++/scan-11.C: Ditto.
* testsuite/libgomp.c++/scan-12.C: Ditto.
* testsuite/libgomp.c++/scan-13.C: Ditto.
* testsuite/libgomp.c++/scan-14.C: Ditto.
* testsuite/libgomp.c++/scan-15.C: Ditto.
* testsuite/libgomp.c++/scan-16.C: Ditto.
* testsuite/libgomp.c++/scan-9.C: Ditto.
* testsuite/libgomp.c-c++-common/lastprivate-conditional-7.c: Ditto.
* testsuite/libgomp.c-c++-common/lastprivate-conditional-8.c: Ditto.
* testsuite/libgomp.c/scan-11.c: Ditto.
* testsuite/libgomp.c/scan-12.c: Ditto.
* testsuite/libgomp.c/scan-13.c: Ditto.
* testsuite/libgomp.c/scan-14.c: Ditto.
* testsuite/libgomp.c/scan-15.c: Ditto.
* testsuite/libgomp.c/scan-16.c: Ditto.
* testsuite/libgomp.c/scan-17.c: Ditto.
* testsuite/libgomp.c/scan-18.c: Ditto.
* testsuite/libgomp.c/scan-19.c: Ditto.
* testsuite/libgomp.c/scan-20.c: Ditto.
* testsuite/libgomp.c/scan-21.c: Ditto.
* testsuite/libgomp.c/scan-22.c: Ditto.
gcc/testsuite/ChangeLog:
* g++.dg/tree-ssa/pr94403.C: Add -fno-tree-vectorize
* gcc.dg/optimize-bswapsi-5.c: Ditto.
* gcc.dg/optimize-bswapsi-6.c: Ditto.
* gcc.dg/Warray-bounds-51.c: Add -mtune=generic
* gcc.dg/Wstringop-overflow-14.c:
---
gcc/testsuite/g++.dg/tree-ssa/pr94403.C | 2 +-
gcc/testsuite/gcc.dg/Warray-bounds-51.c | 3 ++-
gcc/testsuite/gcc.dg/Wstringop-overflow-14.c | 3 ++-
gcc/testsuite/gcc.dg/optimize-bswapsi-5.c | 2 +-
gcc/testsuite/gcc.dg/optimize-bswapsi-6.c | 2 +-
libgomp/testsuite/libgomp.c++/scan-10.C | 2 +-
libgomp/testsuite/libgomp.c++/scan-11.C | 2 +-
libgomp/testsuite/libgomp.c++/scan-12.C | 2 +-
libgomp/testsuite/libgomp.c++/scan-13.C | 2 +-
libgomp/testsuite/libgomp.c++/scan-14.C | 2 +-
libgomp/testsuite/libgomp.c++/scan-15.C | 2 +-
libgomp/testsuite/libgomp.c++/scan-16.C | 2 +-
libgomp/testsuite/libgomp.c++/scan-9.C | 2 +-
.../testsuite/libgomp.c-c++-common/lastprivate-conditional-7.c | 2 +-
.../testsuite/libgomp.c-c++-common/lastprivate-conditional-8.c | 2 +-
libgomp/testsuite/libgomp.c/scan-11.c | 2 +-
libgomp/testsuite/libgomp.c/scan-12.c | 2 +-
libgomp/testsuite/libgomp.c/scan-13.c | 2 +-
libgomp/testsuite/libgomp.c/scan-14.c | 2 +-
libgomp/testsuite/libgomp.c/scan-15.c | 2 +-
libgomp/testsuite/libgomp.c/scan-16.c | 2 +-
libgomp/testsuite/libgomp.c/scan-17.c | 2 +-
libgomp/testsuite/libgomp.c/scan-18.c | 2 +-
libgomp/testsuite/libgomp.c/scan-19.c | 2 +-
libgomp/testsuite/libgomp.c/scan-20.c | 2 +-
libgomp/testsuite/libgomp.c/scan-21.c | 2 +-
libgomp/testsuite/libgomp.c/scan-22.c | 2 +-
27 files changed, 29 insertions(+), 27 deletions(-)
Comments
On Fri, Oct 8, 2021 at 9:55 PM liuhongt <hongtao.liu@intel.com> wrote:
>
> Pushed to trunk.
>
> libgomp/ChangeLog:
>
> * testsuite/libgomp.c++/scan-10.C: Add option -fvect-cost-model=cheap.
> * testsuite/libgomp.c++/scan-11.C: Ditto.
> * testsuite/libgomp.c++/scan-12.C: Ditto.
> * testsuite/libgomp.c++/scan-13.C: Ditto.
> * testsuite/libgomp.c++/scan-14.C: Ditto.
> * testsuite/libgomp.c++/scan-15.C: Ditto.
> * testsuite/libgomp.c++/scan-16.C: Ditto.
> * testsuite/libgomp.c++/scan-9.C: Ditto.
> * testsuite/libgomp.c-c++-common/lastprivate-conditional-7.c: Ditto.
> * testsuite/libgomp.c-c++-common/lastprivate-conditional-8.c: Ditto.
> * testsuite/libgomp.c/scan-11.c: Ditto.
> * testsuite/libgomp.c/scan-12.c: Ditto.
> * testsuite/libgomp.c/scan-13.c: Ditto.
> * testsuite/libgomp.c/scan-14.c: Ditto.
> * testsuite/libgomp.c/scan-15.c: Ditto.
> * testsuite/libgomp.c/scan-16.c: Ditto.
> * testsuite/libgomp.c/scan-17.c: Ditto.
> * testsuite/libgomp.c/scan-18.c: Ditto.
> * testsuite/libgomp.c/scan-19.c: Ditto.
> * testsuite/libgomp.c/scan-20.c: Ditto.
> * testsuite/libgomp.c/scan-21.c: Ditto.
> * testsuite/libgomp.c/scan-22.c: Ditto.
>
> gcc/testsuite/ChangeLog:
>
> * g++.dg/tree-ssa/pr94403.C: Add -fno-tree-vectorize
> * gcc.dg/optimize-bswapsi-5.c: Ditto.
> * gcc.dg/optimize-bswapsi-6.c: Ditto.
> * gcc.dg/Warray-bounds-51.c: Add -mtune=generic
> * gcc.dg/Wstringop-overflow-14.c:
libgomp.graphite/force-parallel-8.c also fails because of the -O2 change.
On Sat, Oct 09, 2021 at 12:55:15PM +0800, liuhongt via Gcc-patches wrote:
> Pushed to trunk.
>
> libgomp/ChangeLog:
>
> * testsuite/libgomp.c++/scan-10.C: Add option -fvect-cost-model=cheap.
> * testsuite/libgomp.c++/scan-11.C: Ditto.
> * testsuite/libgomp.c++/scan-12.C: Ditto.
> * testsuite/libgomp.c++/scan-13.C: Ditto.
> * testsuite/libgomp.c++/scan-14.C: Ditto.
> * testsuite/libgomp.c++/scan-15.C: Ditto.
> * testsuite/libgomp.c++/scan-16.C: Ditto.
> * testsuite/libgomp.c++/scan-9.C: Ditto.
> * testsuite/libgomp.c-c++-common/lastprivate-conditional-7.c: Ditto.
> * testsuite/libgomp.c-c++-common/lastprivate-conditional-8.c: Ditto.
> * testsuite/libgomp.c/scan-11.c: Ditto.
> * testsuite/libgomp.c/scan-12.c: Ditto.
> * testsuite/libgomp.c/scan-13.c: Ditto.
> * testsuite/libgomp.c/scan-14.c: Ditto.
> * testsuite/libgomp.c/scan-15.c: Ditto.
> * testsuite/libgomp.c/scan-16.c: Ditto.
> * testsuite/libgomp.c/scan-17.c: Ditto.
> * testsuite/libgomp.c/scan-18.c: Ditto.
> * testsuite/libgomp.c/scan-19.c: Ditto.
> * testsuite/libgomp.c/scan-20.c: Ditto.
> * testsuite/libgomp.c/scan-21.c: Ditto.
> * testsuite/libgomp.c/scan-22.c: Ditto.
I don't think this is the right thing to do.
This just means that at some point between 2013 when -fsimd-cost-model has
been introduced and now -fsimd-cost-model= option at least partially stopped
working properly.
As documented, -fsimd-cost-model= overrides the -fvect-cost-model= setting
for OpenMP simd loops (loop->force_vectorize is true) if specified differently
from default.
In tree-vectorizer.h we have:
static inline bool
unlimited_cost_model (loop_p loop)
{
if (loop != NULL && loop->force_vectorize
&& flag_simd_cost_model != VECT_COST_MODEL_DEFAULT)
return flag_simd_cost_model == VECT_COST_MODEL_UNLIMITED;
return (flag_vect_cost_model == VECT_COST_MODEL_UNLIMITED);
}
and use it in various places, but we also just use flag_vect_cost_model
in lots of places (and in one spot use flag_simd_cost_model, not sure if
we are sure it is a force_vectorize loop or what).
So, IMHO we should change the above inline function to
loop_cost_model and let it return the cost model and then just
reimplement unlimited_cost_model as
return loop_cost_model (loop) == VECT_COST_MODEL_UNLIMITED;
and then adjust the direct uses of the flag and revert these changes.
Jakub
@@ -3,7 +3,7 @@
// are either big or little endian (not pdp endian).
// { dg-do compile { target { lp64 && { i?86-*-* x86_64-*-* powerpc*-*-* aarch64*-*-* } } } }
// { dg-require-effective-target store_merge }
-// { dg-options "-O2 -fdump-tree-store-merging -std=c++17" }
+// { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging -std=c++17" }
namespace std {
template <typename T>
@@ -1,7 +1,8 @@
/* PR middle-end/92333 - missing variable name referencing VLA in warnings
PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
{ dg-do compile }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-additional-options "-mtune=generic" { target { i?86-*-* x86_64-*-* } } } */
void sink (void*);
@@ -2,7 +2,8 @@
types than char are diagnosed.
{ dg-do compile }
{ dg-require-effective-target int32plus }
- { dg-options "-O2 -Wall -Wno-array-bounds" } */
+ { dg-options "-O2 -Wall -Wno-array-bounds" }
+ { dg-additional-options "-mtune=generic" { target { i?86-*-* x86_64-*-* } } } */
typedef __INT16_TYPE__ int16_t;
typedef __INT32_TYPE__ int32_t;
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target bswap } */
-/* { dg-options "-O2 -fdump-tree-optimized -fno-inline-functions" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-optimized -fno-inline-functions" } */
/* { dg-additional-options "-march=z900" { target s390-*-* } } */
struct L { unsigned int l[2]; };
@@ -1,7 +1,7 @@
/* PR tree-optimization/42587 */
/* { dg-do compile } */
/* { dg-require-effective-target bswap } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
/* { dg-additional-options "-march=z900" { target s390-*-* } } */
typedef unsigned char u8;
@@ -1,5 +1,5 @@
// { dg-require-effective-target size32plus }
-// { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
+// { dg-additional-options "-O2 -fvect-cost-model=cheap -fopenmp -fdump-tree-vect-details" }
// { dg-additional-options "-msse2" { target sse2_runtime } }
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
@@ -1,5 +1,5 @@
// { dg-require-effective-target size32plus }
-// { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
+// { dg-additional-options "-O2 -fvect-cost-model=cheap -fopenmp -fdump-tree-vect-details" }
// { dg-additional-options "-msse2" { target sse2_runtime } }
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
@@ -1,5 +1,5 @@
// { dg-require-effective-target size32plus }
-// { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
+// { dg-additional-options "-O2 -fvect-cost-model=cheap -fopenmp -fdump-tree-vect-details" }
// { dg-additional-options "-msse2" { target sse2_runtime } }
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
@@ -1,5 +1,5 @@
// { dg-require-effective-target size32plus }
-// { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
+// { dg-additional-options "-O2 -fvect-cost-model=cheap -fopenmp -fdump-tree-vect-details" }
// { dg-additional-options "-msse2" { target sse2_runtime } }
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
@@ -1,5 +1,5 @@
// { dg-require-effective-target size32plus }
-// { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
+// { dg-additional-options "-O2 -fvect-cost-model=cheap -fopenmp -fdump-tree-vect-details" }
// { dg-additional-options "-msse2" { target sse2_runtime } }
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
@@ -1,5 +1,5 @@
// { dg-require-effective-target size32plus }
-// { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
+// { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" }
// { dg-additional-options "-msse2" { target sse2_runtime } }
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
@@ -1,5 +1,5 @@
// { dg-require-effective-target size32plus }
-// { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
+// { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" }
// { dg-additional-options "-msse2" { target sse2_runtime } }
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
@@ -1,5 +1,5 @@
// { dg-require-effective-target size32plus }
-// { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
+// { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" }
// { dg-additional-options "-msse2" { target sse2_runtime } }
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-additional-options "-O2 -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { target avx_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-additional-options "-O2 -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { target avx_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fvect-cost-model=cheap -fopenmp -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,5 +1,5 @@
/* { dg-require-effective-target size32plus } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } } */
@@ -1,6 +1,6 @@
/* { dg-require-effective-target size32plus } */
/* { dg-require-effective-target avx_runtime } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details -msse2 -mno-sse3" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details -msse2 -mno-sse3" } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" } } */
#include "scan-13.c"
@@ -1,6 +1,6 @@
/* { dg-require-effective-target size32plus } */
/* { dg-require-effective-target avx_runtime } */
-/* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details -msse2 -mno-sse3" } */
+/* { dg-additional-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details -msse2 -mno-sse3" } */
/* { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" } } */
#include "scan-17.c"