-static void handle_if(ir_node *block, ir_node *cmp, pn_Cmp pnc, env_t *env)
-{
- ir_node *left = get_Cmp_left(cmp);
- ir_node *right = get_Cmp_right(cmp);
- ir_op *op;
- const ir_edge_t *edge, *next;
-
- /* Beware of Bads */
- if (is_Bad(left) ||is_Bad(right))
- return;
-
- op = get_irn_op(left);
-
- /* Do not create Confirm nodes for Cmp(Const, Const) constructs.
- These are removed anyway */
- if (op == op_Const && is_Const(right))
- return;
-
- /* try to place the constant on the right side for a Confirm */
- if (op == op_Const || op == op_SymConst) {
- ir_node *t = left;
-
- left = right;
- right = t;
-
- pnc = get_inversed_pnc(pnc);
- }
-
- /*
- * First case: both values are identical.
- * replace the left one by the right (potentially const) one.
- */
- if (pnc == pn_Cmp_Eq) {
- for (edge = get_irn_out_edge_first(left); edge; edge = next) {
- ir_node *succ = get_edge_src_irn(edge);
- int pos = get_edge_src_pos(edge);
- ir_node *blk = get_effective_use_block(succ, pos);
-
- next = get_irn_out_edge_next(left, edge);
- if (block_dominates(block, blk)) {
- /*
- * Ok, we found a usage of left in a block
- * dominated by the branch block.
- * We can replace the input with right.
- */
- set_irn_n(succ, pos, right);
- DBG_OPT_CONFIRM(left, right);
-
-// ir_printf("2 Replacing input %d of node %n with %n\n", pos, succ, right);
-
- env->num_eq += 1;
- }
- }
- }
- else { /* not pn_Cmp_Eq cases */
- ir_node *c = NULL;
-
- for (edge = get_irn_out_edge_first(left); edge; edge = next) {
- ir_node *succ = get_edge_src_irn(edge);
- int pos = get_edge_src_pos(edge);
- ir_node *blk = get_effective_use_block(succ, pos);
-
- next = get_irn_out_edge_next(left, edge);
- if (block_dominates(block, blk)) {
- /*
- * Ok, we found a usage of left in a block
- * dominated by the branch block.
- * We can replace the input with a Confirm(left, pnc, right).
- */
- if (! c)
- c = new_r_Confirm(current_ir_graph, block, left, right, pnc);
-
- pos = get_edge_src_pos(edge);
- set_irn_n(succ, pos, c);
-// ir_printf("3 Replacing input %d of node %n with %n\n", pos, succ, c);
-
- env->num_confirms += 1;
- }
- }
- }
+static void handle_if(ir_node *block, ir_node *cmp, pn_Cmp pnc, env_t *env) {
+ ir_node *left = get_Cmp_left(cmp);
+ ir_node *right = get_Cmp_right(cmp);
+ ir_op *op;
+ const ir_edge_t *edge, *next;
+
+ /* Beware of Bads */
+ if (is_Bad(left) ||is_Bad(right))
+ return;
+
+ op = get_irn_op(left);
+
+ /* Do not create Confirm nodes for Cmp(Const, Const) constructs.
+ These are removed anyway */
+ if (op == op_Const && is_Const(right))
+ return;
+
+ /* try to place the constant on the right side for a Confirm */
+ if (op == op_Const || op == op_SymConst) {
+ ir_node *t = left;
+
+ left = right;
+ right = t;
+
+ pnc = get_inversed_pnc(pnc);
+ }
+
+ /*
+ * First case: both values are identical.
+ * replace the left one by the right (potentially const) one.
+ */
+ if (pnc == pn_Cmp_Eq) {
+ for (edge = get_irn_out_edge_first(left); edge; edge = next) {
+ ir_node *succ = get_edge_src_irn(edge);
+ int pos = get_edge_src_pos(edge);
+ ir_node *blk = get_effective_use_block(succ, pos);
+
+ next = get_irn_out_edge_next(left, edge);
+ if (block_dominates(block, blk)) {
+ /*
+ * Ok, we found a usage of left in a block
+ * dominated by the branch block.
+ * We can replace the input with right.
+ */
+ set_irn_n(succ, pos, right);
+ DBG_OPT_CONFIRM(left, right);
+
+// ir_printf("2 Replacing input %d of node %n with %n\n", pos, succ, right);
+
+ env->num_eq += 1;
+ }
+ }
+ } else { /* not pn_Cmp_Eq cases */
+ ir_node *c = NULL;
+
+ for (edge = get_irn_out_edge_first(left); edge; edge = next) {
+ ir_node *succ = get_edge_src_irn(edge);
+ int pos = get_edge_src_pos(edge);
+ ir_node *blk = get_effective_use_block(succ, pos);
+
+ next = get_irn_out_edge_next(left, edge);
+ if (block_dominates(block, blk)) {
+ /*
+ * Ok, we found a usage of left in a block
+ * dominated by the branch block.
+ * We can replace the input with a Confirm(left, pnc, right).
+ */
+ if (! c)
+ c = new_r_Confirm(current_ir_graph, block, left, right, pnc);
+
+ pos = get_edge_src_pos(edge);
+ set_irn_n(succ, pos, c);
+// ir_printf("3 Replacing input %d of node %n with %n\n", pos, succ, c);
+
+ env->num_confirms += 1;
+ }
+ }
+ }