diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2013-11-01 20:31:32 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2013-11-01 16:31:32 -0400 |
commit | 07687835bea637072221fdcbeb11cf14c43986f7 (patch) | |
tree | 9b926d72ddfbc7904a373e59872f1d07b4e4e417 /gcc/graphite-sese-to-poly.c | |
parent | 654a6bb421af2e0aadccc0b29ce5af298519c8e9 (diff) | |
download | gcc-07687835bea637072221fdcbeb11cf14c43986f7.zip gcc-07687835bea637072221fdcbeb11cf14c43986f7.tar.gz gcc-07687835bea637072221fdcbeb11cf14c43986f7.tar.bz2 |
Replace some heap vectors with stack vectors.
From http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02735.html
This patch is pretty dull, it just replaces a bunch of things of the
form
vec<T> x;
x.create (N); // N is a constant
blah blah
x.release ();
by
stack_vec<T, N> x;
blah blah
2013-11-01 Trevor Saunders <tsaunders@mozilla.com>
gcc/
* function.c (reorder_blocks): Convert block_stack to a stack_vec.
* gimplify.c (gimplify_compound_lval): Likewise.
* graphite-clast-to-gimple.c (gloog): Likewise.
* graphite-dependences.c (loop_is_parallel_p): Likewise.
* graphite-scop-detection.c (scopdet_basic_block_info): Likewise.
(limit_scop); Likewise.
(build_scops): Likewise.
(dot_scop): Likewise.
* graphite-sese-to-poly.c (sese_dom_walker): Likewise.
(build_scop_drs): Likewise.
(insert_stmts): Likewise.
(insert_out_of_ssa_copy): Likewise.
(remove_phi): Likewise.
(rewrite_commutative_reductions_out_of_ssa_close_phi): Likewise.
* hw-doloop.c (discover_loop): Likewise.
* tree-call-cdce.c (shrink_wrap_one_built_in_call): Likewise.
* tree-dfa.c (dump_enumerated_decls): Likewise.
* tree-if-conv.c (if_convertable_loop_p): Likewise.
* tree-inline.c (tree_function_versioning): Likewise.
* tree-loop-distribution.c (build_rdg): Likewise.
(rdg_flag_vertex_and_dependent): Likewise.
(distribute_loop): Likewise.
* tree-parloops.c (loop_parallel_p): Likewise.
(eliminate_local_variables): Likewise.
(separate_decls_in_region): Likewise.
* tree-predcom.c (tree_predictive_commoning_loop): Likewise.
* tree-ssa-phiopt.c (cond_if_else_store_replacement): Likewise.
* tree-ssa-uncprop.c (uncprop_dom_walker): Likewise.
* tree-vect-loop.c (vect_analyze_scaler_cycles_1): Likewise.
* tree-vect-patterns.c (vect_pattern_recog): Likewise.
* tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Likewise.
(vectorizable_condition): Likewise.
gcc/cp/
* semantics.c (build_anon_member_initialization): Convert fields to be
a stack_vec.
From-SVN: r204301
Diffstat (limited to 'gcc/graphite-sese-to-poly.c')
-rw-r--r-- | gcc/graphite-sese-to-poly.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 7d4796e..6c2ac41 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -1231,27 +1231,18 @@ class sese_dom_walker : public dom_walker { public: sese_dom_walker (cdi_direction, sese); - ~sese_dom_walker (); virtual void before_dom_children (basic_block); virtual void after_dom_children (basic_block); private: - vec<gimple> m_conditions, m_cases; + stack_vec<gimple, 3> m_conditions, m_cases; sese m_region; }; sese_dom_walker::sese_dom_walker (cdi_direction direction, sese region) : dom_walker (direction), m_region (region) { - m_conditions.create (3); - m_cases.create (3); -} - -sese_dom_walker::~sese_dom_walker () -{ - m_conditions.release (); - m_cases.release (); } /* Call-back for dom_walk executed before visiting the dominated @@ -1890,8 +1881,7 @@ build_scop_drs (scop_p scop) int i, j; poly_bb_p pbb; data_reference_p dr; - vec<data_reference_p> drs; - drs.create (3); + stack_vec<data_reference_p, 3> drs; /* Remove all the PBBs that do not have data references: these basic blocks are not handled in the polyhedral representation. */ @@ -1989,8 +1979,7 @@ insert_stmts (scop_p scop, gimple stmt, gimple_seq stmts, gimple_stmt_iterator insert_gsi) { gimple_stmt_iterator gsi; - vec<gimple> x; - x.create (3); + stack_vec<gimple, 3> x; gimple_seq_add_stmt (&stmts, stmt); for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi)) @@ -1998,7 +1987,6 @@ insert_stmts (scop_p scop, gimple stmt, gimple_seq stmts, gsi_insert_seq_before (&insert_gsi, stmts, GSI_SAME_STMT); analyze_drs_in_stmts (scop, gsi_bb (insert_gsi), x); - x.release (); } /* Insert the assignment "RES := EXPR" just after AFTER_STMT. */ @@ -2010,8 +1998,7 @@ insert_out_of_ssa_copy (scop_p scop, tree res, tree expr, gimple after_stmt) gimple_stmt_iterator gsi; tree var = force_gimple_operand (expr, &stmts, true, NULL_TREE); gimple stmt = gimple_build_assign (unshare_expr (res), var); - vec<gimple> x; - x.create (3); + stack_vec<gimple, 3> x; gimple_seq_add_stmt (&stmts, stmt); for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi)) @@ -2029,7 +2016,6 @@ insert_out_of_ssa_copy (scop_p scop, tree res, tree expr, gimple after_stmt) } analyze_drs_in_stmts (scop, gimple_bb (after_stmt), x); - x.release (); } /* Creates a poly_bb_p for basic_block BB from the existing PBB. */ @@ -2067,8 +2053,7 @@ insert_out_of_ssa_copy_on_edge (scop_p scop, edge e, tree res, tree expr) tree var = force_gimple_operand (expr, &stmts, true, NULL_TREE); gimple stmt = gimple_build_assign (unshare_expr (res), var); basic_block bb; - vec<gimple> x; - x.create (3); + stack_vec<gimple, 3> x; gimple_seq_add_stmt (&stmts, stmt); for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi)) @@ -2085,7 +2070,6 @@ insert_out_of_ssa_copy_on_edge (scop_p scop, edge e, tree res, tree expr) new_pbb_from_pbb (scop, pbb_from_bb (e->src), bb); analyze_drs_in_stmts (scop, bb, x); - x.release (); } /* Creates a zero dimension array of the same type as VAR. */ @@ -2881,8 +2865,7 @@ remove_phi (gimple phi) tree def; use_operand_p use_p; gimple_stmt_iterator gsi; - vec<gimple> update; - update.create (3); + stack_vec<gimple, 3> update; unsigned int i; gimple stmt; @@ -2901,8 +2884,6 @@ remove_phi (gimple phi) FOR_EACH_VEC_ELT (update, i, stmt) update_stmt (stmt); - update.release (); - gsi = gsi_for_phi_node (phi); remove_phi_node (&gsi, false); } @@ -3042,18 +3023,14 @@ rewrite_commutative_reductions_out_of_ssa_close_phi (scop_p scop, gimple close_phi) { bool res; - vec<gimple> in; - in.create (10); - vec<gimple> out; - out.create (10); + stack_vec<gimple, 10> in; + stack_vec<gimple, 10> out; detect_commutative_reduction (scop, close_phi, &in, &out); res = in.length () > 1; if (res) translate_scalar_reduction_to_array (scop, in, out); - in.release (); - out.release (); return res; } |