Skip to content

Commit

Permalink
Add more comments and asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
chhagedorn committed Apr 25, 2024
1 parent 30f626b commit 089a4e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/hotspot/share/opto/loopTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,7 @@ void PhaseIdealLoop::update_main_loop_assertion_predicates(Node* ctrl, CountedLo
prev_proj);
assert(!assertion_predicate_has_loop_opaque_node(prev_proj->in(0)->as_If()), "unexpected");
} else {
// Ignore Opaque4 from a null-check for an intrinsic or unsafe access. This could happen when we maximally
// Ignore Opaque4 from a non-null-check for an intrinsic or unsafe access. This could happen when we maximally
// unroll a non-main loop with such an If with an Opaque4 node directly above the loop entry.
assert(!loop_head->is_main_loop(), "Opaque4 node from a non-null check - should not be at main loop");
}
Expand Down Expand Up @@ -2023,6 +2023,7 @@ void PhaseIdealLoop::copy_assertion_predicates_to_post_loop(LoopNode* main_loop_
break;
}
if (iff->in(1)->is_Opaque4()) {
// Initialize from Template Assertion Predicate.
assert(assertion_predicate_has_loop_opaque_node(iff), "must find OpaqueLoop* nodes");
prev_proj = clone_assertion_predicate_and_initialize(iff, init, stride, ctrl, proj, post_loop_entry,
post_loop, prev_proj);
Expand Down Expand Up @@ -2060,6 +2061,7 @@ void PhaseIdealLoop::initialize_assertion_predicates_for_peeled_loop(const Predi
Node* bol = iff->in(1);
assert(!bol->is_OpaqueInitializedAssertionPredicate(), "should not find an Initialized Assertion Predicate");
if (bol->is_Opaque4()) {
// Initialize from Template Assertion Predicate.
assert(assertion_predicate_has_loop_opaque_node(iff), "must find OpaqueLoop* nodes");
input_proj = clone_assertion_predicate_and_initialize(iff, init, stride, next_regular_predicate_proj, uncommon_proj, control,
outer_loop, input_proj);
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/opto/loopopts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,11 @@ Node *PhaseIdealLoop::conditional_move( Node *region ) {
}
}//for
Node* bol = iff->in(1);
assert(!bol->is_OpaqueInitializedAssertionPredicate(), "Initialized Assertion Predicates cannot form a diamond");
assert(!bol->is_OpaqueInitializedAssertionPredicate(), "Initialized Assertion Predicates cannot form a diamond with Halt");
if (bol->is_Opaque4()) {
// Ignore Template Assertion Predicates with Opaque4 nodes.
assert(assertion_predicate_has_loop_opaque_node(iff),
"must be Template Assertion Predicate, non-null-check with Opaque4 cannot form a diamond with Halt");
return nullptr;
}
assert(bol->Opcode() == Op_Bool, "Unexpected node");
Expand Down

0 comments on commit 089a4e6

Please sign in to comment.