DEBUG_ONLY(static firm_dbg_module_t *dbg;)
/**
- * Return the effective use block of a node and it's predecessor on
+ * Return the effective use block of a node and its predecessor on
* position pos.
*
* @param node the node
*
* @param block the block which is entered by the branch
* @param cmp the Cmp node expressing the branch condition
- * @param pnc the Compare relation for taking this branch
+ * @param rel the Compare relation for taking this branch
* @param env statistical environment
*/
-static void handle_if(ir_node *block, ir_node *cmp, pn_Cmp pnc, env_t *env)
+static void handle_if(ir_node *block, ir_node *cmp, ir_relation rel, env_t *env)
{
ir_node *left = get_Cmp_left(cmp);
ir_node *right = get_Cmp_right(cmp);
left = right;
right = t;
- pnc = get_inversed_pnc(pnc);
+ rel = get_inversed_relation(rel);
}
/*
* First case: both values are identical.
* replace the left one by the right (potentially const) one.
*/
- if (pnc == pn_Cmp_Eq) {
+ if (rel == ir_relation_equal) {
cond_block = get_Block_cfgpred_block(block, 0);
for (edge = get_irn_out_edge_first(left); edge; edge = next) {
ir_node *user = get_edge_src_irn(edge);
/*
* The user of the user is dominated by our true/false
* block. So, create a copy of user WITH the constant
- * replacing it's pos'th input.
+ * replacing its pos'th input.
*
* This is always good for unop's and might be good
* for binops.
}
}
}
- } else { /* not pn_Cmp_Eq cases */
+ } else { /* not ir_relation_equal cases */
ir_node *c = NULL;
foreach_out_edge_safe(left, edge, next) {
* We can replace the input with a Confirm(left, pnc, right).
*/
if (! c)
- c = new_r_Confirm(block, left, right, pnc);
+ c = new_r_Confirm(block, left, right, rel);
pos = get_edge_src_pos(edge);
set_irn_n(succ, pos, c);
/* also construct inverse Confirms */
ir_node *rc = NULL;
- pnc = get_inversed_pnc(pnc);
+ rel = get_inversed_relation(rel);
foreach_out_edge_safe(right, edge, next) {
ir_node *succ = get_edge_src_irn(edge);
int pos;
/*
* Ok, we found a usage of right in a block
* dominated by the branch block.
- * We can replace the input with a Confirm(right, pnc^-1, left).
+ * We can replace the input with a Confirm(right, rel^-1, left).
*/
if (! rc)
- rc = new_r_Confirm(block, right, left, pnc);
+ rc = new_r_Confirm(block, right, left, rel);
pos = get_edge_src_pos(edge);
set_irn_n(succ, pos, rc);
mode = get_irn_mode(selector);
if (mode == mode_b) {
- ir_node *cmp;
- pn_Cmp pnc;
+ ir_relation rel;
handle_modeb(block, selector, (pn_Cond) get_Proj_proj(proj), env);
- /* this should be an IF, check this */
- if (! is_Proj(selector))
+ if (! is_Cmp(selector))
return;
- cmp = get_Proj_pred(selector);
- if (! is_Cmp(cmp))
- return;
-
- pnc = (pn_Cmp) get_Proj_proj(selector);
+ rel = get_Cmp_relation(selector);
if (get_Proj_proj(proj) != pn_Cond_true) {
/* it's the false branch */
- mode = get_irn_mode(get_Cmp_left(cmp));
- pnc = get_negated_pnc(pnc, mode);
+ mode = get_irn_mode(get_Cmp_left(selector));
+ rel = get_negated_relation(rel);
}
- DB((dbg, LEVEL_2, "At %+F using %+F Confirm %=\n", block, cmp, pnc));
+ DB((dbg, LEVEL_2, "At %+F using %+F Confirm %=\n", block, selector, rel));
- handle_if(block, cmp, pnc, env);
+ handle_if(block, selector, rel, env);
} else if (mode_is_int(mode)) {
long proj_nr = get_Proj_proj(proj);
for (;;) {
if (! is_Confirm(ptr))
break;
- if (get_Confirm_cmp(ptr) == pn_Cmp_Lg) {
+ if (get_Confirm_relation(ptr) == ir_relation_less_greater) {
ir_node *bound = get_Confirm_bound(ptr);
if (is_Const(bound) && is_Const_null(bound))
ir_mode *mode = get_irn_mode(ptr);
ir_graph *irg = get_irn_irg(block);
c = new_r_Const(irg, get_mode_null(mode));
- c = new_r_Confirm(block, ptr, c, pn_Cmp_Lg);
+ c = new_r_Confirm(block, ptr, c, ir_relation_less_greater);
}
set_irn_n(succ, pos, c);
irg_block_walk_graph(irg, insert_Confirm_in_block, NULL, &env);
}
- if (env.num_confirms | env.num_consts | env.num_eq) {
- /* we have add nodes or changed DF edges */
- set_irg_outs_inconsistent(irg);
-
- /* the new nodes are not in the loop info */
- set_irg_loopinfo_inconsistent(irg);
- }
-
DB((dbg, LEVEL_1, "# Confirms inserted : %u\n", env.num_confirms));
DB((dbg, LEVEL_1, "# Const replacements: %u\n", env.num_consts));
DB((dbg, LEVEL_1, "# node equalities : %u\n", env.num_eq));