From: Michael Beck Date: Wed, 14 Jan 2009 15:12:24 +0000 (+0000) Subject: - add support for cond_eval statistics X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=e690de805182c6c6f15d73b8649e59ffb7f84b6a;p=libfirm - add support for cond_eval statistics [r25194] --- diff --git a/include/libfirm/dbginfo.h b/include/libfirm/dbginfo.h index 48e2177a7..d92482a11 100644 --- a/include/libfirm/dbginfo.h +++ b/include/libfirm/dbginfo.h @@ -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; diff --git a/include/libfirm/firmstat.h b/include/libfirm/firmstat.h index 9151f7496..813bfc1b1 100644 --- a/include/libfirm/firmstat.h +++ b/include/libfirm/firmstat.h @@ -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 */ diff --git a/include/libfirm/iropt_dbg.h b/include/libfirm/iropt_dbg.h index a504c1dd3..df2fa6367 100644 --- a/include/libfirm/iropt_dbg.h +++ b/include/libfirm/iropt_dbg.h @@ -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 @@ -416,4 +416,16 @@ __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 diff --git a/ir/debug/dbginfo.c b/ir/debug/dbginfo.c index 2f4d72dda..fedaab402 100644 --- a/ir/debug/dbginfo.c +++ b/ir/debug/dbginfo.c @@ -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) diff --git a/ir/stat/stat_dmp.c b/ir/stat/stat_dmp.c index 64554985a..dba32d37f 100644 --- a/ir/stat/stat_dmp.c +++ b/ir/stat/stat_dmp.c @@ -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" },