diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-16 17:34:53 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-16 17:34:53 +0000 |
commit | 4c5da23833f4604c04fb829abf1a39ab6976e7b2 (patch) | |
tree | 47d672ee2344eb156d43b4e6fc935c02ed904ce7 /gcc/haifa-sched.c | |
parent | 14abf9235794ba37b9ad3ef6381ad36c3606370d (diff) | |
download | gcc-4c5da23833f4604c04fb829abf1a39ab6976e7b2.tar.gz |
Basic block renumbering removal.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53522 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r-- | gcc/haifa-sched.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 6b3e3162e08..d520ef34afe 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -2303,7 +2303,8 @@ void sched_init (dump_file) FILE *dump_file; { - int luid, b; + int luid; + basic_block b; rtx insn; int i; @@ -2356,8 +2357,8 @@ sched_init (dump_file) h_i_d[0].luid = 0; luid = 1; - for (b = 0; b < n_basic_blocks; b++) - for (insn = BLOCK_HEAD (b);; insn = NEXT_INSN (insn)) + FOR_ALL_BB (b) + for (insn = b->head;; insn = NEXT_INSN (insn)) { INSN_LUID (insn) = luid; @@ -2369,7 +2370,7 @@ sched_init (dump_file) if (GET_CODE (insn) != NOTE) ++luid; - if (insn == BLOCK_END (b)) + if (insn == b->end) break; } @@ -2383,7 +2384,7 @@ sched_init (dump_file) { rtx line; - line_note_head = (rtx *) xcalloc (n_basic_blocks, sizeof (rtx)); + line_note_head = (rtx *) xcalloc (last_basic_block, sizeof (rtx)); /* Save-line-note-head: Determine the line-number at the start of each basic block. @@ -2391,22 +2392,22 @@ sched_init (dump_file) predecessor has been scheduled, it is impossible to accurately determine the correct line number for the first insn of the block. */ - for (b = 0; b < n_basic_blocks; b++) + FOR_ALL_BB (b) { - for (line = BLOCK_HEAD (b); line; line = PREV_INSN (line)) + for (line = b->head; line; line = PREV_INSN (line)) if (GET_CODE (line) == NOTE && NOTE_LINE_NUMBER (line) > 0) { - line_note_head[b] = line; + line_note_head[b->sindex] = line; break; } /* Do a forward search as well, since we won't get to see the first notes in a basic block. */ - for (line = BLOCK_HEAD (b); line; line = NEXT_INSN (line)) + for (line = b->head; line; line = NEXT_INSN (line)) { if (INSN_P (line)) break; if (GET_CODE (line) == NOTE && NOTE_LINE_NUMBER (line) > 0) - line_note_head[b] = line; + line_note_head[b->sindex] = line; } } } @@ -2420,22 +2421,22 @@ sched_init (dump_file) /* ??? Add a NOTE after the last insn of the last basic block. It is not known why this is done. */ - insn = BLOCK_END (n_basic_blocks - 1); + insn = EXIT_BLOCK_PTR->prev_bb->end; if (NEXT_INSN (insn) == 0 || (GET_CODE (insn) != NOTE && GET_CODE (insn) != CODE_LABEL /* Don't emit a NOTE if it would end up before a BARRIER. */ && GET_CODE (NEXT_INSN (insn)) != BARRIER)) { - emit_note_after (NOTE_INSN_DELETED, BLOCK_END (n_basic_blocks - 1)); + emit_note_after (NOTE_INSN_DELETED, EXIT_BLOCK_PTR->prev_bb->end); /* Make insn to appear outside BB. */ - BLOCK_END (n_basic_blocks - 1) = PREV_INSN (BLOCK_END (n_basic_blocks - 1)); + EXIT_BLOCK_PTR->prev_bb->end = PREV_INSN (EXIT_BLOCK_PTR->prev_bb->end); } /* Compute INSN_REG_WEIGHT for all blocks. We must do this before removing death notes. */ - for (b = n_basic_blocks - 1; b >= 0; b--) - find_insn_reg_weight (b); + FOR_ALL_BB_REVERSE (b) + find_insn_reg_weight (b->sindex); } /* Free global data used during insn scheduling. */ |