diff options
author | Ira Rosen <irar@il.ibm.com> | 2010-02-16 11:35:03 +0000 |
---|---|---|
committer | Ira Rosen <irar@gcc.gnu.org> | 2010-02-16 11:35:03 +0000 |
commit | 99f51320d47ba6565b21dbf9a1ec999b193fde0a (patch) | |
tree | e9f104bb7db8c23a9f89870f72aee6f61efe9bce | |
parent | f47e08d97a42b58e87bb4edaaa7889743c064b54 (diff) | |
download | gcc-99f51320d47ba6565b21dbf9a1ec999b193fde0a.zip gcc-99f51320d47ba6565b21dbf9a1ec999b193fde0a.tar.gz gcc-99f51320d47ba6565b21dbf9a1ec999b193fde0a.tar.bz2 |
re PR tree-optimization/43074 (ICE in vectorizable_reduction, at tree-vect-loop.c:3491)
PR tree-optimization/43074
* tree-vectorizer.h (VECTORIZABLE_CYCLE_DEF): New.
* tree-vect-loop.c (vect_analyze_loop_operations): Add
vectorizable cycles in hybrid SLP check.
* tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Likewise.
From-SVN: r156800
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/fast-math-pr43074.c | 16 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 5 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 8 | ||||
-rw-r--r-- | gcc/tree-vectorizer.h | 4 |
6 files changed, 42 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8387923..4495a31 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2010-02-16 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/43074 + * tree-vectorizer.h (VECTORIZABLE_CYCLE_DEF): New. + * tree-vect-loop.c (vect_analyze_loop_operations): Add + vectorizable cycles in hybrid SLP check. + * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Likewise. + 2010-02-16 Richard Guenther <rguenther@suse.de> * alias.c (memrefs_conflict_p): Distinguish must-alias from diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1c51234..7e06ff7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-02-16 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/43074 + * gcc.dg/vect/fast-math-pr43074.c: New test. + 2010-02-16 Jakub Jelinek <jakub@redhat.com> * lib/prune.exp: Prune variable tracking size limit exceeded diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-pr43074.c b/gcc/testsuite/gcc.dg/vect/fast-math-pr43074.c new file mode 100644 index 0000000..80077ba --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/fast-math-pr43074.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ + +float +pvslockprocess(float *fout, float *fin, int framesize) +{ + int i; + float mag=0.0f, diff; + for (i = 0; i < framesize; i += 2) { + mag += fin[i]; + fout[i] = fin[i]; + fout[i+1] = fin[i+1]; + } + return mag; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 9e17eb3..16aa242 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -1184,7 +1184,10 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo) if (!vect_analyze_stmt (stmt, &need_to_vectorize, NULL)) return false; - if (STMT_VINFO_RELEVANT_P (stmt_info) && !PURE_SLP_STMT (stmt_info)) + if ((STMT_VINFO_RELEVANT_P (stmt_info) + || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_info))) + && !PURE_SLP_STMT (stmt_info)) + /* STMT needs both SLP and loop-based vectorization. */ only_slp_in_loop = false; } diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index bbf2bd3..5a11b84 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1102,6 +1102,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node) gimple stmt; imm_use_iterator imm_iter; gimple use_stmt; + stmt_vec_info stmt_vinfo; if (!node) return; @@ -1110,9 +1111,10 @@ vect_detect_hybrid_slp_stmts (slp_tree node) if (PURE_SLP_STMT (vinfo_for_stmt (stmt)) && TREE_CODE (gimple_op (stmt, 0)) == SSA_NAME) FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, gimple_op (stmt, 0)) - if (vinfo_for_stmt (use_stmt) - && !STMT_SLP_TYPE (vinfo_for_stmt (use_stmt)) - && STMT_VINFO_RELEVANT (vinfo_for_stmt (use_stmt))) + if ((stmt_vinfo = vinfo_for_stmt (use_stmt)) + && !STMT_SLP_TYPE (stmt_vinfo) + && (STMT_VINFO_RELEVANT (stmt_vinfo) + || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo)))) vect_mark_slp_stmts (node, hybrid, i); vect_detect_hybrid_slp_stmts (SLP_TREE_LEFT (node)); diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index b7c6316..2217a7c 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -66,6 +66,10 @@ enum vect_def_type { vect_unknown_def_type }; +#define VECTORIZABLE_CYCLE_DEF(D) (((D) == vect_reduction_def) \ + || ((D) == vect_double_reduction_def) \ + || ((D) == vect_nested_cycle)) + /* Define verbosity levels. */ enum verbosity_levels { REPORT_NONE, |