From 5022905bace816183da531dfe0efbee3196ccd9e Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 26 Aug 2008 11:23:57 +0000 Subject: [PATCH] Do NOT call DBG_OPT_CSE() in identify remember, as this is used for different purposes, call it only if a node is really replaced. [r21475] --- ir/ir/iropt.c | 19 ++++++++++++++----- ir/opt/opt_inline.c | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index b0379e774..28df36c96 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -6083,7 +6083,6 @@ ir_node *identify_remember(pset *value_table, ir_node *n) { if (o != n) { update_known_irn(o, n); - DBG_OPT_CSE(n, o); } return o; @@ -6321,7 +6320,10 @@ ir_node *optimize_node(ir_node *n) { /* Now we have a legal, useful node. Enter it in hash table for CSE */ if (get_opt_cse() && (get_irn_opcode(n) != iro_Block)) { - n = identify_remember(current_ir_graph->value_table, n); + ir_node *o = n; + n = identify_remember(current_ir_graph->value_table, o); + if (o != n) + DBG_OPT_CSE(o, n); } return n; @@ -6386,7 +6388,10 @@ ir_node *optimize_in_place_2(ir_node *n) { now all nodes are op_pin_state_pinned to blocks, i.e., the cse only finds common subexpressions within a block. */ if (get_opt_cse()) { - n = identify_remember(current_ir_graph->value_table, n); + ir_node *o = n; + n = identify_remember(current_ir_graph->value_table, o); + if (o != n) + DBG_OPT_CSE(o, n); } /* Some more constant expression evaluation. */ @@ -6406,8 +6411,12 @@ ir_node *optimize_in_place_2(ir_node *n) { /* Now we have a legal, useful node. Enter it in hash table for cse. Blocks should be unique anyways. (Except the successor of start: is cse with the start block!) */ - if (get_opt_cse() && (get_irn_opcode(n) != iro_Block)) - n = identify_remember(current_ir_graph->value_table, n); + if (get_opt_cse() && (get_irn_opcode(n) != iro_Block)) { + ir_node *o = n; + n = identify_remember(current_ir_graph->value_table, o); + if (o != n) + DBG_OPT_CSE(o, n); + } return n; } /* optimize_in_place_2 */ diff --git a/ir/opt/opt_inline.c b/ir/opt/opt_inline.c index 60ff552ec..45e55c82a 100644 --- a/ir/opt/opt_inline.c +++ b/ir/opt/opt_inline.c @@ -60,6 +60,7 @@ #include "irflag_t.h" #include "irhooks.h" #include "irtools.h" +#include "iropt_dbg.h" DEBUG_ONLY(static firm_dbg_module_t *dbg;) @@ -759,6 +760,7 @@ static void copy_preds_inline(ir_node *n, void *env) { n = identify_remember(current_ir_graph->value_table, nn); if (nn != n) { + DBG_OPT_CSE(nn, n); exchange(nn, n); } } -- 2.20.1