diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-01 20:31:32 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-01 20:31:32 +0000 |
commit | e85cf4e5d0d8c9388d3eaaaa606b5db4e9ed62e8 (patch) | |
tree | 9b926d72ddfbc7904a373e59872f1d07b4e4e417 /gcc/tree-loop-distribution.c | |
parent | d3af0a3acf4b64d04df69c244c047c1294f72b38 (diff) | |
download | gcc-e85cf4e5d0d8c9388d3eaaaa606b5db4e9ed62e8.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204301 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r-- | gcc/tree-loop-distribution.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 353ce247de0..79884bf4272 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -436,17 +436,15 @@ static struct graph * build_rdg (vec<loop_p> loop_nest, control_dependences *cd) { struct graph *rdg; - vec<gimple> stmts; vec<data_reference_p> datarefs; /* Create the RDG vertices from the stmts of the loop nest. */ - stmts.create (10); + stack_vec<gimple, 10> stmts; stmts_from_loop (loop_nest[0], &stmts); rdg = new_graph (stmts.length ()); datarefs.create (10); if (!create_rdg_vertices (rdg, stmts, loop_nest[0], &datarefs)) { - stmts.release (); datarefs.release (); free_rdg (rdg); return NULL; @@ -951,11 +949,10 @@ static partition_t build_rdg_partition_for_vertex (struct graph *rdg, int v) { partition_t partition = partition_alloc (NULL, NULL); - vec<int> nodes; + stack_vec<int, 3> nodes; unsigned i; int x; - nodes.create (3); graphds_dfs (rdg, &v, 1, &nodes, false, NULL); FOR_EACH_VEC_ELT (nodes, i, x) @@ -965,7 +962,6 @@ build_rdg_partition_for_vertex (struct graph *rdg, int v) loop_containing_stmt (RDG_STMT (rdg, x))->num); } - nodes.release (); return partition; } @@ -1388,7 +1384,6 @@ distribute_loop (struct loop *loop, vec<gimple> stmts, control_dependences *cd, int *nb_calls) { struct graph *rdg; - vec<loop_p> loop_nest; vec<partition_t> partitions; partition_t partition; bool any_builtin; @@ -1397,12 +1392,9 @@ distribute_loop (struct loop *loop, vec<gimple> stmts, int num_sccs = 1; *nb_calls = 0; - loop_nest.create (3); + stack_vec<loop_p, 3> loop_nest; if (!find_loop_nest (loop, &loop_nest)) - { - loop_nest.release (); - return 0; - } + return 0; rdg = build_rdg (loop_nest, cd); if (!rdg) @@ -1412,7 +1404,6 @@ distribute_loop (struct loop *loop, vec<gimple> stmts, "Loop %d not distributed: failed to build the RDG.\n", loop->num); - loop_nest.release (); return 0; } @@ -1648,7 +1639,6 @@ distribute_loop (struct loop *loop, vec<gimple> stmts, partitions.release (); free_rdg (rdg); - loop_nest.release (); return nbp - *nb_calls; } |