--- a/src/hotspot/share/opto/split_if.cpp Mon Oct 07 12:06:47 2019 +0200
+++ b/src/hotspot/share/opto/split_if.cpp Tue Oct 01 10:28:12 2019 +0200
@@ -110,83 +110,90 @@
n->dump();
}
#endif
- // Clone down any block-local BoolNode uses of this CmpNode
- for (DUIterator i = n->outs(); n->has_out(i); i++) {
- Node* bol = n->out(i);
- assert( bol->is_Bool(), "" );
- if (bol->outcnt() == 1) {
- Node* use = bol->unique_out();
- 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 (!n->is_FastLock()) {
+ // Clone down any block-local BoolNode uses of this CmpNode
+ for (DUIterator i = n->outs(); n->has_out(i); i++) {
+ Node* bol = n->out(i);
+ assert( bol->is_Bool(), "" );
+ if (bol->outcnt() == 1) {
+ Node* use = bol->unique_out();
+ 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 {
+ // We might see an Opaque1 from a loop limit check here
+ assert(use->is_If() || use->is_CMove() || use->Opcode() == Op_Opaque1, "unexpected node type");
+ Node *use_c = use->is_If() ? use->in(0) : get_ctrl(use);
if (use_c == blk1 || use_c == blk2) {
+ assert(use->is_CMove(), "unexpected node type");
continue;
}
}
- } else {
- // We might see an Opaque1 from a loop limit check here
- assert(use->is_If() || use->is_CMove() || use->Opcode() == Op_Opaque1, "unexpected node type");
- Node *use_c = use->is_If() ? use->in(0) : get_ctrl(use);
- if (use_c == blk1 || use_c == blk2) {
- assert(use->is_CMove(), "unexpected node type");
- continue;
+ }
+ if (get_ctrl(bol) == blk1 || get_ctrl(bol) == blk2) {
+ // Recursively sink any BoolNode
+#ifndef PRODUCT
+ if( PrintOpto && VerifyLoopOptimizations ) {
+ tty->print("Cloning down: ");
+ bol->dump();
}
- }
- }
- if (get_ctrl(bol) == blk1 || get_ctrl(bol) == blk2) {
- // Recursively sink any BoolNode
-#ifndef PRODUCT
- if( PrintOpto && VerifyLoopOptimizations ) {
- tty->print("Cloning down: ");
- bol->dump();
- }
#endif
- 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, "" );
+ 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 {
+ // We might see an Opaque1 from a loop limit check here
+ assert(u->is_If() || u->is_CMove() || u->Opcode() == Op_Opaque1, "unexpected node type");
+ assert(u->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 *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);
+ Node *u_ctrl = u->is_If() ? u->in(0) : get_ctrl(u);
+ assert((u_ctrl != blk1 && u_ctrl != blk2) || u->is_CMove(), "won't converge");
+ Node *x = bol->clone();
+ register_new_node(x, u_ctrl);
+ _igvn.replace_input_of(u, 1, x);
+ --j;
}
- _igvn.remove_dead_node(u);
- --j;
- } else {
- // We might see an Opaque1 from a loop limit check here
- assert(u->is_If() || u->is_CMove() || u->Opcode() == Op_Opaque1, "unexpected node type");
- assert(u->in(1) == bol, "");
- // Get control block of either the CMove or the If input
- Node *u_ctrl = u->is_If() ? u->in(0) : get_ctrl(u);
- assert((u_ctrl != blk1 && u_ctrl != blk2) || u->is_CMove(), "won't converge");
- Node *x = bol->clone();
- register_new_node(x, u_ctrl);
- _igvn.replace_input_of(u, 1, x);
- --j;
}
+ _igvn.remove_dead_node(bol);
+ --i;
}
- _igvn.remove_dead_node(bol);
- --i;
}
}
// Clone down this CmpNode
for (DUIterator_Last jmin, j = n->last_outs(jmin); j >= jmin; --j) {
- Node* bol = n->last_out(j);
- assert( bol->in(1) == n, "" );
+ Node* use = n->last_out(j);
+ uint pos = 1;
+ if (n->is_FastLock()) {
+ pos = TypeFunc::Parms + 2;
+ assert(use->is_Lock(), "FastLock only used by LockNode");
+ }
+ assert(use->in(pos) == n, "" );
Node *x = n->clone();
- register_new_node(x, get_ctrl(bol));
- _igvn.replace_input_of(bol, 1, x);
+ register_new_node(x, ctrl_or_self(use));
+ _igvn.replace_input_of(use, pos, x);
}
_igvn.remove_dead_node( n );