summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-16 12:44:46 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-16 12:44:46 +0000
commit1efcacec695000770deef50698e4d3d5eb2c8b05 (patch)
tree6d0cf456ca1d23a6929bcb816d7d099e283934cd /gcc/tree-vect-loop.c
parent0793eba56f0ea360620c1e8948899d00cb11a7b4 (diff)
downloadgcc-1efcacec695000770deef50698e4d3d5eb2c8b05.tar.gz
2009-04-16 Richard Guenther <rguenther@suse.de>
Ira Rosen <irar@il.ibm.com> PR tree-optimization/39698 * tree-vect-loop.c (get_initial_def_for_reduction): Use the type of the reduction variable. Only generate the def if it is needed. * omp-low.c (expand_omp_for_generic): When converting to a pointer make sure to first convert to an integer of the same precision. * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Retain the type of the evolution correctly in computing the new induction variable base. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146180 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 9ae4403f38c..d78fa99ff8b 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2267,33 +2267,33 @@ get_initial_def_for_reduction (gimple stmt, tree init_val, tree *adjustment_def)
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
- int nunits = TYPE_VECTOR_SUBPARTS (vectype);
- tree scalar_type = TREE_TYPE (vectype);
+ tree scalar_type = TREE_TYPE (init_val);
+ tree vectype = get_vectype_for_scalar_type (scalar_type);
+ int nunits;
enum tree_code code = gimple_assign_rhs_code (stmt);
- tree type = TREE_TYPE (init_val);
- tree vecdef;
tree def_for_init;
tree init_def;
tree t = NULL_TREE;
int i;
bool nested_in_vect_loop = false;
- gcc_assert (POINTER_TYPE_P (type) || INTEGRAL_TYPE_P (type) || SCALAR_FLOAT_TYPE_P (type));
+ gcc_assert (vectype);
+ nunits = TYPE_VECTOR_SUBPARTS (vectype);
+
+ gcc_assert (POINTER_TYPE_P (scalar_type) || INTEGRAL_TYPE_P (scalar_type)
+ || SCALAR_FLOAT_TYPE_P (scalar_type));
if (nested_in_vect_loop_p (loop, stmt))
nested_in_vect_loop = true;
else
gcc_assert (loop == (gimple_bb (stmt))->loop_father);
- vecdef = vect_get_vec_def_for_operand (init_val, stmt, NULL);
-
switch (code)
{
case WIDEN_SUM_EXPR:
case DOT_PROD_EXPR:
case PLUS_EXPR:
if (nested_in_vect_loop)
- *adjustment_def = vecdef;
+ *adjustment_def = vect_get_vec_def_for_operand (init_val, stmt, NULL);
else
*adjustment_def = init_val;
/* Create a vector of zeros for init_def. */
@@ -2310,7 +2310,7 @@ get_initial_def_for_reduction (gimple stmt, tree init_val, tree *adjustment_def)
case MIN_EXPR:
case MAX_EXPR:
*adjustment_def = NULL_TREE;
- init_def = vecdef;
+ init_def = vect_get_vec_def_for_operand (init_val, stmt, NULL);
break;
default: