dbg_rem_poly_call, /**< Remove polymorphic call. */
dbg_dead_code, /**< Removing unreachable code, I.e. blocks that are never executed. */
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_backend, /**< A Firm subgraph was replaced because of a Backend transformation */
dbg_max /**< Maximum value. */
} dbg_action;
FS_OPT_CMP_SHF_TO_AND, /**< CMP optimization: transformed shift into And */
FS_OPT_CMP_MOD_TO_AND, /**< CMP optimization: transformed Mod into And */
FS_OPT_NOP, /**< the operation is a NOP */
+ FS_OPT_GVN_FOLLOWER, /**< GVN-PRE: replaced a follower */
+ FS_OPT_GVN_FULLY, /**< GVN-PRE: replaced by fully redundant value */
+ FS_OPT_GVN_PARTLY, /**< GVN-PRE: replaced by partly redundant value */
+ FS_OPT_COMBO_CONST, /**< Combo: evaluated into Constant */
+ 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_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 */
hook_merge_nodes(NULL, 0, &n, 1, HOOK_OPT_CONFIRM_E); \
} while(0)
+/**
+ * Merge the debug info due to a GVN-PRE result.
+ *
+ * @param oldn the old node
+ * @param n the new node replacing oldn
+ * @param flag firm statistics option
+ */
+#define DBG_OPT_GVN_PRE(oldn, n, flag) \
+ do { \
+ hook_merge_nodes(&n, 1, &oldn, 1, flag); \
+ __dbg_info_merge_pair(n, oldn, dbg_gvn_pre); \
+ } while(0)
+
+/**
+ * Merge the debug info due to a combo result.
+ *
+ * @param oldn the old node
+ * @param n the new node replacing oldn
+ * @param flag firm statistics option
+ */
+#define DBG_OPT_COMBO(oldn, n, flag) \
+ do { \
+ hook_merge_nodes(&n, 1, &oldn, 1, flag); \
+ __dbg_info_merge_pair(n, oldn, dbg_combo); \
+ } while(0)
+
#endif
CASE(dbg_rem_poly_call);
CASE(dbg_dead_code);
CASE(dbg_opt_confirm);
+ CASE(dbg_gvn_pre);
+ CASE(dbg_combo);
CASE(dbg_backend);
default:
if (a <= dbg_max)
#include "irop.h"
#include "irouts.h"
#include "irgmod.h"
+#include "iropt_dbg.h"
#include "debug.h"
#include "error.h"
if (can_exchange(pred)) {
ir_node *new_block = get_nodes_block(pred);
+ DBG_OPT_COMBO(block, new_block, FS_OPT_COMBO_CF);
exchange(block, new_block);
node->node = new_block;
env->modified = 1;
set_irn_node(c, node);
node->node = c;
DB((dbg, LEVEL_1, "%+F is replaced by %+F\n", phi, c));
+ DBG_OPT_COMBO(phi, c, FS_OPT_COMBO_CONST);
exchange(phi, c);
env->modified = 1;
} else {
node->node = s;
DB((dbg, LEVEL_1, "%+F is replaced by %+F because of cf change\n", phi, s));
+ DBG_OPT_COMBO(phi, s, FS_OPT_COMBO_FOLLOWER);
exchange(phi, s);
phi_node->node = s;
env->modified = 1;
if (can_exchange(pred)) {
ir_node *new_block = get_nodes_block(pred);
+ DBG_OPT_COMBO(block, new_block, FS_OPT_COMBO_CF);
exchange(block, new_block);
node->node = new_block;
env->modified = 1;
node_t *sel = get_irn_node(get_Cond_selector(cond));
if (is_tarval(sel->type.tv) && tarval_is_constant(sel->type.tv)) {
- /* Cond selector is a constant, make a Jmp */
+ /* Cond selector is a constant and the Proj is reachable, make a Jmp */
ir_node *jmp = new_r_Jmp(current_ir_graph, block->node);
set_irn_node(jmp, node);
node->node = jmp;
DB((dbg, LEVEL_1, "%+F is replaced by %+F\n", irn, jmp));
+ DBG_OPT_COMBO(irn, jmp, FS_OPT_COMBO_CF);
exchange(irn, jmp);
env->modified = 1;
}
set_irn_node(c, node);
node->node = c;
DB((dbg, LEVEL_1, "%+F is replaced by %+F\n", irn, c));
+ DBG_OPT_COMBO(irn, c, FS_OPT_COMBO_CONST);
exchange(irn, c);
env->modified = 1;
}
node->node = symc;
DB((dbg, LEVEL_1, "%+F is replaced by %+F\n", irn, symc));
+ DBG_OPT_COMBO(irn, symc, FS_OPT_COMBO_CONST);
exchange(irn, symc);
env->modified = 1;
}
if (leader != irn) {
DB((dbg, LEVEL_1, "%+F from part%d is replaced by %+F\n", irn, node->part->nr, leader));
+ if (node->is_follower)
+ DBG_OPT_COMBO(irn, leader, FS_OPT_COMBO_FOLLOWER);
+ else
+ DBG_OPT_COMBO(irn, leader, FS_OPT_COMBO_CONGRUENT);
exchange(irn, leader);
env->modified = 1;
}
{ FS_OPT_CMP_SHF_TO_AND, "CMP optimization: transformed shift into And" },
{ FS_OPT_CMP_MOD_TO_AND, "CMP optimization: transformed Mod into And" },
{ FS_OPT_NOP, "the operation is a NOP" },
+ { FS_OPT_GVN_FOLLOWER, "GVN-PRE: replaced a follower" },
+ { FS_OPT_GVN_FULLY, "GVN-PRE: replaced by fully redundant value" },
+ { FS_OPT_GVN_PARTLY, "GVN-PRE: replaced by partly redundant value" },
+ { FS_OPT_COMBO_CONST, "Combo: evaluated into Constant" },
+ { 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_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" },