diff options
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r-- | gcc/cfgloop.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 3d13386ba4e..851f80d63bb 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -101,6 +101,20 @@ flow_loop_nested_p (const struct loop *outer, const struct loop *loop) && loop->pred[outer->depth] == outer; } +/* Returns superloop of LOOP at given DEPTH. */ + +struct loop * +superloop_at_depth (struct loop *loop, unsigned depth) +{ + if (depth > (unsigned) loop->depth) + abort (); + + if (depth == (unsigned) loop->depth) + return loop; + + return loop->pred[depth]; +} + /* Dump the loop information specified by LOOP to the stream FILE using auxiliary dump callback function LOOP_DUMP_AUX if non null. */ @@ -928,6 +942,7 @@ glb_enum_p (basic_block bb, void *glb_header) /* Gets basic blocks of a LOOP. Header is the 0-th block, rest is in dfs order against direction of edges from latch. Specially, if header != latch, latch is the 1-st block. */ + basic_block * get_loop_body (const struct loop *loop) { @@ -992,7 +1007,7 @@ fill_sons_in_loop (const struct loop *loop, basic_block bb, /* Gets body of a LOOP (that must be different from the outermost loop) sorted by dominance relation. Additionally, if a basic block s dominates - the latch, then only blocks dominated by s are be after it. */ + the latch, then only blocks dominated by s are after it. */ basic_block * get_loop_body_in_dom_order (const struct loop *loop) |