Commit 1b29f05e by Eric Botcazou Committed by Eric Botcazou

tree-vectorizer.h (vect_create_data_ref_ptr): Adjust prototype.

	* tree-vectorizer.h (vect_create_data_ref_ptr): Adjust prototype.
	* tree-vect-data-refs.c (vect_create_data_ref_ptr): Add GSI parameter.
	Insert new statements at it in lieu of STMT.
	(vect_setup_realignment): Adjust call to vect_create_data_ref_ptr.
	* tree-vect-stmts.c (vectorizable_store): Likewise.
	(vectorizable_load): Likewise.

From-SVN: r171592
parent 506e6808
2011-03-28 Eric Botcazou <ebotcazou@adacore.com>
* tree-vectorizer.h (vect_create_data_ref_ptr): Adjust prototype.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Add GSI parameter.
Insert new statements at it in lieu of STMT.
(vect_setup_realignment): Adjust call to vect_create_data_ref_ptr.
* tree-vect-stmts.c (vectorizable_store): Likewise.
(vectorizable_load): Likewise.
2011-03-28 Uros Bizjak <ubizjak@gmail.com> 2011-03-28 Uros Bizjak <ubizjak@gmail.com>
* config/alpha/alpha.md (addtf3): Change mode of operands to TFmode. * config/alpha/alpha.md (addtf3): Change mode of operands to TFmode.
......
2011-03-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/slp-1.c: New test.
2011-03-27 H.J. Lu <hongjiu.lu@intel.com> 2011-03-27 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/avx256-unaligned-load-1.c: New. * gcc.target/i386/avx256-unaligned-load-1.c: New.
......
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model" } */
struct R {
double d1;
double d2;
};
struct R foo (struct R arg)
{
struct R ret;
ret.d1 = arg.d2 * (0.0 - arg.d1);
ret.d2 = ret.d1;
return ret;
}
...@@ -2922,9 +2922,10 @@ vect_create_addr_base_for_vector_ref (gimple stmt, ...@@ -2922,9 +2922,10 @@ vect_create_addr_base_for_vector_ref (gimple stmt,
2. AT_LOOP: the loop where the vector memref is to be created. 2. AT_LOOP: the loop where the vector memref is to be created.
3. OFFSET (optional): an offset to be added to the initial address accessed 3. OFFSET (optional): an offset to be added to the initial address accessed
by the data-ref in STMT. by the data-ref in STMT.
4. ONLY_INIT: indicate if vp is to be updated in the loop, or remain 4. BSI: location where the new stmts are to be placed if there is no loop
5. ONLY_INIT: indicate if vp is to be updated in the loop, or remain
pointing to the initial address. pointing to the initial address.
5. TYPE: if not NULL indicates the required type of the data-ref. 6. TYPE: if not NULL indicates the required type of the data-ref.
Output: Output:
1. Declare a new ptr to vector_type, and have it point to the base of the 1. Declare a new ptr to vector_type, and have it point to the base of the
...@@ -2952,9 +2953,9 @@ vect_create_addr_base_for_vector_ref (gimple stmt, ...@@ -2952,9 +2953,9 @@ vect_create_addr_base_for_vector_ref (gimple stmt,
4. Return the pointer. */ 4. Return the pointer. */
tree tree
vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop, vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop, tree offset,
tree offset, tree *initial_address, gimple *ptr_incr, tree *initial_address, gimple_stmt_iterator *gsi,
bool only_init, bool *inv_p) gimple *ptr_incr, bool only_init, bool *inv_p)
{ {
tree base_name; tree base_name;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt); stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
...@@ -2980,7 +2981,6 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop, ...@@ -2980,7 +2981,6 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
gimple incr; gimple incr;
tree step; tree step;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
tree base; tree base;
if (loop_vinfo) if (loop_vinfo)
...@@ -3125,7 +3125,7 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop, ...@@ -3125,7 +3125,7 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
gcc_assert (!new_bb); gcc_assert (!new_bb);
} }
else else
gsi_insert_seq_before (&gsi, new_stmt_list, GSI_SAME_STMT); gsi_insert_seq_before (gsi, new_stmt_list, GSI_SAME_STMT);
} }
*initial_address = new_temp; *initial_address = new_temp;
...@@ -3147,7 +3147,7 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop, ...@@ -3147,7 +3147,7 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
gcc_assert (!new_bb); gcc_assert (!new_bb);
} }
else else
gsi_insert_before (&gsi, vec_stmt, GSI_SAME_STMT); gsi_insert_before (gsi, vec_stmt, GSI_SAME_STMT);
} }
else else
vect_ptr_init = new_temp; vect_ptr_init = new_temp;
...@@ -3672,7 +3672,7 @@ vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi, ...@@ -3672,7 +3672,7 @@ vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi,
gcc_assert (!compute_in_loop); gcc_assert (!compute_in_loop);
vec_dest = vect_create_destination_var (scalar_dest, vectype); vec_dest = vect_create_destination_var (scalar_dest, vectype);
ptr = vect_create_data_ref_ptr (stmt, loop_for_initial_load, NULL_TREE, ptr = vect_create_data_ref_ptr (stmt, loop_for_initial_load, NULL_TREE,
&init_addr, &inc, true, &inv_p); &init_addr, NULL, &inc, true, &inv_p);
new_stmt = gimple_build_assign_with_ops new_stmt = gimple_build_assign_with_ops
(BIT_AND_EXPR, NULL_TREE, ptr, (BIT_AND_EXPR, NULL_TREE, ptr,
build_int_cst (TREE_TYPE (ptr), build_int_cst (TREE_TYPE (ptr),
......
...@@ -3582,7 +3582,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -3582,7 +3582,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
gcc_assert (useless_type_conversion_p (vectype, gcc_assert (useless_type_conversion_p (vectype,
TREE_TYPE (vec_oprnd))); TREE_TYPE (vec_oprnd)));
dataref_ptr = vect_create_data_ref_ptr (first_stmt, NULL, NULL_TREE, dataref_ptr = vect_create_data_ref_ptr (first_stmt, NULL, NULL_TREE,
&dummy, &ptr_incr, false, &dummy, gsi, &ptr_incr, false,
&inv_p); &inv_p);
gcc_assert (bb_vinfo || !inv_p); gcc_assert (bb_vinfo || !inv_p);
} }
...@@ -4109,9 +4109,8 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -4109,9 +4109,8 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
{ {
/* 1. Create the vector pointer update chain. */ /* 1. Create the vector pointer update chain. */
if (j == 0) if (j == 0)
dataref_ptr = vect_create_data_ref_ptr (first_stmt, dataref_ptr = vect_create_data_ref_ptr (first_stmt, at_loop, offset,
at_loop, offset, &dummy, gsi, &ptr_incr, false,
&dummy, &ptr_incr, false,
&inv_p); &inv_p);
else else
dataref_ptr = dataref_ptr =
......
...@@ -824,7 +824,8 @@ extern bool vect_analyze_data_ref_accesses (loop_vec_info, bb_vec_info); ...@@ -824,7 +824,8 @@ extern bool vect_analyze_data_ref_accesses (loop_vec_info, bb_vec_info);
extern bool vect_prune_runtime_alias_test_list (loop_vec_info); extern bool vect_prune_runtime_alias_test_list (loop_vec_info);
extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *); extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *);
extern tree vect_create_data_ref_ptr (gimple, struct loop *, tree, tree *, extern tree vect_create_data_ref_ptr (gimple, struct loop *, tree, tree *,
gimple *, bool, bool *); gimple_stmt_iterator *, gimple *,
bool, bool *);
extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree); extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree);
extern tree vect_create_destination_var (tree, tree); extern tree vect_create_destination_var (tree, tree);
extern bool vect_strided_store_supported (tree); extern bool vect_strided_store_supported (tree);
......
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