Commit 38000232 by Marc Glisse Committed by Marc Glisse

tree-vect-stmts.c (vectorizable_store): Accept BIT_FIELD_REF.

2013-04-03  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* tree-vect-stmts.c (vectorizable_store): Accept BIT_FIELD_REF.
	(vectorizable_load): Likewise.
	* tree-vect-slp.c (vect_build_slp_tree): Likewise.
	* tree-vect-data-refs.c (vect_create_data_ref_ptr): Handle VECTOR_TYPE.

gcc/testsuite/
	* gcc.dg/vect/bb-slp-31.c: New file.

From-SVN: r197410
parent 3fa35298
2013-04-03 Marc Glisse <marc.glisse@inria.fr> 2013-04-03 Marc Glisse <marc.glisse@inria.fr>
* tree-vect-stmts.c (vectorizable_store): Accept BIT_FIELD_REF.
(vectorizable_load): Likewise.
* tree-vect-slp.c (vect_build_slp_tree): Likewise.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Handle VECTOR_TYPE.
2013-04-03 Marc Glisse <marc.glisse@inria.fr>
* tree-flow-inline.h (get_addr_base_and_unit_offset_1): Handle * tree-flow-inline.h (get_addr_base_and_unit_offset_1): Handle
BIT_FIELD_REF. BIT_FIELD_REF.
......
2013-04-03 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/vect/bb-slp-31.c: New file.
2013-04-03 Jason Merrill <jason@redhat.com> 2013-04-03 Jason Merrill <jason@redhat.com>
PR c++/34949 PR c++/34949
......
/* { dg-do compile } */
/* { dg-require-effective-target vect_double } */
typedef double vec __attribute__ ((vector_size (2 * sizeof (double))));
vec a;
void f(){
a[0]=1+2*a[0]*a[0];
a[1]=1+2*a[1]*a[1];
}
/* { dg-final { scan-tree-dump "basic block vectorized using SLP" "slp" } } */
...@@ -3613,6 +3613,8 @@ vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop, ...@@ -3613,6 +3613,8 @@ vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop,
dump_generic_expr (MSG_NOTE, TDF_SLIM, aggr_type); dump_generic_expr (MSG_NOTE, TDF_SLIM, aggr_type);
if (TREE_CODE (dr_base_type) == ARRAY_TYPE) if (TREE_CODE (dr_base_type) == ARRAY_TYPE)
dump_printf (MSG_NOTE, " vectorizing an array ref: "); dump_printf (MSG_NOTE, " vectorizing an array ref: ");
else if (TREE_CODE (dr_base_type) == VECTOR_TYPE)
dump_printf (MSG_NOTE, " vectorizing a vector ref: ");
else if (TREE_CODE (dr_base_type) == RECORD_TYPE) else if (TREE_CODE (dr_base_type) == RECORD_TYPE)
dump_printf (MSG_NOTE, " vectorizing a record based array ref: "); dump_printf (MSG_NOTE, " vectorizing a record based array ref: ");
else else
......
...@@ -667,6 +667,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, ...@@ -667,6 +667,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|| rhs_code != IMAGPART_EXPR) || rhs_code != IMAGPART_EXPR)
&& !(STMT_VINFO_GROUPED_ACCESS (vinfo_for_stmt (stmt)) && !(STMT_VINFO_GROUPED_ACCESS (vinfo_for_stmt (stmt))
&& (first_stmt_code == ARRAY_REF && (first_stmt_code == ARRAY_REF
|| first_stmt_code == BIT_FIELD_REF
|| first_stmt_code == INDIRECT_REF || first_stmt_code == INDIRECT_REF
|| first_stmt_code == COMPONENT_REF || first_stmt_code == COMPONENT_REF
|| first_stmt_code == MEM_REF))) || first_stmt_code == MEM_REF)))
......
...@@ -3851,6 +3851,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -3851,6 +3851,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
&& is_pattern_stmt_p (stmt_info)) && is_pattern_stmt_p (stmt_info))
scalar_dest = TREE_OPERAND (scalar_dest, 0); scalar_dest = TREE_OPERAND (scalar_dest, 0);
if (TREE_CODE (scalar_dest) != ARRAY_REF if (TREE_CODE (scalar_dest) != ARRAY_REF
&& TREE_CODE (scalar_dest) != BIT_FIELD_REF
&& TREE_CODE (scalar_dest) != INDIRECT_REF && TREE_CODE (scalar_dest) != INDIRECT_REF
&& TREE_CODE (scalar_dest) != COMPONENT_REF && TREE_CODE (scalar_dest) != COMPONENT_REF
&& TREE_CODE (scalar_dest) != IMAGPART_EXPR && TREE_CODE (scalar_dest) != IMAGPART_EXPR
...@@ -4385,6 +4386,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -4385,6 +4386,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
code = gimple_assign_rhs_code (stmt); code = gimple_assign_rhs_code (stmt);
if (code != ARRAY_REF if (code != ARRAY_REF
&& code != BIT_FIELD_REF
&& code != INDIRECT_REF && code != INDIRECT_REF
&& code != COMPONENT_REF && code != COMPONENT_REF
&& code != IMAGPART_EXPR && code != IMAGPART_EXPR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment