diff --git a/src/share/vm/opto/loopTransform.cpp b/src/share/vm/opto/loopTransform.cpp index 4ff59d9d46ecce386a78a9103b71373c461b35cc..d315a9e6c61a33138942a1f46abf5c8de7238931 100644 --- a/src/share/vm/opto/loopTransform.cpp +++ b/src/share/vm/opto/loopTransform.cpp @@ -1630,6 +1630,10 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_ // Before attempting fancy unrolling, RCE or alignment, see if we want // to completely unroll this loop or do loop unswitching. if( cl->is_normal_loop() ) { + if (should_unswitch) { + phase->do_unswitching(this, old_new); + return true; + } bool should_maximally_unroll = policy_maximally_unroll(phase); if( should_maximally_unroll ) { // Here we did some unrolling and peeling. Eventually we will @@ -1637,10 +1641,6 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_ phase->do_maximally_unroll(this,old_new); return true; } - if (should_unswitch) { - phase->do_unswitching(this, old_new); - return true; - } }