]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/6405 (Loop-unrolling related performance regressions)
authorRoger Sayle <roger@eyesopen.com>
Sun, 8 Sep 2002 18:32:31 +0000 (18:32 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 8 Sep 2002 18:32:31 +0000 (18:32 +0000)
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
gcc/loop.c
gcc/unroll.c

index 3abc016560cb5643987598e6cb458e683e2cea21..43f4844e1f531298f2436f937cec6b537d690e75 100644 (file)
@@ -1,3 +1,11 @@
+2002-09-08  Roger Sayle  <roger@eyesopen.com>
+
+       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  <roger@eyesopen.com>
 
        * combine.c (try_combine): Handle the case that undobuf.other_insn
index c601f5b84e63236c88a4cd558485291f35793a22..24b16aa9a904dbaf0a2d57da882941258a2f2a33 100644 (file)
@@ -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);
     }
 
index 4096905be626e9d7fcc8984f3f8b86d437055ff9..61d63d8e2a359fc45d48275e98cd939ab83be173 100644 (file)
@@ -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