From bc770d213f3b695315029360016181e1c279e162 Mon Sep 17 00:00:00 2001 From: law Date: Sat, 17 Jan 1998 21:50:05 +0000 Subject: * loop.c (find_and_verify_loops): When attempting to move insns from inside the loop outside the loop, create a BARRIER if no suitable one was found. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17399 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/loop.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gcc/loop.c') diff --git a/gcc/loop.c b/gcc/loop.c index 222620171fb..0fa3b4f0d2b 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -2531,6 +2531,27 @@ find_and_verify_loops (f) { rtx q, r; + /* If no suitable BARRIER was found, create a suitable + one before TARGET. Since TARGET is a fall through + path, we'll need to insert an jump around our block + and a add a BARRIER before TARGET. + + This creates an extra unconditional jump outside + the loop. However, the benefits of removing rarely + executed instructions from inside the loop usually + outweighs the cost of the extra unconditional jump + outside the loop. */ + if (loc == 0) + { + rtx temp; + + temp = gen_jump (JUMP_LABEL (insn)); + temp = emit_jump_insn_before (temp, target); + JUMP_LABEL (temp) = JUMP_LABEL (insn); + LABEL_NUSES (JUMP_LABEL (insn))++; + loc = emit_barrier_before (target); + } + /* Include the BARRIER after INSN and copy the block after LOC. */ new_label = squeeze_notes (new_label, NEXT_INSN (insn)); -- cgit v1.2.1