* sched-int.h (struct deps_reg): Add uses_length, clobbers_length.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jan 2002 22:11:09 +0000 (22:11 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jan 2002 22:11:09 +0000 (22:11 +0000)
        * sched-rgn.c (propagate_deps): Update them.
        * sched-deps.c (sched_analyze_insn): Update them.  Flush the
        clobbers list when either gets too long.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49328 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/sched-deps.c
gcc/sched-int.h
gcc/sched-rgn.c

index fc8ce5c..cedff73 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-29  Richard Henderson  <rth@redhat.com>
+
+       * sched-int.h (struct deps_reg): Add uses_length, clobbers_length.
+       * sched-rgn.c (propagate_deps): Update them.
+       * sched-deps.c (sched_analyze_insn): Update them.  Flush the
+       clobbers list when either gets too long.
+
 2002-01-29  Jakub Jelinek  <jakub@redhat.com>
 
        * config/i386/i386.h (LIMIT_RELOAD_CLASS): Handle LEGACY_REGS
index ef38b8b..384bab7 100644 (file)
@@ -1058,6 +1058,8 @@ sched_analyze_insn (deps, x, insn, loop_notes)
                                            REG_DEP_ANTI);
              add_dependence_list_and_free (insn, &reg_last->sets, 0);
              add_dependence_list_and_free (insn, &reg_last->clobbers, 0);
+             reg_last->uses_length = 0;
+             reg_last->clobbers_length = 0;
            });
        }
 
@@ -1073,25 +1075,26 @@ sched_analyze_insn (deps, x, insn, loop_notes)
     }
   else
     {
-      EXECUTE_IF_SET_IN_REG_SET (reg_pending_uses, 0, i,
-       {
-         struct deps_reg *reg_last = &deps->reg_last[i];
-         add_dependence_list (insn, reg_last->sets, 0);
-         add_dependence_list (insn, reg_last->clobbers, 0);
-         reg_last->uses = alloc_INSN_LIST (insn, reg_last->uses);
-       });
-      EXECUTE_IF_SET_IN_REG_SET (reg_pending_clobbers, 0, i,
-       {
-         struct deps_reg *reg_last = &deps->reg_last[i];
-         add_dependence_list (insn, reg_last->sets, REG_DEP_OUTPUT);
-         add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
-         reg_last->clobbers = alloc_INSN_LIST (insn, reg_last->clobbers);
-       });
-
       /* If the current insn is conditional, we can't free any
         of the lists.  */
       if (GET_CODE (PATTERN (insn)) == COND_EXEC)
        {
+         EXECUTE_IF_SET_IN_REG_SET (reg_pending_uses, 0, i,
+           {
+             struct deps_reg *reg_last = &deps->reg_last[i];
+             add_dependence_list (insn, reg_last->sets, 0);
+             add_dependence_list (insn, reg_last->clobbers, 0);
+             reg_last->uses = alloc_INSN_LIST (insn, reg_last->uses);
+             reg_last->uses_length++;
+           });
+         EXECUTE_IF_SET_IN_REG_SET (reg_pending_clobbers, 0, i,
+           {
+             struct deps_reg *reg_last = &deps->reg_last[i];
+             add_dependence_list (insn, reg_last->sets, REG_DEP_OUTPUT);
+             add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
+             reg_last->clobbers = alloc_INSN_LIST (insn, reg_last->clobbers);
+             reg_last->clobbers_length++;
+           });
          EXECUTE_IF_SET_IN_REG_SET (reg_pending_sets, 0, i,
            {
              struct deps_reg *reg_last = &deps->reg_last[i];
@@ -1103,6 +1106,39 @@ sched_analyze_insn (deps, x, insn, loop_notes)
        }
       else
        {
+         EXECUTE_IF_SET_IN_REG_SET (reg_pending_uses, 0, i,
+           {
+             struct deps_reg *reg_last = &deps->reg_last[i];
+             add_dependence_list (insn, reg_last->sets, 0);
+             add_dependence_list (insn, reg_last->clobbers, 0);
+             reg_last->uses_length++;
+             reg_last->uses = alloc_INSN_LIST (insn, reg_last->uses);
+           });
+         EXECUTE_IF_SET_IN_REG_SET (reg_pending_clobbers, 0, i,
+           {
+             struct deps_reg *reg_last = &deps->reg_last[i];
+             add_dependence_list (insn, reg_last->sets, REG_DEP_OUTPUT);
+             add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
+             if (reg_last->uses_length > MAX_PENDING_LIST_LENGTH
+                 || reg_last->clobbers_length > MAX_PENDING_LIST_LENGTH)
+               {
+                 add_dependence_list_and_free (insn, &reg_last->sets,
+                                               REG_DEP_OUTPUT);
+                 add_dependence_list_and_free (insn, &reg_last->uses,
+                                               REG_DEP_ANTI);
+                 add_dependence_list_and_free (insn, &reg_last->clobbers,
+                                               REG_DEP_OUTPUT);
+                 reg_last->clobbers_length = 0;
+                 reg_last->uses_length = 0;
+               }
+             else
+               {
+                 add_dependence_list (insn, reg_last->sets, REG_DEP_OUTPUT);
+                 add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
+               }
+             reg_last->clobbers_length++;
+             reg_last->clobbers = alloc_INSN_LIST (insn, reg_last->clobbers);
+           });
          EXECUTE_IF_SET_IN_REG_SET (reg_pending_sets, 0, i,
            {
              struct deps_reg *reg_last = &deps->reg_last[i];
@@ -1113,6 +1149,8 @@ sched_analyze_insn (deps, x, insn, loop_notes)
              add_dependence_list_and_free (insn, &reg_last->uses,
                                            REG_DEP_ANTI);
              reg_last->sets = alloc_INSN_LIST (insn, reg_last->sets);
+             reg_last->uses_length = 0;
+             reg_last->clobbers_length = 0;
            });
        }
 
index 851d058..47910a0 100644 (file)
@@ -96,6 +96,8 @@ struct deps
       rtx uses;
       rtx sets;
       rtx clobbers;
+      int uses_length;
+      int clobbers_length;
     } *reg_last;
 
   /* Element N is set for each register that has any non-zero element
index b7193aa..e5a241b 100644 (file)
@@ -2427,6 +2427,8 @@ propagate_deps (bb, pred_deps)
            succ_rl->sets = concat_INSN_LIST (pred_rl->sets, succ_rl->sets);
            succ_rl->clobbers = concat_INSN_LIST (pred_rl->clobbers,
                                                  succ_rl->clobbers);
+           succ_rl->uses_length += pred_rl->uses_length;
+           succ_rl->clobbers_length += pred_rl->clobbers_length;
          });
        IOR_REG_SET (&succ_deps->reg_last_in_use, &pred_deps->reg_last_in_use);