Skip to content

Commit

Permalink
Review Emanuel
Browse files Browse the repository at this point in the history
  • Loading branch information
chhagedorn committed Feb 26, 2024
1 parent 5a314ff commit 96798d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/hotspot/share/opto/ifnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,17 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
}

IfNode* IfNode::make_with_same_profile(IfNode* if_node_profile, Node* ctrl, BoolNode* bol) {
// Assert here that we only try to create a clone from an If node with the same profiling if that actually makes sense.
// Some If node subtypes should not be cloned in this way. In theory, we should not clone BaseCountedLoopEndNodes.
// But they can end up being used as normal If nodes when peeling a loop - they serve as zero-trip guard.
// Allow them as well.
assert(if_node_profile->Opcode() == Op_If || if_node_profile->is_RangeCheck()
|| if_node_profile->is_BaseCountedLoopEnd(), "should not clone other nodes");
if (if_node_profile->is_RangeCheck()) {
// RangeCheck nodes could be further optimized.
return new RangeCheckNode(ctrl, bol, if_node_profile->_prob, if_node_profile->_fcnt);
} else {
// Not a RangeCheckNode? Fall back to IfNode. Assert here that we only try to create a clone from an If node with
// the same profiling if that actually makes sense. Some If node subtypes should not be cloned in this way.
// In theory, we should not clone BaseCountedLoopEndNodes. But they can end up being used as normal If nodes when
// peeling a loop - they serve as zero-trip guard. Allow them as well.
assert(if_node_profile->Opcode() == Op_If || if_node_profile->is_RangeCheck()
|| if_node_profile->is_BaseCountedLoopEnd(), "should not clone other nodes");
// Not a RangeCheckNode? Fall back to IfNode.
return new IfNode(ctrl, bol, if_node_profile->_prob, if_node_profile->_fcnt);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public static void main(String[] k) {
}
}


public static void testLongCountedLoopEnd() {
long limit = lFld;
for (int i = 0; i < 100; i++) {
Expand Down

0 comments on commit 96798d1

Please sign in to comment.