diff --git a/src/share/vm/opto/split_if.cpp b/src/share/vm/opto/split_if.cpp --- a/src/share/vm/opto/split_if.cpp +++ b/src/share/vm/opto/split_if.cpp @@ -116,9 +116,21 @@ assert( bol->is_Bool(), "" ); if (bol->outcnt() == 1) { Node* use = bol->unique_out(); - Node *use_c = use->is_If() ? use->in(0) : get_ctrl(use); - if (use_c == blk1 || use_c == blk2) { - continue; + if (use->Opcode() == Op_Opaque4) { + if (use->outcnt() == 1) { + Node* iff = use->unique_out(); + assert(iff->is_If(), "unexpected node type"); + Node *use_c = iff->in(0); + if (use_c == blk1 || use_c == blk2) { + continue; + } + } + } else { + assert(use->is_If() || use->is_CMove(), "unexpected node type"); + Node *use_c = use->is_If() ? use->in(0) : get_ctrl(use); + if (use_c == blk1 || use_c == blk2) { + continue; + } } } if (get_ctrl(bol) == blk1 || get_ctrl(bol) == blk2) { @@ -129,15 +141,37 @@ bol->dump(); } #endif - for (DUIterator_Last jmin, j = bol->last_outs(jmin); j >= jmin; --j) { - // Uses are either IfNodes or CMoves - Node* iff = bol->last_out(j); - assert( iff->in(1) == bol, "" ); - // Get control block of either the CMove or the If input - Node *iff_ctrl = iff->is_If() ? iff->in(0) : get_ctrl(iff); - Node *x = bol->clone(); - register_new_node(x, iff_ctrl); - _igvn.replace_input_of(iff, 1, x); + for (DUIterator j = bol->outs(); bol->has_out(j); j++) { + Node* u = bol->out(j); + // Uses are either IfNodes, CMoves or Opaque4 + if (u->Opcode() == Op_Opaque4) { + assert(u->in(1) == bol, "bad input"); + for (DUIterator_Last kmin, k = u->last_outs(kmin); k >= kmin; --k) { + Node* iff = u->last_out(k); + assert(iff->is_If() || iff->is_CMove(), "unexpected node type"); + assert( iff->in(1) == u, "" ); + // Get control block of either the CMove or the If input + Node *iff_ctrl = iff->is_If() ? iff->in(0) : get_ctrl(iff); + Node *x1 = bol->clone(); + Node *x2 = u->clone(); + register_new_node(x1, iff_ctrl); + register_new_node(x2, iff_ctrl); + _igvn.replace_input_of(x2, 1, x1); + _igvn.replace_input_of(iff, 1, x2); + } + _igvn.remove_dead_node(u); + --j; + } else { + Node* iff = u; + assert(iff->is_If() || iff->is_CMove(), "unexpected node type"); + assert( iff->in(1) == bol, "" ); + // Get control block of either the CMove or the If input + Node *iff_ctrl = iff->is_If() ? iff->in(0) : get_ctrl(iff); + Node *x = bol->clone(); + register_new_node(x, iff_ctrl); + _igvn.replace_input_of(iff, 1, x); + --j; + } } _igvn.remove_dead_node( bol ); --i;