* reorg.c (dbr_schedule) Print more statistics. Corrected
authorHerman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
Sun, 28 Nov 1999 20:05:50 +0000 (21:05 +0100)
committerJeff Law <law@gcc.gnu.org>
Sun, 28 Nov 1999 20:05:50 +0000 (13:05 -0700)
        problem when printing info when 3 delay slots are filled.

From-SVN: r30687

gcc/ChangeLog
gcc/reorg.c

index 1dbf3127b0c44657efcb5e3da8040414e48ad6bb..4428e5d3841f39076dba8017328a59af78635e90 100644 (file)
@@ -1,3 +1,8 @@
+1999-11-28 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+       * reorg.c (dbr_schedule) Print more statistics. Corrected
+       problem when printing info when 3 delay slots are filled.
+
 1999-11-28  Jakub Jelinek  <jakub@redhat.com>
 
        * combine.c (setup_incoming_promotions): Pass an outgoing
index 1ba5feb181a7357c15493555de5a6f85525514b4..de4c6ac6f734b283f5d898fe6aaaf114a8968881 100644 (file)
@@ -3623,6 +3623,8 @@ dbr_schedule (first, file)
   if (file)
     {
       register int i, j, need_comma;
+      int total_delay_slots[MAX_DELAY_HISTOGRAM + 1];
+      int total_annul_slots[MAX_DELAY_HISTOGRAM + 1];
 
       for (reorg_pass_number = 0;
           reorg_pass_number < MAX_REORG_PASSES;
@@ -3637,7 +3639,7 @@ dbr_schedule (first, file)
              fprintf (file, ";; %d insns needing delay slots\n;; ",
                       num_insns_needing_delays[i][reorg_pass_number]);
 
-             for (j = 0; j < MAX_DELAY_HISTOGRAM; j++)
+             for (j = 0; j < MAX_DELAY_HISTOGRAM + 1; j++)
                if (num_filled_delays[i][j][reorg_pass_number])
                  {
                    if (need_comma)
@@ -3649,6 +3651,58 @@ dbr_schedule (first, file)
              fprintf (file, "\n");
            }
        }
+      bzero ((char *) total_delay_slots, sizeof total_delay_slots);
+      bzero ((char *) total_annul_slots, sizeof total_annul_slots);
+      for (insn = first; insn; insn = NEXT_INSN (insn))
+       {
+         if (! INSN_DELETED_P (insn)
+             && GET_CODE (insn) == INSN
+             && GET_CODE (PATTERN (insn)) != USE
+             && GET_CODE (PATTERN (insn)) != CLOBBER)
+           {
+             if (GET_CODE (PATTERN (insn)) == SEQUENCE)
+               {
+                 j = XVECLEN (PATTERN (insn), 0) - 1;
+                 if (j > MAX_DELAY_HISTOGRAM)
+                   j = MAX_DELAY_HISTOGRAM;
+                 if (INSN_ANNULLED_BRANCH_P (XVECEXP (PATTERN (insn), 0, 0)))
+                   total_annul_slots[j]++;
+                 else
+                   total_delay_slots[j]++;
+               }
+              else if (num_delay_slots (insn) > 0)
+               total_delay_slots[0]++;
+           }
+       }
+      fprintf (file, ";; Reorg totals: ");
+      need_comma = 0;
+      for (j = 0; j < MAX_DELAY_HISTOGRAM + 1; j++)
+       {
+         if (total_delay_slots[j])
+           {
+             if (need_comma)
+               fprintf (file, ", ");
+             need_comma = 1;
+             fprintf (file, "%d got %d delays", total_delay_slots[j], j);
+           }
+       }
+      fprintf (file, "\n");
+#if defined (ANNUL_IFTRUE_SLOTS) || defined (ANNUL_IFFALSE_SLOTS)
+      fprintf (file, ";; Reorg annuls: ");
+      need_comma = 0;
+      for (j = 0; j < MAX_DELAY_HISTOGRAM + 1; j++)
+       {
+         if (total_annul_slots[j])
+           {
+             if (need_comma)
+               fprintf (file, ", ");
+             need_comma = 1;
+             fprintf (file, "%d got %d delays", total_annul_slots[j], j);
+           }
+       }
+      fprintf (file, "\n");
+#endif
+      fprintf (file, "\n");
     }
 
   /* For all JUMP insns, fill in branch prediction notes, so that during