summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-31 02:20:22 +0000
committerfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-31 02:20:22 +0000
commitb797154e4efc9a4005016639715cc0b6330bf97a (patch)
tree1690b9c80ac2985f27e7ba09fccad0152877304c /gcc/tree-vect-loop.c
parent709947e6442d38fcffafeb91992d913e45a70674 (diff)
downloadgcc-b797154e4efc9a4005016639715cc0b6330bf97a.tar.gz
* fold-const.c (build_zero_vector): Use build_vector_from_val.
* tree-vect-loop.c (get_initial_def_for_induction): Likewise. (get_initial_def_for_reduction): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * tree-vect-stmts.c (vect_get_vec_def_for_operand): Likewise. * tree.c (build_one_cst): Likewise. (build_vector_from_val): Use types_compatible_p for assert. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166102 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 4b1bd443054..c213673e20b 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2725,13 +2725,11 @@ get_initial_def_for_induction (gimple iv_phi)
expr, step_expr);
}
- t = NULL_TREE;
- for (i = 0; i < nunits; i++)
- t = tree_cons (NULL_TREE, unshare_expr (new_name), t);
+ t = unshare_expr (new_name);
gcc_assert (CONSTANT_CLASS_P (new_name));
stepvectype = get_vectype_for_scalar_type (TREE_TYPE (new_name));
gcc_assert (stepvectype);
- vec = build_vector (stepvectype, t);
+ vec = build_vector_from_val (stepvectype, t);
vec_step = vect_init_vector (iv_phi, vec, stepvectype, NULL);
@@ -2785,11 +2783,9 @@ get_initial_def_for_induction (gimple iv_phi)
expr = build_int_cst (TREE_TYPE (step_expr), nunits);
new_name = fold_build2 (MULT_EXPR, TREE_TYPE (step_expr),
expr, step_expr);
- t = NULL_TREE;
- for (i = 0; i < nunits; i++)
- t = tree_cons (NULL_TREE, unshare_expr (new_name), t);
+ t = unshare_expr (new_name);
gcc_assert (CONSTANT_CLASS_P (new_name));
- vec = build_vector (stepvectype, t);
+ vec = build_vector_from_val (stepvectype, t);
vec_step = vect_init_vector (iv_phi, vec, stepvectype, NULL);
vec_def = induc_def;
@@ -3021,14 +3017,7 @@ get_initial_def_for_reduction (gimple stmt, tree init_val,
break;
}
- for (i = nunits - 1; i >= 0; --i)
- t = tree_cons (NULL_TREE, init_value, t);
-
- if (TREE_CONSTANT (init_val))
- init_def = build_vector (vectype, t);
- else
- init_def = build_constructor_from_list (vectype, t);
-
+ init_def = build_vector_from_val (vectype, init_value);
break;
default: