Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8278790: Inner loop of long loop nest runs for too few iterations
Reviewed-by: chagedorn, neliasso
  • Loading branch information
rwestrel committed Dec 17, 2021
1 parent 8494fec commit bb7efb3517b0ac66a55607c14aae3aef1f11c892
Showing 1 changed file with 5 additions and 4 deletions.
@@ -830,10 +830,6 @@ bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List &old_new) {
return false;
}

// May not have gone thru igvn yet so don't use _igvn.type(phi) (PhaseIdealLoop::is_counted_loop() sets the iv phi's type)
const TypeInteger* phi_t = phi->bottom_type()->is_integer(bt);
assert(phi_t->hi_as_long() >= phi_t->lo_as_long(), "dead phi?");
iters_limit = checked_cast<int>(MIN2((julong)iters_limit, (julong)(phi_t->hi_as_long() - phi_t->lo_as_long())));

IfNode* exit_test = head->loopexit();
BoolTest::mask mask = exit_test->as_BaseCountedLoopEnd()->test_trip();
@@ -851,6 +847,11 @@ bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List &old_new) {
}
}

// May not have gone thru igvn yet so don't use _igvn.type(phi) (PhaseIdealLoop::is_counted_loop() sets the iv phi's type)
const TypeInteger* phi_t = phi->bottom_type()->is_integer(bt);
assert(phi_t->hi_as_long() >= phi_t->lo_as_long(), "dead phi?");
iters_limit = checked_cast<int>(MIN2((julong)iters_limit, (julong)(phi_t->hi_as_long() - phi_t->lo_as_long())));

// We need a safepoint to insert empty predicates for the inner loop.
SafePointNode* safepoint;
if (bt == T_INT && head->as_CountedLoop()->is_strip_mined()) {

1 comment on commit bb7efb3

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on bb7efb3 Dec 17, 2021

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.