#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. */
}
+ if (res != irn)
+ stat_arch_dep_replace_mul_with_shifts(irn);
+
return res;
}
"ID optimization",
"Constant evaluation",
"Strength reduction",
+ "Architecture dependant optimization",
"Lowered",
};
--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)
{
void stat_dead_node_elim_stop(ir_graph *irg) {}
+void stat_arch_dep_replace_mul_with_shifts(ir_node *mul) {}
+
#endif
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
*/
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
*
#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