/* RTL utility routines.
Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003 Free Software Foundation, Inc.
+ 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC.
"NOTE_INSN_EH_REGION_BEG", "NOTE_INSN_EH_REGION_END",
"NOTE_INSN_REPEATED_LINE_NUMBER",
"NOTE_INSN_BASIC_BLOCK", "NOTE_INSN_EXPECTED_VALUE",
- "NOTE_INSN_PREDICTION"
+ "NOTE_INSN_PREDICTION", "NOTE_INSN_VAR_LOCATION"
};
const char * const reg_note_name[] =
"REG_VTABLE_REF"
};
+
+#ifdef GATHER_STATISTICS
+static int rtx_alloc_counts[(int) LAST_AND_UNUSED_RTX_CODE];
+static int rtx_alloc_sizes[(int) LAST_AND_UNUSED_RTX_CODE];
+static int rtvec_alloc_counts;
+static int rtvec_alloc_sizes;
+#endif
+
\f
/* Allocate an rtx vector of N elements.
Store the length, and initialize all elements to zero. */
rtvec rt;
rt = ggc_alloc_rtvec (n);
- /* clear out the vector */
+ /* Clear out the vector. */
memset (&rt->elem[0], 0, n * sizeof (rtx));
PUT_NUM_ELEM (rt, n);
+
+#ifdef GATHER_STATISTICS
+ rtvec_alloc_counts++;
+ rtvec_alloc_sizes += n * sizeof (rtx);
+#endif
+
return rt;
}
memset (rt, 0, RTX_HDR_SIZE);
PUT_CODE (rt, code);
+
+#ifdef GATHER_STATISTICS
+ rtx_alloc_counts[code]++;
+ rtx_alloc_sizes[code] += RTX_SIZE (code);
+#endif
+
return rt;
}
/* SCRATCH must be shared because they represent distinct values. */
case ADDRESSOF:
return orig;
+ case CLOBBER:
+ if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER)
+ return orig;
+ break;
case CONST:
/* CONST can be shared if it contains a SYMBOL_REF. If it contains
}
/* Compare the elements. If any pair of corresponding elements
- fail to match, return 0 for the whole things. */
+ fail to match, return 0 for the whole thing. */
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
}
return 1;
}
+
+void dump_rtx_statistics (void)
+{
+#ifdef GATHER_STATISTICS
+ int i;
+ int total_counts = 0;
+ int total_sizes = 0;
+ fprintf (stderr, "\nRTX Kind Count Bytes\n");
+ fprintf (stderr, "---------------------------------------\n");
+ for (i = 0; i < LAST_AND_UNUSED_RTX_CODE; i++)
+ if (rtx_alloc_counts[i])
+ {
+ fprintf (stderr, "%-20s %7d %10d\n", GET_RTX_NAME (i),
+ rtx_alloc_counts[i], rtx_alloc_sizes[i]);
+ total_counts += rtx_alloc_counts[i];
+ total_sizes += rtx_alloc_sizes[i];
+ }
+ if (rtvec_alloc_counts)
+ {
+ fprintf (stderr, "%-20s %7d %10d\n", "rtvec",
+ rtvec_alloc_counts, rtvec_alloc_sizes);
+ total_counts += rtvec_alloc_counts;
+ total_sizes += rtvec_alloc_sizes;
+ }
+ fprintf (stderr, "---------------------------------------\n");
+ fprintf (stderr, "%-20s %7d %10d\n",
+ "Total", total_counts, total_sizes);
+ fprintf (stderr, "---------------------------------------\n");
+#endif
+}
\f
#if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
void