#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
+#include "obstack.h"
#include "basic-block.h"
#include "toplev.h"
#include "cfgloop.h"
static void flow_loop_pre_header_scan (struct loop *);
static basic_block flow_loop_pre_header_find (basic_block);
static int flow_loop_level_compute (struct loop *);
-static int flow_loops_level_compute (struct loops *);
+static void flow_loops_level_compute (struct loops *);
static void establish_preds (struct loop *);
static void canonicalize_loop_headers (void);
static bool glb_enum_p (basic_block, void *);
if (! num_loops || ! file)
return;
- fprintf (file, ";; %d loops found, %d levels\n",
- num_loops, loops->levels);
+ fprintf (file, ";; %d loops found\n", num_loops);
for (i = 0; i < num_loops; i++)
{
hierarchy tree specified by LOOPS. Return the maximum enclosed loop
level. */
-static int
+static void
flow_loops_level_compute (struct loops *loops)
{
- return flow_loop_level_compute (loops->tree_root);
+ flow_loop_level_compute (loops->tree_root);
}
/* Scan a single natural loop specified by LOOP collecting information
/* Assign the loop nesting depth and enclosed loop level for each
loop. */
- loops->levels = flow_loops_level_compute (loops);
+ flow_loops_level_compute (loops);
/* Scan the loops. */
for (i = 1; i < num_loops; i++)
return loops->num;
}
-/* Update the information regarding the loops in the CFG
- specified by LOOPS. */
-
-int
-flow_loops_update (struct loops *loops, int flags)
-{
- /* One day we may want to update the current loop data. For now
- throw away the old stuff and rebuild what we need. */
- if (loops->parray)
- flow_loops_free (loops);
-
- return flow_loops_find (loops, flags);
-}
-
/* Return nonzero if basic block BB belongs to LOOP. */
bool
flow_bb_inside_loop_p (const struct loop *loop, const basic_block bb)
edge
loop_latch_edge (const struct loop *loop)
{
- edge e;
- edge_iterator ei;
-
- FOR_EACH_EDGE (e, ei, loop->header->preds)
- if (e->src == loop->latch)
- break;
-
- return e;
+ return find_edge (loop->latch, loop->header);
}
/* Returns preheader edge of LOOP. */