diff options
author | Jeffrey A Law <law@cygnus.com> | 1999-11-18 06:45:55 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-11-17 23:45:55 -0700 |
commit | 9aa137f325e3e8b3f790094cc0f31476aad9217e (patch) | |
tree | 64733b81efce2d246d5ec15d39e71547ffca9f3f /gcc | |
parent | 7c2e3b9b525dd16f20ec372f867b3d2d1d4feb20 (diff) | |
download | gcc-9aa137f325e3e8b3f790094cc0f31476aad9217e.zip gcc-9aa137f325e3e8b3f790094cc0f31476aad9217e.tar.gz gcc-9aa137f325e3e8b3f790094cc0f31476aad9217e.tar.bz2 |
flow.c (split_edge): Take looping structure into account when determining where to put the new block...
* flow.c (split_edge): Take looping structure into account when
determining where to put the new block note.
From-SVN: r30567
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/flow.c | 27 |
2 files changed, 30 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d3668ce..baa083c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 17 23:46:14 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (split_edge): Take looping structure into account when + determining where to put the new block note. + Wed Nov 17 20:42:43 1999 Jeff Holcomb <jeffh@cygnus.com> * Makefile.in (ggc-none.o): Provide host specific version if @@ -1422,8 +1422,31 @@ split_edge (edge_in) BASIC_BLOCK (i) = bb; bb->index = i; - /* Create the basic block note. */ - if (old_succ != EXIT_BLOCK_PTR) + /* Create the basic block note. + + Where we place the note can have a noticable impact on the generated + code. Consider this cfg: + + + E + | + 0 + / \ + +->1-->2--->E + | | + +--+ + + If we need to insert an insn on the edge from block 0 to block 1, + we want to ensure the instructions we insert are outside of any + loop notes that physically sit between block 0 and block 1. Otherwise + we confuse the loop optimizer into thinking the loop is a phony. */ + if (old_succ != EXIT_BLOCK_PTR + && PREV_INSN (old_succ->head) + && GET_CODE (PREV_INSN (old_succ->head)) == NOTE + && NOTE_LINE_NUMBER (PREV_INSN (old_succ->head)) == NOTE_INSN_LOOP_BEG) + bb_note = emit_note_before (NOTE_INSN_BASIC_BLOCK, + PREV_INSN (old_succ->head)); + else if (old_succ != EXIT_BLOCK_PTR) bb_note = emit_note_before (NOTE_INSN_BASIC_BLOCK, old_succ->head); else bb_note = emit_note_after (NOTE_INSN_BASIC_BLOCK, get_last_insn ()); |