summaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-21 00:20:02 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-21 00:20:02 +0000
commit749ea85f0162cbb4f17e2c28b779260bc3a6da36 (patch)
tree5936129bd622c7aef21ba556b43971c620090ebd /gcc/loop-unroll.c
parent6be83e11b7b2d28522bc0d005448633ffd9abd1f (diff)
downloadgcc-749ea85f0162cbb4f17e2c28b779260bc3a6da36.tar.gz
* tree-ssa-loop-im.c (schedule_sm, determine_lsm_ref,
hoist_memory_references, loop_suitable_for_sm, determine_lsm_loop): Use vector of edges instead of array. * tree-ssa-loop-niter.c (find_loop_niter, find_loop_niter_by_eval, estimate_numbers_of_iterations_loop): Ditto. * predict.c (predict_loops): Ditto. * loop-unroll.c (analyze_insns_in_loop): Ditto. * tree-ssa-threadupdate.c: Remove declaration of heap allocation for edge vectors. * basic-block.h: Declare heap allocation for edge vectors. * tree-outof-ssa.c: Ditto. * cfgloop.c (get_loop_exit_edges): Return vector of edges. * cfgloop.h (get_loop_exit_edges): Declaration changed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119039 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r--gcc/loop-unroll.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 49af45d4073..7d230fb6f3a 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -1709,14 +1709,15 @@ static struct opt_info *
analyze_insns_in_loop (struct loop *loop)
{
basic_block *body, bb;
- unsigned i, num_edges = 0;
+ unsigned i;
struct opt_info *opt_info = XCNEW (struct opt_info);
rtx insn;
struct iv_to_split *ivts = NULL;
struct var_to_expand *ves = NULL;
PTR *slot1;
PTR *slot2;
- edge *edges = get_loop_exit_edges (loop, &num_edges);
+ VEC (edge, heap) *edges = get_loop_exit_edges (loop);
+ edge exit;
bool can_apply = false;
iv_analysis_loop_init (loop);
@@ -1730,11 +1731,14 @@ analyze_insns_in_loop (struct loop *loop)
/* Record the loop exit bb and loop preheader before the unrolling. */
opt_info->loop_preheader = loop_preheader_edge (loop)->src;
- if (num_edges == 1
- && !(edges[0]->flags & EDGE_COMPLEX))
+ if (VEC_length (edge, edges) == 1)
{
- opt_info->loop_exit = split_edge (edges[0]);
- can_apply = true;
+ exit = VEC_index (edge, edges, 0);
+ if (!(exit->flags & EDGE_COMPLEX))
+ {
+ opt_info->loop_exit = split_edge (exit);
+ can_apply = true;
+ }
}
if (flag_variable_expansion_in_unroller
@@ -1774,7 +1778,7 @@ analyze_insns_in_loop (struct loop *loop)
}
}
- free (edges);
+ VEC_free (edge, heap, edges);
free (body);
return opt_info;
}