Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8235584: UseProfiledLoopPredicate fails with assert(_phase->get_loop(…
…c) == loop) failed: have to be in the same loop

Backport-of: 995fae6
  • Loading branch information
Yuri Nesterenko committed Jan 22, 2021
1 parent 51bca9f commit e0445f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/hotspot/share/opto/loopPredicate.cpp
Expand Up @@ -1466,8 +1466,9 @@ bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) {
// an early loop exit. Try them with profile data.
while (if_proj_list.size() > 0) {
Node* proj = if_proj_list.pop();
float f = pf.to(proj);
if (proj->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none) &&
pf.to(proj) * loop_trip_cnt >= 1) {
f * loop_trip_cnt >= 1) {
hoisted = loop_predication_impl_helper(loop, proj->as_Proj(), profile_predicate_proj, cl, zero, invar, Deoptimization::Reason_profile_predicate) | hoisted;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/share/opto/loopnode.cpp
Expand Up @@ -946,19 +946,19 @@ Node *LoopNode::Ideal(PhaseGVN *phase, bool can_reshape) {

#ifdef ASSERT
void LoopNode::verify_strip_mined(int expect_skeleton) const {
if (!is_valid_counted_loop()) {
return; // Skip malformed counted loop
}
const OuterStripMinedLoopNode* outer = NULL;
const CountedLoopNode* inner = NULL;
if (is_strip_mined()) {
if (!is_valid_counted_loop()) {
return; // Skip malformed counted loop
}
assert(is_CountedLoop(), "no Loop should be marked strip mined");
inner = as_CountedLoop();
outer = inner->in(LoopNode::EntryControl)->as_OuterStripMinedLoop();
} else if (is_OuterStripMinedLoop()) {
outer = this->as_OuterStripMinedLoop();
inner = outer->unique_ctrl_out()->as_CountedLoop();
assert(inner->is_valid_counted_loop(), "OuterStripMinedLoop should have been removed");
assert(inner->is_valid_counted_loop() && inner->is_strip_mined(), "OuterStripMinedLoop should have been removed");
assert(!is_strip_mined(), "outer loop shouldn't be marked strip mined");
}
if (inner != NULL || outer != NULL) {
Expand Down Expand Up @@ -1240,7 +1240,7 @@ Node* CountedLoopNode::match_incr_with_optional_truncation(
}

LoopNode* CountedLoopNode::skip_strip_mined(int expect_skeleton) {
if (is_strip_mined()) {
if (is_strip_mined() && is_valid_counted_loop()) {
verify_strip_mined(expect_skeleton);
return in(EntryControl)->as_Loop();
}
Expand Down

1 comment on commit e0445f1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.