added dumper for the const_tbl
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 6 Jun 2005 08:48:22 +0000 (08:48 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 6 Jun 2005 08:48:22 +0000 (08:48 +0000)
fixed if-conv reasons

[r5951]

ir/stat/stat_dmp.c

index 2140888..4189d0b 100644 (file)
@@ -13,6 +13,7 @@
 #endif
 
 #include "stat_dmp.h"
+#include "irhooks.h"
 
 /**
  * names of the optimizations
@@ -39,12 +40,13 @@ static const char *opt_names[] = {
   "Lowered",
 };
 
-static const char *if_conv_names[] = {
+static const char *if_conv_names[IF_RESULT_LAST] = {
   "if conv done             ",
   "if conv side effect      ",
   "if conv Phi node found   ",
   "if conv to deep DAG's    ",
   "if conv bad control flow ",
+  "if conv denied by arch   ",
 };
 
 /**
@@ -213,6 +215,24 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
   }
 }
 
+/**
+ * dumps the IRG
+ */
+static void simple_dump_const_tbl(dumper_t *dmp, const constant_info_t *tbl)
+{
+  int i;
+
+  fprintf(dmp->f, "\nConstant Information:\n");
+  fprintf(dmp->f, "---------------------\n");
+
+  fprintf(dmp->f, "\nBit usage for integer constants\n");
+  fprintf(dmp->f, "-------------------------------\n");
+
+  for (i = 0; i < ARR_SIZE(tbl->bits_count); ++i)
+    fprintf(dmp->f, "%3d %12u\n", i + 1, tbl->bits_count[i].cnt[0]);
+  fprintf(dmp->f, "-------------------------------\n");
+}
+
 /**
  * initialize the simple dumper
  */
@@ -238,6 +258,7 @@ static void simple_finish(dumper_t *dmp)
  */
 const dumper_t simple_dumper = {
   simple_dump_graph,
+  simple_dump_const_tbl,
   simple_init,
   simple_finish,
   NULL,
@@ -319,6 +340,14 @@ static void csv_dump_graph(dumper_t *dmp, graph_entry_t *entry)
   }
 }
 
+/**
+ * dumps the IRG
+ */
+static void csv_dump_const_tbl(dumper_t *dmp, const constant_info_t *tbl)
+{
+  /* FIXME: NYI */
+}
+
 /**
  * initialize the simple dumper
  */
@@ -344,6 +373,7 @@ static void csv_finish(dumper_t *dmp)
  */
 const dumper_t csv_dumper = {
   csv_dump_graph,
+  csv_dump_const_tbl,
   csv_init,
   csv_finish,
   NULL,