Added statistics hook for arch dependand opt
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 4 Oct 2004 13:31:09 +0000 (13:31 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 4 Oct 2004 13:31:09 +0000 (13:31 +0000)
[r4031]

ir/ir/irarch.c
ir/stat/firmstat.c
ir/stat/firmstat.h

index 3e60f09..818f725 100644 (file)
 #include "firmstat.h"
 #include "ircons.h"
 #include "irarch.h"
-
+#include "firmstat.h"
 
 #undef DEB
 
 #define MAX_BITSTR 64
 
-/** The params got from the factopry in arch_dep_init(...). */
+/** The params got from the factory in arch_dep_init(...). */
 static const arch_dep_params_t *params = NULL;
 
 /** The bit mask, which optimizations to apply. */
@@ -294,6 +294,9 @@ ir_node *arch_dep_replace_mul_with_shifts(ir_node *irn)
 
        }
 
+       if (res != irn)
+         stat_arch_dep_replace_mul_with_shifts(irn);
+
        return res;
 }
 
index 9368b58..9ed5080 100644 (file)
@@ -39,6 +39,7 @@ static const char *opt_names[] = {
   "ID optimization",
   "Constant evaluation",
   "Strength reduction",
+  "Architecture dependant optimization",
   "Lowered",
 };
 
@@ -1123,6 +1124,22 @@ void stat_dead_node_elim_stop(ir_graph *irg)
   --status->in_dead_node_elim;
 }
 
+/*
+ * A multiply was replaced by a series of Shifts/Adds/Subs
+ */
+void stat_arch_dep_replace_mul_with_shifts(ir_node *mul)
+{
+  if (! status->enable)
+    return;
+
+  STAT_ENTER;
+  {
+    graph_entry_t *graph = graph_get_entry(current_ir_graph, status->irg_hash);
+    removed_due_opt(mul, graph->opt_hash[STAT_OPT_ARCH_DEP]);
+  }
+  STAT_LEAVE;
+}
+
 /* Finish the statistics */
 void stat_finish(const char *name)
 {
@@ -1228,4 +1245,6 @@ void stat_dead_node_elim_start(ir_graph *irg) {}
 
 void stat_dead_node_elim_stop(ir_graph *irg) {}
 
+void stat_arch_dep_replace_mul_with_shifts(ir_node *mul) {}
+
 #endif
index cb38f81..0cadf7e 100644 (file)
@@ -50,6 +50,7 @@ typedef enum {
   STAT_OPT_ID,                 /**< ID optimization */
   STAT_OPT_CONST_EVAL,         /**< constant evaluation */
   STAT_OPT_STRENGTH_RED,       /**< strenght reduction */
+  STAT_OPT_ARCH_DEP,           /**< architecture dependant optimization */
   STAT_LOWERED,                        /**< lowered */
 
   STAT_OPT_MAX
@@ -145,6 +146,11 @@ void stat_dead_node_elim_start(ir_graph *irg);
  */
 void stat_dead_node_elim_stop(ir_graph *irg);
 
+/**
+ * A multiply was replaced by a series of Shifts/Adds/Subs
+ */
+void stat_arch_dep_replace_mul_with_shifts(ir_node *mul);
+
 /**
  * helper: get an ir_op from an opcode
  *
@@ -174,6 +180,7 @@ ir_op *stat_get_op_from_opcode(opcode code);
 #define stat_strength_red(irg, strong, cmp)
 #define stat_dead_node_elim_start(irg)
 #define stat_dead_node_elim_stop(irg)
+#define stat_arch_dep_replace_mul_with_shifts(irn)
 
 #endif