aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2012-11-20 16:21:30 -0500
committerDiego Novillo <dnovillo@gcc.gnu.org>2012-11-20 16:21:30 -0500
commit6e1aa84836e166fbfb4b53ac004d1d63e03d9f05 (patch)
treedf5dd32febb0dc65ea6ce7f725aab90791a1dbc4 /gcc/tree-vect-stmts.c
parentb014e124e46edd418d02316ce4c65563d0568ad8 (diff)
downloadgcc-6e1aa84836e166fbfb4b53ac004d1d63e03d9f05.zip
gcc-6e1aa84836e166fbfb4b53ac004d1d63e03d9f05.tar.gz
gcc-6e1aa84836e166fbfb4b53ac004d1d63e03d9f05.tar.bz2
Introduce vNULL to use as a nil initializer for vec<>.
This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index cfe1275..1e8d7ee 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1722,7 +1722,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
= {vect_unknown_def_type, vect_unknown_def_type, vect_unknown_def_type};
gimple new_stmt = NULL;
int ncopies, j;
- vec<tree> vargs = vec<tree>();
+ vec<tree> vargs = vNULL;
enum { NARROW, NONE, WIDEN } modifier;
size_t i, nargs;
tree lhs;
@@ -2239,7 +2239,7 @@ vect_create_vectorized_promotion_stmts (vec<tree> *vec_oprnds0,
int i;
tree vop0, vop1, new_tmp1, new_tmp2;
gimple new_stmt1, new_stmt2;
- vec<tree> vec_tmp = vec<tree>();
+ vec<tree> vec_tmp = vNULL;
vec_tmp.create (vec_oprnds0->length () * 2);
FOR_EACH_VEC_ELT (*vec_oprnds0, i, vop0)
@@ -2305,13 +2305,13 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
int ncopies, i, j;
tree lhs_type, rhs_type;
enum { NARROW, NONE, WIDEN } modifier;
- vec<tree> vec_oprnds0 = vec<tree>();
- vec<tree> vec_oprnds1 = vec<tree>();
+ vec<tree> vec_oprnds0 = vNULL;
+ vec<tree> vec_oprnds1 = vNULL;
tree vop0;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
int multi_step_cvt = 0;
- vec<tree> vec_dsts = vec<tree>();
- vec<tree> interm_types = vec<tree>();
+ vec<tree> vec_dsts = vNULL;
+ vec<tree> interm_types = vNULL;
tree last_oprnd, intermediate_type, cvt_type = NULL_TREE;
int op_type;
enum machine_mode rhs_mode;
@@ -2878,7 +2878,7 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
unsigned int nunits = TYPE_VECTOR_SUBPARTS (vectype);
int ncopies;
int i, j;
- vec<tree> vec_oprnds = vec<tree>();
+ vec<tree> vec_oprnds = vNULL;
tree vop;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
gimple new_stmt = NULL;
@@ -3087,8 +3087,8 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi,
tree op1_vectype;
int ncopies;
int j, i;
- vec<tree> vec_oprnds0 = vec<tree>();
- vec<tree> vec_oprnds1 = vec<tree>();
+ vec<tree> vec_oprnds0 = vNULL;
+ vec<tree> vec_oprnds1 = vNULL;
tree vop0, vop1;
unsigned int k;
bool scalar_shift_arg = true;
@@ -3465,9 +3465,9 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
tree vectype_out;
int ncopies;
int j, i;
- vec<tree> vec_oprnds0 = vec<tree>();
- vec<tree> vec_oprnds1 = vec<tree>();
- vec<tree> vec_oprnds2 = vec<tree>();
+ vec<tree> vec_oprnds0 = vNULL;
+ vec<tree> vec_oprnds1 = vNULL;
+ vec<tree> vec_oprnds2 = vNULL;
tree vop0, vop1, vop2;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
int vf;
@@ -3820,11 +3820,11 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
bool grouped_store = false;
bool store_lanes_p = false;
unsigned int group_size, i;
- vec<tree> dr_chain = vec<tree>();
- vec<tree> oprnds = vec<tree>();
- vec<tree> result_chain = vec<tree>();
+ vec<tree> dr_chain = vNULL;
+ vec<tree> oprnds = vNULL;
+ vec<tree> result_chain = vNULL;
bool inv_p;
- vec<tree> vec_oprnds = vec<tree>();
+ vec<tree> vec_oprnds = vNULL;
bool slp = (slp_node != NULL);
unsigned int vec_num;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
@@ -4337,7 +4337,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
tree offset = NULL_TREE;
tree realignment_token = NULL_TREE;
gimple phi = NULL;
- vec<tree> dr_chain = vec<tree>();
+ vec<tree> dr_chain = vNULL;
bool grouped_load = false;
bool load_lanes_p = false;
gimple first_stmt;
@@ -5290,10 +5290,10 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
stmt_vec_info prev_stmt_info = NULL;
int i, j;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
- vec<tree> vec_oprnds0 = vec<tree>();
- vec<tree> vec_oprnds1 = vec<tree>();
- vec<tree> vec_oprnds2 = vec<tree>();
- vec<tree> vec_oprnds3 = vec<tree>();
+ vec<tree> vec_oprnds0 = vNULL;
+ vec<tree> vec_oprnds1 = vNULL;
+ vec<tree> vec_oprnds2 = vNULL;
+ vec<tree> vec_oprnds3 = vNULL;
tree vec_cmp_type = vectype;
if (slp_node || PURE_SLP_STMT (stmt_info))