From b71850a14347919db4d7730b291fefa22eb5d21e Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 5 Mar 2013 09:38:48 +0000 Subject: [PATCH] PR middle-end/56461 * tree-ssa-loop-niter.c (bb_queue): Remove typedef. (discover_iteration_bound_by_body_walk): Change queues to vec > and queue to vec. Fix up spelling in comment. Call safe_push on queues[bound_index] directly. Release queues[queue_index] in every iteration unconditionally. Release bounds vector. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196454 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-ssa-loop-niter.c | 19 ++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc0500c..3a1b71b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,14 @@ 2013-03-05 Jakub Jelinek PR middle-end/56461 + * tree-ssa-loop-niter.c (bb_queue): Remove typedef. + (discover_iteration_bound_by_body_walk): Change queues to + vec > and queue to vec. Fix up + spelling in comment. Call safe_push on queues[bound_index] directly. + Release queues[queue_index] in every iteration unconditionally. + Release bounds vector. + + PR middle-end/56461 * tree-vect-stmts.c (free_stmt_vec_info_vec): Call free_stmt_vec_info on any left-over stmt_vec_info in the vector. * tree-vect-loop.c (vect_create_epilog_for_reduction): Release diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 744fa71..ba06b0c 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -3007,9 +3007,6 @@ bound_index (vec bounds, double_int bound) gcc_unreachable (); } -/* Used to hold vector of queues of basic blocks bellow. */ -typedef vec bb_queue; - /* We recorded loop bounds only for statements dominating loop latch (and thus executed each loop iteration). If there are any bounds on statements not dominating the loop latch we can improve the estimate by walking the loop @@ -3022,8 +3019,8 @@ discover_iteration_bound_by_body_walk (struct loop *loop) pointer_map_t *bb_bounds; struct nb_iter_bound *elt; vec bounds = vNULL; - vec queues = vNULL; - bb_queue queue = bb_queue(); + vec > queues = vNULL; + vec queue = vNULL; ptrdiff_t queue_index; ptrdiff_t latch_index = 0; pointer_map_t *block_priority; @@ -3096,7 +3093,7 @@ discover_iteration_bound_by_body_walk (struct loop *loop) present in the path and we look for path with largest smallest bound on it. - To avoid the need for fibonaci heap on double ints we simply compress + To avoid the need for fibonacci heap on double ints we simply compress double ints into indexes to BOUNDS array and then represent the queue as arrays of queues for every index. Index of BOUNDS.length() means that the execution of given BB has @@ -3162,16 +3159,11 @@ discover_iteration_bound_by_body_walk (struct loop *loop) } if (insert) - { - bb_queue queue2 = queues[bound_index]; - queue2.safe_push (e->dest); - queues[bound_index] = queue2; - } + queues[bound_index].safe_push (e->dest); } } } - else - queues[queue_index].release (); + queues[queue_index].release (); } gcc_assert (latch_index >= 0); @@ -3187,6 +3179,7 @@ discover_iteration_bound_by_body_walk (struct loop *loop) } queues.release (); + bounds.release (); pointer_map_destroy (bb_bounds); pointer_map_destroy (block_priority); } -- 2.7.4