]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
SMS: Avoid generating redundant reg-moves
authorRevital Eres <revital.eres@linaro.org>
Fri, 30 Sep 2011 13:10:56 +0000 (13:10 +0000)
committerRevital Eres <revitale@gcc.gnu.org>
Fri, 30 Sep 2011 13:10:56 +0000 (13:10 +0000)
From-SVN: r179380

gcc/ChangeLog
gcc/modulo-sched.c

index c20caa8687e25f1a66954aa5f8b4d734ebcc736a..b0756d0683740cf04ba0020b2222fa634b3e83a2 100644 (file)
@@ -1,3 +1,9 @@
+2011-09-30  Revital Eres  <revital.eres@linaro.org>
+
+       * modulo-sched.c (generate_reg_moves): Skip instructions that
+       do not set a register and verify no regmoves are created for
+       !single_set instructions.
+
 2011-09-30  Bernd Schmidt  <bernds@codesourcery.com>
 
        * hw-doloop.c (scan_loop): Compute register usage only for non-debug
index 28be9425b449a00888081c2f9bda4d524d5bc890..7c33be54bb5d7f0fd5498b949ac1757d6f909cbf 100644 (file)
@@ -476,7 +476,12 @@ generate_reg_moves (partial_schedule_ptr ps, bool rescan)
       sbitmap *uses_of_defs;
       rtx last_reg_move;
       rtx prev_reg, old_reg;
-
+      rtx set = single_set (u->insn);
+      
+      /* Skip instructions that do not set a register.  */
+      if ((set && !REG_P (SET_DEST (set))))
+        continue;
       /* Compute the number of reg_moves needed for u, by looking at life
         ranges started at u (excluding self-loops).  */
       for (e = u->out; e; e = e->next_out)
@@ -493,6 +498,16 @@ generate_reg_moves (partial_schedule_ptr ps, bool rescan)
                && SCHED_COLUMN (e->dest) < SCHED_COLUMN (e->src))
              nreg_moves4e--;
 
+            if (nreg_moves4e >= 1)
+             {
+               /* !single_set instructions are not supported yet and
+                  thus we do not except to encounter them in the loop
+                  except from the doloop part.  For the latter case
+                  we assume no regmoves are generated as the doloop
+                  instructions are tied to the branch with an edge.  */
+               gcc_assert (set);
+             }
+           
            nreg_moves = MAX (nreg_moves, nreg_moves4e);
          }