summaryrefslogtreecommitdiff
path: root/gcc/reorg.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r--gcc/reorg.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 1ba5feb181a..de4c6ac6f73 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -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