From 7df988780bd6c60725929ffea906fc2e160f94df Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Sun, 8 Sep 2002 18:32:31 +0000 Subject: re PR rtl-optimization/6405 (Loop-unrolling related performance regressions) PR optimization/6405 * unroll.c (loop_iterations): last_loop_insn should be the previous non-note instruction before loop->end. * loop.c (strength_reduce): The conditional jump is the last non-note instruction before loop->end (as above). From-SVN: r56956 --- gcc/ChangeLog | 8 ++++++++ gcc/loop.c | 2 +- gcc/unroll.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3abc016..43f4844 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2002-09-08 Roger Sayle + PR optimization/6405 + * unroll.c (loop_iterations): last_loop_insn should be the previous + non-note instruction before loop->end. + * loop.c (strength_reduce): The conditional jump is the last + non-note instruction before loop->end (as above). + +2002-09-08 Roger Sayle + * combine.c (try_combine): Handle the case that undobuf.other_insn has been turned into a return or unconditional jump, by inserting a BARRIER if necessary. diff --git a/gcc/loop.c b/gcc/loop.c index c601f5b..24b16aa 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -5348,7 +5348,7 @@ strength_reduce (loop, flags) unsigned HOST_WIDE_INT n = loop_info->n_iterations / loop_info->unroll_number; if (n > 1) - predict_insn (PREV_INSN (loop->end), PRED_LOOP_ITERATIONS, + predict_insn (prev_nonnote_insn (loop->end), PRED_LOOP_ITERATIONS, REG_BR_PROB_BASE - REG_BR_PROB_BASE / n); } diff --git a/gcc/unroll.c b/gcc/unroll.c index 4096905..61d63d8 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -3273,7 +3273,7 @@ loop_iterations (loop) accidentally get the branch for a contained loop if the branch for this loop was deleted. We can only trust branches immediately before the loop_end. */ - last_loop_insn = PREV_INSN (loop->end); + last_loop_insn = prev_nonnote_insn (loop->end); /* ??? We should probably try harder to find the jump insn at the end of the loop. The following code assumes that -- cgit v1.1