- add support for cond_eval statistics
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 14 Jan 2009 15:12:24 +0000 (15:12 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 14 Jan 2009 15:12:24 +0000 (15:12 +0000)
[r25194]

include/libfirm/dbginfo.h
include/libfirm/firmstat.h
include/libfirm/iropt_dbg.h
ir/debug/dbginfo.c
ir/stat/stat_dmp.c

index 48e2177..d92482a 100644 (file)
@@ -87,6 +87,7 @@ typedef enum {
        dbg_opt_confirm,              /**< A Firm subgraph was replace because of a Confirmation. */
        dbg_gvn_pre,                  /**< A Firm node was replace because of the GVN-PRE algorithm. */
        dbg_combo,                    /**< A Firm node was replace because of the combo algorithm. */
+       dbg_cond_eval,                /**< A Firm node was replace because of the conditional evaluation algorithm. */
        dbg_backend,                  /**< A Firm subgraph was replaced because of a Backend transformation */
        dbg_max                       /**< Maximum value. */
 } dbg_action;
index 9151f74..813bfc1 100644 (file)
@@ -121,6 +121,7 @@ enum firmstat_optimizations_t {
        FS_OPT_COMBO_CF,                          /**< Combo: removed conditional control flow */
        FS_OPT_COMBO_FOLLOWER,                    /**< Combo: replaced a follower */
        FS_OPT_COMBO_CONGRUENT,                   /**< Combo: replaced by congruent */
+       FS_OPT_COND_EVAL,                         /**< Conditional evaluation: removed conditional control flow */
        FS_OPT_RTS_ABS,                           /**< RTS optimization: call to abs() replaced */
        FS_OPT_RTS_ALLOCA,                        /**< RTS optimization: call to alloca() replaced */
        FS_OPT_RTS_SQRT,                          /**< RTS optimization: call to sqrt() replaced */
index a504c1d..df2fa63 100644 (file)
@@ -97,7 +97,7 @@
 
 /**
  * Merge the debug info due to an algebraic_simplification.
- * A node could be avaluated into a Constant.
+ * A node could be evaluated into a Constant.
  *
  * @param oldn  the node
  * @param n     the new constant holding the value
          __dbg_info_merge_pair(n, oldn, dbg_combo); \
        } while(0)
 
+/**
+ * Merge the debug info due to a cond eval result.
+ *
+ * @param oldn  the old control flow node
+ * @param n     the new control flow node replacing oldn
+ */
+#define DBG_OPT_COND_EVAL(oldn, n)                         \
+       do {                                                   \
+         hook_merge_nodes(&n, 1, &oldn, 1, FS_OPT_COND_EVAL); \
+         __dbg_info_merge_pair(n, oldn, dbg_cond_eval);       \
+       } while(0)
+
 #endif
index 2f4d72d..fedaab4 100644 (file)
@@ -69,6 +69,7 @@ const char *dbg_action_2_str(dbg_action a) {
        CASE(dbg_opt_confirm);
        CASE(dbg_gvn_pre);
        CASE(dbg_combo);
+       CASE(dbg_cond_eval);
        CASE(dbg_backend);
        default:
                if (a <= dbg_max)
index 6455498..dba32d3 100644 (file)
@@ -138,6 +138,7 @@ static const struct {
        { FS_OPT_COMBO_CF,       "Combo: removed conditional control flow" },
        { FS_OPT_COMBO_FOLLOWER, "Combo: removed a follower" },
        { FS_OPT_COMBO_CONGRUENT,"Combo: replaced by congruent" },
+       { FS_OPT_COND_EVAL,      "Conditional evaluation: removed conditional control flow" },
        { FS_OPT_RTS_ABS,        "RTS optimization: call to abs() replaced" },
        { FS_OPT_RTS_ALLOCA,     "RTS optimization: call to alloca() replaced" },
        { FS_OPT_RTS_SQRT,       "RTS optimization: call to sqrt() replaced" },