From b9acc9f1de4ef8a1cff7c495a3b26fcd3e2448c4 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sun, 31 Oct 2010 02:20:22 +0000 Subject: fold-const.c (build_zero_vector): Use build_vector_from_val. * 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. From-SVN: r166102 --- gcc/tree-vect-stmts.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'gcc/tree-vect-stmts.c') diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 01fd5cf..6f4f568 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -987,9 +987,7 @@ vect_get_vec_def_for_operand (tree op, gimple stmt, tree *scalar_def) loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo); tree vec_inv; tree vec_cst; - tree t = NULL_TREE; tree def; - int i; enum vect_def_type dt; bool is_simple_use; tree vector_type; @@ -1033,11 +1031,7 @@ vect_get_vec_def_for_operand (tree op, gimple stmt, tree *scalar_def) if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "Create vector_cst. nunits = %d", nunits); - for (i = nunits - 1; i >= 0; --i) - { - t = tree_cons (NULL_TREE, op, t); - } - vec_cst = build_vector (vector_type, t); + vec_cst = build_vector_from_val (vector_type, op); return vect_init_vector (stmt, vec_cst, vector_type, NULL); } @@ -1055,13 +1049,7 @@ vect_get_vec_def_for_operand (tree op, gimple stmt, tree *scalar_def) if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "Create vector_inv."); - for (i = nunits - 1; i >= 0; --i) - { - t = tree_cons (NULL_TREE, def, t); - } - - /* FIXME: use build_constructor directly. */ - vec_inv = build_constructor_from_list (vector_type, t); + vec_inv = build_vector_from_val (vector_type, def); return vect_init_vector (stmt, vec_inv, vector_type, NULL); } -- cgit v1.1