summaryrefslogtreecommitdiff
path: root/gcc/reorg.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-28 20:05:50 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-28 20:05:50 +0000
commit78a9de8d591f04f7887788cbc790ec9fd855a69c (patch)
tree7053d868ecffceb6bdd234d3e1f14b51d6d40439 /gcc/reorg.c
parentd7e5ef2f2342c2194fa6c944d1ff3508f4287f62 (diff)
downloadgcc-78a9de8d591f04f7887788cbc790ec9fd855a69c.tar.gz
* reorg.c (dbr_schedule) Print more statistics. Corrected
problem when printing info when 3 delay slots are filled. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30687 138bc75d-0d04-0410-961f-82ee72b054a4
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