diff options
Diffstat (limited to 'gcc/hw-doloop.c')
-rw-r--r-- | gcc/hw-doloop.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/gcc/hw-doloop.c b/gcc/hw-doloop.c index cd9b3f28b73..c4681ad7524 100644 --- a/gcc/hw-doloop.c +++ b/gcc/hw-doloop.c @@ -58,12 +58,12 @@ dump_hwloops (hwloop_info loops) loop->depth, REGNO (loop->iter_reg)); fprintf (dump_file, " blocks: [ "); - for (ix = 0; VEC_iterate (basic_block, loop->blocks, ix, b); ix++) + for (ix = 0; loop->blocks.iterate (ix, &b); ix++) fprintf (dump_file, "%d ", b->index); fprintf (dump_file, "] "); fprintf (dump_file, " inner loops: [ "); - for (ix = 0; VEC_iterate (hwloop_info, loop->loops, ix, i); ix++) + for (ix = 0; loop->loops.iterate (ix, &i); ix++) fprintf (dump_file, "%d ", i->loop_no); fprintf (dump_file, "]\n"); } @@ -92,7 +92,7 @@ scan_loop (hwloop_info loop) REGNO (loop->iter_reg))) loop->iter_reg_used_outside = true; - for (ix = 0; VEC_iterate (basic_block, loop->blocks, ix, bb); ix++) + for (ix = 0; loop->blocks.iterate (ix, &bb); ix++) { rtx insn; edge e; @@ -211,11 +211,11 @@ add_forwarder_blocks (hwloop_info loop) fprintf (dump_file, ";; Adding forwarder block %d to loop %d and retrying\n", e->src->index, loop->loop_no); - VEC_safe_push (basic_block, heap, loop->blocks, e->src); + loop->blocks.safe_push (e->src); bitmap_set_bit (loop->block_bitmap, e->src->index); FOR_EACH_EDGE (e2, ei2, e->src->preds) - VEC_safe_push (edge, gc, loop->incoming, e2); - VEC_unordered_remove (edge, loop->incoming, ei.index); + vec_safe_push (loop->incoming, e2); + loop->incoming->unordered_remove (ei.index); return true; } } @@ -237,12 +237,12 @@ discover_loop (hwloop_info loop, basic_block tail_bb, rtx tail_insn, rtx reg) bool found_tail; unsigned dwork = 0; basic_block bb; - VEC (basic_block,heap) *works; + vec<basic_block> works; loop->tail = tail_bb; loop->loop_end = tail_insn; loop->iter_reg = reg; - loop->incoming = VEC_alloc (edge, gc, 2); + vec_alloc (loop->incoming, 2); loop->start_label = JUMP_LABEL (tail_insn); if (EDGE_COUNT (tail_bb->succs) != 2) @@ -253,11 +253,11 @@ discover_loop (hwloop_info loop, basic_block tail_bb, rtx tail_insn, rtx reg) loop->head = BRANCH_EDGE (tail_bb)->dest; loop->successor = FALLTHRU_EDGE (tail_bb)->dest; - works = VEC_alloc (basic_block, heap, 20); - VEC_safe_push (basic_block, heap, works, loop->head); + works.create (20); + works.safe_push (loop->head); found_tail = false; - for (dwork = 0; VEC_iterate (basic_block, works, dwork, bb); dwork++) + for (dwork = 0; works.iterate (dwork, &bb); dwork++) { edge e; edge_iterator ei; @@ -277,7 +277,7 @@ discover_loop (hwloop_info loop, basic_block tail_bb, rtx tail_insn, rtx reg) /* We've not seen this block before. Add it to the loop's list and then add each successor to the work list. */ - VEC_safe_push (basic_block, heap, loop->blocks, bb); + loop->blocks.safe_push (bb); bitmap_set_bit (loop->block_bitmap, bb->index); if (bb == tail_bb) @@ -289,7 +289,7 @@ discover_loop (hwloop_info loop, basic_block tail_bb, rtx tail_insn, rtx reg) basic_block succ = EDGE_SUCC (bb, ei.index)->dest; if (REGNO_REG_SET_P (df_get_live_in (succ), REGNO (loop->iter_reg))) - VEC_safe_push (basic_block, heap, works, succ); + works.safe_push (succ); } } } @@ -300,7 +300,7 @@ discover_loop (hwloop_info loop, basic_block tail_bb, rtx tail_insn, rtx reg) /* Find the predecessor, and make sure nothing else jumps into this loop. */ if (!loop->bad) { - FOR_EACH_VEC_ELT (basic_block, loop->blocks, dwork, bb) + FOR_EACH_VEC_ELT (loop->blocks, dwork, bb) { edge e; edge_iterator ei; @@ -314,7 +314,7 @@ discover_loop (hwloop_info loop, basic_block tail_bb, rtx tail_insn, rtx reg) fprintf (dump_file, ";; Loop %d: incoming edge %d -> %d\n", loop->loop_no, pred->index, e->dest->index); - VEC_safe_push (edge, gc, loop->incoming, e); + vec_safe_push (loop->incoming, e); } } } @@ -341,7 +341,7 @@ discover_loop (hwloop_info loop, basic_block tail_bb, rtx tail_insn, rtx reg) } } - VEC_free (basic_block, heap, works); + works.release (); } /* Analyze the structure of the loops in the current function. Use @@ -405,7 +405,7 @@ discover_loops (bitmap_obstack *loop_stack, struct hw_doloop_hooks *hooks) loop->next = loops; loops = loop; loop->loop_no = nloops++; - loop->blocks = VEC_alloc (basic_block, heap, 20); + loop->blocks.create (20); loop->block_bitmap = BITMAP_ALLOC (loop_stack); if (dump_file) @@ -437,10 +437,10 @@ discover_loops (bitmap_obstack *loop_stack, struct hw_doloop_hooks *hooks) continue; if (!bitmap_intersect_compl_p (other->block_bitmap, loop->block_bitmap)) - VEC_safe_push (hwloop_info, heap, loop->loops, other); + loop->loops.safe_push (other); else if (!bitmap_intersect_compl_p (loop->block_bitmap, other->block_bitmap)) - VEC_safe_push (hwloop_info, heap, other->loops, loop); + other->loops.safe_push (loop); else { if (dump_file) @@ -466,8 +466,8 @@ free_loops (hwloop_info loops) { hwloop_info loop = loops; loops = loop->next; - VEC_free (hwloop_info, heap, loop->loops); - VEC_free (basic_block, heap, loop->blocks); + loop->loops.release (); + loop->blocks.release (); BITMAP_FREE (loop->block_bitmap); XDELETE (loop); } @@ -580,7 +580,7 @@ optimize_loop (hwloop_info loop, struct hw_doloop_hooks *hooks) a depth-first search here and never visit a loop more than once. Recursion depth is effectively limited by the number of available hardware registers. */ - for (ix = 0; VEC_iterate (hwloop_info, loop->loops, ix, inner); ix++) + for (ix = 0; loop->loops.iterate (ix, &inner); ix++) { optimize_loop (inner, hooks); |