diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-06 10:08:51 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-06 10:08:51 +0000 |
commit | 2a6e95ba024117903e4ed38512d19aea58520d2b (patch) | |
tree | 3e78c2931f5a1e916ecd248c65d21ec69fd56509 /gcc/testsuite/gcc.dg/vect/vect-iv-11.c | |
parent | 2f19e1fee3c3dfa1693e87dc4a72515f104716cb (diff) | |
download | gcc-2a6e95ba024117903e4ed38512d19aea58520d2b.tar.gz |
2007-02-06 Dorit Nuzman <dorit@il.ibm.com>
Victor Kaplansky <victork@il.ibm.com>
* tree-vectorizer.c (vect_is_simple_use): Support induction.
(vect_is_simple_reduction): Support reduction with induction as
one of the operands.
(vect_is_simple_iv_evolution): Fix formatting.
* tree-vect-analyze.c (vect_mark_stmts_to_be_vectorized): Fix
formatting. Don't mark induction phis for vectorization.
(vect_analyze_scalar_cycles): Analyze all inductions, then reductions.
* tree-vect-transform.c (get_initial_def_for_induction): New function.
(vect_get_vec_def_for_operand): Support induction.
(vect_get_vec_def_for_stmt_copy): Fix formatting and add check for
induction case.
(vectorizable_reduction): Support reduction with induction as one of
the operands.
(vectorizable_type_demotion): Use def-type of stmt argument rather
than dummy def-type.
* tree-ssa-loop.c (gate_scev_const_prop): Return the value of
flag_tree_scev_cprop.
* common.opt (tree-scev-cprop): New flag.
* tree-vect-transform.c (vect_create_destination_var): Use 'kind' in
call to vect_get_new_vect_var.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/vect-iv-11.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-iv-11.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/vect-iv-11.c b/gcc/testsuite/gcc.dg/vect/vect-iv-11.c new file mode 100644 index 00000000000..2caadec1f93 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-iv-11.c @@ -0,0 +1,32 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdio.h> +#include <stdarg.h> +#include "tree-vect.h" + +int main1 (int len) +{ + int s = 0; + int i = len; + + /* vectorization of induction with reduction. */ + for ( ; i > 1; i -=2) + s += i; + + return s; +} + +int main (void) +{ + int s; + check_vect (); + + s = main1 (26); + if (s != 182) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ |