diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-03 23:18:57 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-03 23:18:57 +0000 |
commit | 90b89d2ca3810f5ecc21333b459f3532e65333c8 (patch) | |
tree | 7691daea056bed68a7b131047a7e13c2876fb901 /gcc/emit-rtl.c | |
parent | 1459acf14a65b29cf31a0b13d960d906ad7ec82b (diff) | |
download | gcc-90b89d2ca3810f5ecc21333b459f3532e65333c8.tar.gz |
* rtl.h (renumber_insns): New function.
(remove_unnecessary_notes): Likewise.
* emit-rtl.c (renumber_insns): Define.
(remove_unncessary_notes): Likewise.
* toplev.c (rest_of_compilation): Remove dead code.
Use renumber_insns and remove_unncessary_notes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30385 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index cb49d7fb4ec..fed65a608c1 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1897,6 +1897,23 @@ get_max_uid () { return cur_insn_uid; } + +void +renumber_insns () +{ + rtx insn; + int old_max_uid = cur_insn_uid; + + /* If there aren't that many instructions, then it's not really + worth renumbering them. */ + if (get_max_uid () < 25000) + return; + + cur_insn_uid = 1; + + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + INSN_UID (insn) = cur_insn_uid++; +} /* Return the next insn. If it is a SEQUENCE, return the first insn of the sequence. */ @@ -2568,6 +2585,33 @@ reorder_insns_with_line_notes (from, to, after) NOTE_LINE_NUMBER (after_line), to); } + +/* Remove unncessary notes from the instruction stream. */ + +void +remove_unncessary_notes () +{ + rtx insn; + rtx next; + varray_type block_stack; + + /* Remove NOTE_INSN_DELETED notes. We must not remove the first + instruction in the function because the compiler depends on the + first instruction being a note. */ + for (insn = NEXT_INSN (get_insns ()); insn; insn = next) + { + /* Remember what's next. */ + next = NEXT_INSN (insn); + + /* We're only interested in notes. */ + if (GET_CODE (insn) != NOTE) + continue; + + if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED) + remove_insn (insn); + } +} + /* Emit an insn of given code and pattern at a specified place within the doubly-linked list. */ |