During global CSE we now ignore nodes in unreachable blocks,
otherwise cse could pick the wrong representative node
and use unreachable nodes in reachable code.
if (value_table == NULL)
return n;
+ if (get_opt_global_cse()) {
+ /* do not remember unreachable nodes */
+ if (get_irg_dom_state(irg) == dom_consistent && !is_Block(n)) {
+ ir_node *block = get_nodes_block(n);
+ if (get_Block_dom_depth(block) < 0) {
+ return n;
+ }
+ }
+ }
+
ir_normalize_node(n);
/* lookup or insert in hash table with given hash key. */
nn = (ir_node*)pset_insert(value_table, n, ir_node_hash(n));