diff mbox

[SMS,2/3] Skip DEBUG_INSNs while recognizing doloop

Message ID BANLkTimtQfzWO5xrXuVGYyg4r08b5W1OiA@mail.gmail.com
State New
Headers show

Commit Message

Revital Eres May 8, 2011, 4:37 a.m. UTC
Hello,

The attached patch adds code to skip DEBUG_INSNs while recognizing
doloop pattern.

The patch was tested together with the rest of the patches in this series
and on top of the patch to support do-loop for ARM (not yet in mainline,
but approved http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01718.html).
On ppc64-redhat-linux regtest as well as bootstrap with SMS flags
enabling SMS also on loops with stage count 1.  Regtested on SPU.
On arm-linux-gnueabi regtseted on c,c++. Bootstrap c language with SMS
flags enabling SMS also on loops with stage count 1.

OK for mainline?

Thanks,
Revital

Changelog:

        * modulo-sched.c (doloop_register_get): Ignore DEBUG_INSNs while
        recognizing doloop.

Comments

Alexandre Oliva May 11, 2011, 6:34 p.m. UTC | #1
On May  8, 2011, Revital Eres <revital.eres@linaro.org> wrote:

> +    if (reg_mentioned_p (reg, insn) && !DEBUG_INSN_P (insn))

It probably makes sense to test for !DEBUG_INSN_P first, since it's much
cheaper.
diff mbox

Patch

Index: modulo-sched.c
===================================================================
--- modulo-sched.c      (revision 173368)
+++ modulo-sched.c      (working copy)
@@ -310,10 +313,10 @@  doloop_register_get (rtx head ATTRIBUTE_
      either a single (parallel) branch-on-count or a (non-parallel)
      branch immediately preceded by a single (decrement) insn.  */
   first_insn_not_to_check = (GET_CODE (PATTERN (tail)) == PARALLEL ? tail
-                             : PREV_INSN (tail));
+                             : prev_nondebug_insn (tail));

   for (insn = head; insn != first_insn_not_to_check; insn = NEXT_INSN (insn))
-    if (reg_mentioned_p (reg, insn))
+    if (reg_mentioned_p (reg, insn) && !DEBUG_INSN_P (insn))
       {
         if (dump_file)
         {