/* Natural loop discovery code for GNU compiler.
- Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
struct loop *
alloc_loop (void)
{
- struct loop *loop = GGC_CNEW (struct loop);
+ struct loop *loop = ggc_alloc_cleared_loop ();
- loop->exits = GGC_CNEW (struct loop_exit);
+ loop->exits = ggc_alloc_cleared_loop_exit ();
loop->exits->next = loop->exits->prev = loop->exits;
+ loop->can_be_parallel = false;
+ loop->single_iv = NULL_TREE;
return loop;
}
profile is usually too flat and unreliable for this (and it is mostly based
on the loop structure of the program, so it does not make much sense to
derive the loop structure from it). */
-
+
static edge
find_subloop_latch_edge_by_profile (VEC (edge, heap) *latches)
{
edge_iterator ei;
edge e, new_entry;
struct loop *new_loop;
-
+
mfb_reis_set = pointer_set_create ();
FOR_EACH_EDGE (e, ei, loop->header->preds)
{
/* Gets body of a LOOP sorted via provided BB_COMPARATOR. */
basic_block *
-get_loop_body_in_custom_order (const struct loop *loop,
+get_loop_body_in_custom_order (const struct loop *loop,
int (*bb_comparator) (const void *, const void *))
{
basic_block *bbs = get_loop_body (loop);
for (; exit; exit = next)
{
next = exit->next_e;
-
+
exit->next->prev = exit->prev;
exit->prev->next = exit->next;
aloop != cloop;
aloop = loop_outer (aloop))
{
- exit = GGC_NEW (struct loop_exit);
+ exit = ggc_alloc_loop_exit ();
exit->e = e;
exit->next = aloop->exits->next;
exit->next_e = exits;
exits = exit;
}
- }
+ }
if (!exits && new_edge)
return;
loops_state_set (LOOPS_HAVE_RECORDED_EXITS);
gcc_assert (current_loops->exits == NULL);
- current_loops->exits = htab_create_alloc (2 * number_of_loops (),
- loop_exit_hash,
- loop_exit_eq,
- loop_exit_free,
- ggc_calloc, ggc_free);
+ current_loops->exits = htab_create_ggc (2 * number_of_loops (),
+ loop_exit_hash, loop_exit_eq,
+ loop_exit_free);
FOR_EACH_BB (bb)
{
-- loop latches have only single successor that is header of their loop
-- irreducible loops are correctly marked
*/
-void
+DEBUG_FUNCTION void
verify_loop_structure (void)
{
unsigned *sizes, i, j;
exit = get_exit_descriptions (e);
if (!exit)
{
- error ("Exit %d->%d not recorded",
+ error ("Exit %d->%d not recorded",
e->src->index, e->dest->index);
err = 1;
}
if (eloops != 0)
{
- error ("Wrong list of exited loops for edge %d->%d",
+ error ("Wrong list of exited loops for edge %d->%d",
e->src->index, e->dest->index);
err = 1;
}