Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk13u-dev Public archive

Commit e0445f1

Browse files
author
Yuri Nesterenko
committed
8235584: UseProfiledLoopPredicate fails with assert(_phase->get_loop(c) == loop) failed: have to be in the same loop
Backport-of: 995fae6
1 parent 51bca9f commit e0445f1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/hotspot/share/opto/loopPredicate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,8 +1466,9 @@ bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) {
14661466
// an early loop exit. Try them with profile data.
14671467
while (if_proj_list.size() > 0) {
14681468
Node* proj = if_proj_list.pop();
1469+
float f = pf.to(proj);
14691470
if (proj->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none) &&
1470-
pf.to(proj) * loop_trip_cnt >= 1) {
1471+
f * loop_trip_cnt >= 1) {
14711472
hoisted = loop_predication_impl_helper(loop, proj->as_Proj(), profile_predicate_proj, cl, zero, invar, Deoptimization::Reason_profile_predicate) | hoisted;
14721473
}
14731474
}

src/hotspot/share/opto/loopnode.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -946,19 +946,19 @@ Node *LoopNode::Ideal(PhaseGVN *phase, bool can_reshape) {
946946

947947
#ifdef ASSERT
948948
void LoopNode::verify_strip_mined(int expect_skeleton) const {
949-
if (!is_valid_counted_loop()) {
950-
return; // Skip malformed counted loop
951-
}
952949
const OuterStripMinedLoopNode* outer = NULL;
953950
const CountedLoopNode* inner = NULL;
954951
if (is_strip_mined()) {
952+
if (!is_valid_counted_loop()) {
953+
return; // Skip malformed counted loop
954+
}
955955
assert(is_CountedLoop(), "no Loop should be marked strip mined");
956956
inner = as_CountedLoop();
957957
outer = inner->in(LoopNode::EntryControl)->as_OuterStripMinedLoop();
958958
} else if (is_OuterStripMinedLoop()) {
959959
outer = this->as_OuterStripMinedLoop();
960960
inner = outer->unique_ctrl_out()->as_CountedLoop();
961-
assert(inner->is_valid_counted_loop(), "OuterStripMinedLoop should have been removed");
961+
assert(inner->is_valid_counted_loop() && inner->is_strip_mined(), "OuterStripMinedLoop should have been removed");
962962
assert(!is_strip_mined(), "outer loop shouldn't be marked strip mined");
963963
}
964964
if (inner != NULL || outer != NULL) {
@@ -1240,7 +1240,7 @@ Node* CountedLoopNode::match_incr_with_optional_truncation(
12401240
}
12411241

12421242
LoopNode* CountedLoopNode::skip_strip_mined(int expect_skeleton) {
1243-
if (is_strip_mined()) {
1243+
if (is_strip_mined() && is_valid_counted_loop()) {
12441244
verify_strip_mined(expect_skeleton);
12451245
return in(EntryControl)->as_Loop();
12461246
}

0 commit comments

Comments
 (0)