#include "tree-ssa-loop-manip.h"
#include "dumpfile.h"
-static void copy_loops_to (struct loop **, int,
- struct loop *);
+static void copy_loops_to (class loop **, int,
+ class loop *);
static void loop_redirect_edge (edge, basic_block);
static void remove_bbs (basic_block *, int);
static bool rpe_enum_p (const_basic_block, const void *);
static int find_path (edge, basic_block **);
-static void fix_loop_placements (struct loop *, bool *);
+static void fix_loop_placements (class loop *, bool *);
static bool fix_bb_placement (basic_block);
static void fix_bb_placements (basic_block, bool *, bitmap);
{
edge e;
edge_iterator ei;
- struct loop *loop = current_loops->tree_root, *act;
+ class loop *loop = current_loops->tree_root, *act;
FOR_EACH_EDGE (e, ei, bb->succs)
{
invalidate the information about irreducible regions. */
static bool
-fix_loop_placement (struct loop *loop, bool *irred_invalidated)
+fix_loop_placement (class loop *loop, bool *irred_invalidated)
{
unsigned i;
edge e;
vec<edge> exits = get_loop_exit_edges (loop);
- struct loop *father = current_loops->tree_root, *act;
+ class loop *father = current_loops->tree_root, *act;
bool ret = false;
FOR_EACH_VEC_ELT (exits, i, e)
bitmap loop_closed_ssa_invalidated)
{
basic_block *queue, *qtop, *qbeg, *qend;
- struct loop *base_loop, *target_loop;
+ class loop *base_loop, *target_loop;
edge e;
/* We pass through blocks back-reachable from FROM, testing whether some
FOR_EACH_EDGE (e, ei, from->preds)
{
basic_block pred = e->src;
- struct loop *nca;
+ class loop *nca;
if (e->flags & EDGE_IRREDUCIBLE_LOOP)
*irred_invalidated = true;
int i, nrem, n_bord_bbs;
bool local_irred_invalidated = false;
edge_iterator ei;
- struct loop *l, *f;
+ class loop *l, *f;
if (! irred_invalidated)
irred_invalidated = &local_irred_invalidated;
/* Creates place for a new LOOP in loops structure of FN. */
void
-place_new_loop (struct function *fn, struct loop *loop)
+place_new_loop (struct function *fn, class loop *loop)
{
loop->num = number_of_loops (fn);
vec_safe_push (loops_for_fn (fn)->larray, loop);
outer. */
void
-add_loop (struct loop *loop, struct loop *outer)
+add_loop (class loop *loop, class loop *outer)
{
basic_block *bbs;
int i, n;
- struct loop *subloop;
+ class loop *subloop;
edge e;
edge_iterator ei;
/* Scale profile of loop by P. */
void
-scale_loop_frequencies (struct loop *loop, profile_probability p)
+scale_loop_frequencies (class loop *loop, profile_probability p)
{
basic_block *bbs;
they need to be scaled synchronously. */
void
-scale_loop_profile (struct loop *loop, profile_probability p,
+scale_loop_profile (class loop *loop, profile_probability p,
gcov_type iteration_bound)
{
edge e, preheader_e;
/* Recompute dominance information for basic blocks outside LOOP. */
static void
-update_dominators_in_loop (struct loop *loop)
+update_dominators_in_loop (class loop *loop)
{
vec<basic_block> dom_bbs = vNULL;
basic_block *body;
should be used only when the UPPER_BOUND expression is a loop
invariant. */
-struct loop *
+class loop *
create_empty_loop_on_edge (edge entry_edge,
tree initial_value,
tree stride, tree upper_bound,
tree iv,
tree *iv_before,
tree *iv_after,
- struct loop *outer)
+ class loop *outer)
{
basic_block loop_header, loop_latch, succ_bb, pred_bb;
- struct loop *loop;
+ class loop *loop;
gimple_stmt_iterator gsi;
gimple_seq stmts;
gcond *cond_expr;
Returns the newly created loop. Frequencies and counts in the new loop
are scaled by FALSE_SCALE and in the old one by TRUE_SCALE. */
-struct loop *
+class loop *
loopify (edge latch_edge, edge header_edge,
basic_block switch_bb, edge true_edge, edge false_edge,
bool redirect_all_edges, profile_probability true_scale,
{
basic_block succ_bb = latch_edge->dest;
basic_block pred_bb = header_edge->src;
- struct loop *loop = alloc_loop ();
- struct loop *outer = loop_outer (succ_bb->loop_father);
+ class loop *loop = alloc_loop ();
+ class loop *outer = loop_outer (succ_bb->loop_father);
profile_count cnt;
loop->header = header_edge->dest;
basic blocks that had non-trivial update on their loop_father.*/
void
-unloop (struct loop *loop, bool *irred_invalidated,
+unloop (class loop *loop, bool *irred_invalidated,
bitmap loop_closed_ssa_invalidated)
{
basic_block *body;
- struct loop *ploop;
+ class loop *ploop;
unsigned i, n;
basic_block latch = loop->latch;
bool dummy = false;
invalidate the information about irreducible regions. */
static void
-fix_loop_placements (struct loop *loop, bool *irred_invalidated)
+fix_loop_placements (class loop *loop, bool *irred_invalidated)
{
- struct loop *outer;
+ class loop *outer;
while (loop_outer (loop))
{
the loop into its duplicate. */
void
-copy_loop_info (struct loop *loop, struct loop *target)
+copy_loop_info (class loop *loop, class loop *target)
{
gcc_checking_assert (!target->any_upper_bound && !target->any_estimate);
target->any_upper_bound = loop->any_upper_bound;
created loop into loops structure. If AFTER is non-null
the new loop is added at AFTER->next, otherwise in front of TARGETs
sibling list. */
-struct loop *
-duplicate_loop (struct loop *loop, struct loop *target, struct loop *after)
+class loop *
+duplicate_loop (class loop *loop, class loop *target, class loop *after)
{
- struct loop *cloop;
+ class loop *cloop;
cloop = alloc_loop ();
place_new_loop (cfun, cloop);
newly created loops into loop tree at the end of TARGETs sibling
list in the original order. */
void
-duplicate_subloops (struct loop *loop, struct loop *target)
+duplicate_subloops (class loop *loop, class loop *target)
{
- struct loop *aloop, *cloop, *tail;
+ class loop *aloop, *cloop, *tail;
for (tail = target->inner; tail && tail->next; tail = tail->next)
;
into TARGET loop, placing newly created loops into loop tree adding
them to TARGETs sibling list at the end in order. */
static void
-copy_loops_to (struct loop **copied_loops, int n, struct loop *target)
+copy_loops_to (class loop **copied_loops, int n, class loop *target)
{
- struct loop *aloop, *tail;
+ class loop *aloop, *tail;
int i;
for (tail = target->inner; tail && tail->next; tail = tail->next)
/* Check whether LOOP's body can be duplicated. */
bool
-can_duplicate_loop_p (const struct loop *loop)
+can_duplicate_loop_p (const class loop *loop)
{
int ret;
basic_block *bbs = get_loop_body (loop);
impossible. */
bool
-duplicate_loop_to_header_edge (struct loop *loop, edge e,
+duplicate_loop_to_header_edge (class loop *loop, edge e,
unsigned int ndupl, sbitmap wont_exit,
edge orig, vec<edge> *to_remove,
int flags)
{
- struct loop *target, *aloop;
- struct loop **orig_loops;
+ class loop *target, *aloop;
+ class loop **orig_loops;
unsigned n_orig_loops;
basic_block header = loop->header, latch = loop->latch;
basic_block *new_bbs, *bbs, *first_active;
n_orig_loops = 0;
for (aloop = loop->inner; aloop; aloop = aloop->next)
n_orig_loops++;
- orig_loops = XNEWVEC (struct loop *, n_orig_loops);
+ orig_loops = XNEWVEC (class loop *, n_orig_loops);
for (aloop = loop->inner, i = 0; aloop; aloop = aloop->next, i++)
orig_loops[i] = aloop;
/* True when a candidate preheader BLOCK has predecessors from LOOP. */
static bool
-has_preds_from_loop (basic_block block, struct loop *loop)
+has_preds_from_loop (basic_block block, class loop *loop)
{
edge e;
edge_iterator ei;
The function also updates dominators. */
basic_block
-create_preheader (struct loop *loop, int flags)
+create_preheader (class loop *loop, int flags)
{
edge e;
basic_block dummy;
void
create_preheaders (int flags)
{
- struct loop *loop;
+ class loop *loop;
if (!current_loops)
return;
void
force_single_succ_latches (void)
{
- struct loop *loop;
+ class loop *loop;
edge e;
FOR_EACH_LOOP (loop, 0)
If PLACE_AFTER is true, we place the new loop after LOOP in the
instruction stream, otherwise it is placed before LOOP. */
-struct loop *
-loop_version (struct loop *loop,
+class loop *
+loop_version (class loop *loop,
void *cond_expr, basic_block *condition_bb,
profile_probability then_prob, profile_probability else_prob,
profile_probability then_scale, profile_probability else_scale,
basic_block first_head, second_head;
edge entry, latch_edge, true_edge, false_edge;
int irred_flag;
- struct loop *nloop;
+ class loop *nloop;
basic_block cond_bb;
/* Record entry and latch edges for the loop */