aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-12-07 18:40:50 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-12-07 18:40:50 +0000
commit5ebaa4774fb6de458422c660ae11f1c3b7d96262 (patch)
tree7f5cb9043bbc4cb3bbc2359234b0e6bd0eb216f1 /gcc/expmed.c
parent734914b6e230b78eb6c34fbd5a2d93b1a919d36a (diff)
downloadgcc-5ebaa4774fb6de458422c660ae11f1c3b7d96262.zip
gcc-5ebaa4774fb6de458422c660ae11f1c3b7d96262.tar.gz
gcc-5ebaa4774fb6de458422c660ae11f1c3b7d96262.tar.bz2
Use tree_vector_builder instead of build_vector
This patch switches most build_vector calls over to tree_vector_builder, using explicit encodings where appropriate. Later patches handle the remaining uses of build_vector. 2017-12-07 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * config/sparc/sparc.c: Include tree-vector-builder.h. (sparc_fold_builtin): Use tree_vector_builder instead of build_vector. * expmed.c: Include tree-vector-builder.h. (make_tree): Use tree_vector_builder instead of build_vector. * fold-const.c: Include tree-vector-builder.h. (const_binop): Use tree_vector_builder instead of build_vector. (const_unop): Likewise. (native_interpret_vector): Likewise. (fold_vec_perm): Likewise. (fold_ternary_loc): Likewise. * gimple-fold.c: Include tree-vector-builder.h. (gimple_fold_stmt_to_constant_1): Use tree_vector_builder instead of build_vector. * tree-ssa-forwprop.c: Include tree-vector-builder.h. (simplify_vector_constructor): Use tree_vector_builder instead of build_vector. * tree-vect-generic.c: Include tree-vector-builder.h. (add_rshift): Use tree_vector_builder instead of build_vector. (expand_vector_divmod): Likewise. (optimize_vector_constructor): Likewise. * tree-vect-loop.c: Include tree-vector-builder.h. (vect_create_epilog_for_reduction): Use tree_vector_builder instead of build_vector. Explicitly use a stepped encoding for { 1, 2, 3, ... }. * tree-vect-slp.c: Include tree-vector-builder.h. (vect_get_constant_vectors): Use tree_vector_builder instead of build_vector. (vect_transform_slp_perm_load): Likewise. (vect_schedule_slp_instance): Likewise. * tree-vect-stmts.c: Include tree-vector-builder.h. (vectorizable_bswap): Use tree_vector_builder instead of build_vector. (vect_gen_perm_mask_any): Likewise. (vectorizable_call): Likewise. Explicitly use a stepped encoding. * tree.c: (build_vector_from_ctor): Use tree_vector_builder instead of build_vector. (build_vector_from_val): Likewise. Explicitly use a duplicate encoding. From-SVN: r255475
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index dacb2b97..f072a94 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "explow.h"
#include "expr.h"
#include "langhooks.h"
+#include "tree-vector-builder.h"
struct target_expmed default_target_expmed;
#if SWITCHABLE_TARGET
@@ -5184,14 +5185,14 @@ make_tree (tree type, rtx x)
int i;
/* Build a tree with vector elements. */
- auto_vec<tree, 32> elts (units);
+ tree_vector_builder elts (type, units, 1);
for (i = 0; i < units; ++i)
{
rtx elt = CONST_VECTOR_ELT (x, i);
elts.quick_push (make_tree (itype, elt));
}
- return build_vector (type, elts);
+ return elts.build ();
}
case PLUS: