From 43c0068e60ad1518cc6196eeac51eb811fe62f8f Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 19 May 2016 07:39:52 +0000 Subject: [PATCH] re PR tree-optimization/70729 (Loop marked with omp simd pragma is not vectorized) 2016-05-19 Richard Biener PR tree-optimization/70729 * passes.def: Move LIM pass before PRE. Remove no longer required copyprop and move first DCE out of the loop pipeline. * gcc.dg/autopar/outer-6.c: Adjust to avoid redundant store. * gcc.dg/graphite/scop-18.c: Likewise. * gcc.dg/pr41783.c: Disable LIM. * gcc.dg/tree-ssa/loadpre10.c: Likewise. * gcc.dg/tree-ssa/loadpre23.c: Likewise. * gcc.dg/tree-ssa/loadpre24.c: Likewise. * gcc.dg/tree-ssa/loadpre25.c: Likewise. * gcc.dg/tree-ssa/loadpre4.c: Likewise. * gcc.dg/tree-ssa/loadpre8.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-16.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-18.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-20.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-3.c: Likewise. * gfortran.dg/pr42108.f90: Likewise. From-SVN: r236440 --- gcc/ChangeLog | 6 ++++++ gcc/passes.def | 5 ++--- gcc/testsuite/ChangeLog | 18 ++++++++++++++++++ gcc/testsuite/gcc.dg/autopar/outer-6.c | 2 +- gcc/testsuite/gcc.dg/graphite/scop-18.c | 4 ++-- gcc/testsuite/gcc.dg/pr41783.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c | 2 +- gcc/testsuite/gfortran.dg/pr42108.f90 | 2 +- 17 files changed, 41 insertions(+), 18 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cde433e3d05..63fe8002db0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-19 Richard Biener + + PR tree-optimization/70729 + * passes.def: Move LIM pass before PRE. Remove no longer + required copyprop and move first DCE out of the loop pipeline. + 2016-05-18 David Malcolm PR driver/69265 diff --git a/gcc/passes.def b/gcc/passes.def index 21427d7b6e7..993ed28628b 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -243,12 +243,14 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_cse_sincos); NEXT_PASS (pass_optimize_bswap); NEXT_PASS (pass_laddress); + NEXT_PASS (pass_lim); NEXT_PASS (pass_split_crit_edges); NEXT_PASS (pass_pre); NEXT_PASS (pass_sink_code); NEXT_PASS (pass_sancov); NEXT_PASS (pass_asan); NEXT_PASS (pass_tsan); + NEXT_PASS (pass_dce); /* Pass group that runs when 1) enabled, 2) there are loops in the function. Make sure to run pass_fix_loops before to discover/remove loops before running the gate function @@ -257,9 +259,6 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_tree_loop); PUSH_INSERT_PASSES_WITHIN (pass_tree_loop) NEXT_PASS (pass_tree_loop_init); - NEXT_PASS (pass_lim); - NEXT_PASS (pass_copy_prop); - NEXT_PASS (pass_dce); NEXT_PASS (pass_tree_unswitch); NEXT_PASS (pass_scev_cprop); NEXT_PASS (pass_record_bounds); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 642fee3ff05..d14ebefc563 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,21 @@ +2016-05-19 Richard Biener + + PR tree-optimization/70729 + * gcc.dg/autopar/outer-6.c: Adjust to avoid redundant store. + * gcc.dg/graphite/scop-18.c: Likewise. + * gcc.dg/pr41783.c: Disable LIM. + * gcc.dg/tree-ssa/loadpre10.c: Likewise. + * gcc.dg/tree-ssa/loadpre23.c: Likewise. + * gcc.dg/tree-ssa/loadpre24.c: Likewise. + * gcc.dg/tree-ssa/loadpre25.c: Likewise. + * gcc.dg/tree-ssa/loadpre4.c: Likewise. + * gcc.dg/tree-ssa/loadpre8.c: Likewise. + * gcc.dg/tree-ssa/ssa-pre-16.c: Likewise. + * gcc.dg/tree-ssa/ssa-pre-18.c: Likewise. + * gcc.dg/tree-ssa/ssa-pre-20.c: Likewise. + * gcc.dg/tree-ssa/ssa-pre-3.c: Likewise. + * gfortran.dg/pr42108.f90: Likewise. + 2016-05-18 David Malcolm PR driver/69265 diff --git a/gcc/testsuite/gcc.dg/autopar/outer-6.c b/gcc/testsuite/gcc.dg/autopar/outer-6.c index fff7bce138a..7aae803acd9 100644 --- a/gcc/testsuite/gcc.dg/autopar/outer-6.c +++ b/gcc/testsuite/gcc.dg/autopar/outer-6.c @@ -24,7 +24,7 @@ void parloop (int N) for (i = 0; i < N; i++) { for (j = 0; j < N; j++) - y[i]=x[i][j]; + y[i]+=x[i][j]; sum += y[i]; } g_sum = sum; diff --git a/gcc/testsuite/gcc.dg/graphite/scop-18.c b/gcc/testsuite/gcc.dg/graphite/scop-18.c index 3416304075d..fe2a5bf9709 100644 --- a/gcc/testsuite/gcc.dg/graphite/scop-18.c +++ b/gcc/testsuite/gcc.dg/graphite/scop-18.c @@ -13,13 +13,13 @@ void test (void) for (i = 0; i < 24; i++) for (j = 0; j < 24; j++) for (k = 0; k < 24; k++) - A[i][j] = B[i][k] * C[k][j]; + A[i][j] += B[i][k] * C[k][j]; /* These loops should still be strip mined. */ for (i = 0; i < 1000; i++) for (j = 0; j < 1000; j++) for (k = 0; k < 1000; k++) - A[i][j] = B[i][k] * C[k][j]; + A[i][j] += B[i][k] * C[k][j]; } /* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */ diff --git a/gcc/testsuite/gcc.dg/pr41783.c b/gcc/testsuite/gcc.dg/pr41783.c index 3d8006c579d..465b0af872c 100644 --- a/gcc/testsuite/gcc.dg/pr41783.c +++ b/gcc/testsuite/gcc.dg/pr41783.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fdump-tree-pre" } */ +/* { dg-options "-O3 -fdump-tree-pre -fno-tree-loop-im" } */ int db[100]; int a_global_var, fact; int main() diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c index 543e1a69294..c6ee35c8d94 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-loop-im" } */ struct tree_common { int code; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c index 9fa07315415..42b08f0dfa8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-loop-im" } */ struct { int a; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c index bd7275f76e9..56e4279049c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-loop-im" } */ int a; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c index 8418c309616..d1a9e4e105d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-loop-im" } */ struct X { int i; }; int foo(struct X *a, int argc) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c index 2ca7e393cdf..6eaf6901892 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-loop-im" } */ int main(int *a, int argc) { int i; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c index db5937fc031..2abb0d21621 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats -std=gnu89" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -std=gnu89 -fno-tree-loop-im" } */ typedef union tree_node *tree; struct tree_common { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c index f2ec5d7eda2..69cc517f9de 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats -std=c99" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -std=c99 -fno-tree-loop-im" } */ int foo(int k, int *x) { int j=0; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c index 483f8228260..ea2a7aee56b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-details" } */ +/* { dg-options "-O2 -fdump-tree-pre-details -fno-tree-loop-im" } */ struct Bar { int a; int b; }; struct Foo { int x; struct Bar y; }; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c index c8a23df8310..39ed2efb7c5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-loop-im" } */ double pcheck; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c index ba2c8eaaa8d..7e319ed2fbd 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-loop-im" } */ unsigned foo1 (unsigned a, unsigned b, unsigned j, unsigned k) { unsigned i; diff --git a/gcc/testsuite/gfortran.dg/pr42108.f90 b/gcc/testsuite/gfortran.dg/pr42108.f90 index c823edbf792..eb93604e6b0 100644 --- a/gcc/testsuite/gfortran.dg/pr42108.f90 +++ b/gcc/testsuite/gfortran.dg/pr42108.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O2 -fdump-tree-fre1 -fdump-tree-pre-details" } +! { dg-options "-O2 -fdump-tree-fre1 -fdump-tree-pre-details -fno-tree-loop-im" } subroutine eval(foo1,foo2,foo3,foo4,x,n,nnd) implicit real*8 (a-h,o-z)