aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-02 18:26:56 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-02 18:26:56 +0000
commit736d0f28783f12fa042892bc186866dd5101088f (patch)
tree54c83634cd4ce7f8d3f8660188d476af4c271b1b /gcc/tree-ssa-forwprop.c
parente3342de49cbee48957acc749b9566eee230860be (diff)
downloadgcc-736d0f28783f12fa042892bc186866dd5101088f.zip
gcc-736d0f28783f12fa042892bc186866dd5101088f.tar.gz
gcc-736d0f28783f12fa042892bc186866dd5101088f.tar.bz2
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 <richard.sandiford@linaro.org> 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
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c5
1 files changed, 1 insertions, 4 deletions
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