From 736d0f28783f12fa042892bc186866dd5101088f Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 2 Jan 2018 18:26:56 +0000 Subject: Add a vec_perm_indices_to_tree helper function This patch adds a function for creating a VECTOR_CST from a vec_perm_indices, operating directly on the encoding. 2018-01-02 Richard Sandiford gcc/ * vec-perm-indices.h (vec_perm_indices_to_tree): Declare. * vec-perm-indices.c (vec_perm_indices_to_tree): New function. * tree-ssa-forwprop.c (simplify_vector_constructor): Use it. * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise. * tree-vect-stmts.c (vectorizable_bswap): Likewise. (vect_gen_perm_mask_any): Likewise. From-SVN: r256096 --- gcc/tree-ssa-forwprop.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gcc/tree-ssa-forwprop.c') diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 41eef51..ff8d976 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -2119,10 +2119,7 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) || GET_MODE_SIZE (TYPE_MODE (mask_type)) != GET_MODE_SIZE (TYPE_MODE (type))) return false; - tree_vector_builder mask_elts (mask_type, nelts, 1); - for (i = 0; i < nelts; i++) - mask_elts.quick_push (build_int_cst (TREE_TYPE (mask_type), sel[i])); - op2 = mask_elts.build (); + op2 = vec_perm_indices_to_tree (mask_type, indices); if (conv_code == ERROR_MARK) gimple_assign_set_rhs_with_ops (gsi, VEC_PERM_EXPR, orig, orig, op2); else -- cgit v1.1