Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit bb7efb3

Browse files
committed
8278790: Inner loop of long loop nest runs for too few iterations
Reviewed-by: chagedorn, neliasso
1 parent 8494fec commit bb7efb3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/hotspot/share/opto/loopnode.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -830,10 +830,6 @@ bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List &old_new) {
830830
return false;
831831
}
832832

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

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

850+
// May not have gone thru igvn yet so don't use _igvn.type(phi) (PhaseIdealLoop::is_counted_loop() sets the iv phi's type)
851+
const TypeInteger* phi_t = phi->bottom_type()->is_integer(bt);
852+
assert(phi_t->hi_as_long() >= phi_t->lo_as_long(), "dead phi?");
853+
iters_limit = checked_cast<int>(MIN2((julong)iters_limit, (julong)(phi_t->hi_as_long() - phi_t->lo_as_long())));
854+
854855
// We need a safepoint to insert empty predicates for the inner loop.
855856
SafePointNode* safepoint;
856857
if (bt == T_INT && head->as_CountedLoop()->is_strip_mined()) {

0 commit comments

Comments
 (0)