@@ -3022,11 +3022,11 @@ void IdealLoopTree::remove_main_post_loops(CountedLoopNode *cl, PhaseIdealLoop *
30223022 phase->_igvn .replace_input_of (main_cmp, 2 , main_cmp->in (2 )->in (1 ));
30233023}
30243024
3025- // ------------------------------policy_do_remove_empty_loop --------------------
3026- // Micro-benchmark spamming . Policy is to always remove empty loops.
3027- // The 'DO' part is to replace the trip counter with the value it will
3028- // have on the last iteration. This will break the loop.
3029- bool IdealLoopTree::policy_do_remove_empty_loop ( PhaseIdealLoop *phase ) {
3025+ // ------------------------------do_remove_empty_loop------- --------------------
3026+ // We always attempt remove empty loops . The approach is to replace the trip
3027+ // counter with the value it will have on the last iteration. This will break
3028+ // the loop.
3029+ bool IdealLoopTree::do_remove_empty_loop ( PhaseIdealLoop *phase) {
30303030 // Minimum size must be empty loop
30313031 if (_body.size () > EMPTY_LOOP_SIZE)
30323032 return false ;
@@ -3143,12 +3143,12 @@ bool IdealLoopTree::policy_do_remove_empty_loop( PhaseIdealLoop *phase ) {
31433143 return true ;
31443144}
31453145
3146- // ------------------------------policy_do_one_iteration_loop -------------------
3146+ // ------------------------------do_one_iteration_loop------- -------------------
31473147// Convert one iteration loop into normal code.
3148- bool IdealLoopTree::policy_do_one_iteration_loop ( PhaseIdealLoop *phase ) {
3149- if (!_head->as_Loop ()->is_valid_counted_loop ())
3148+ bool IdealLoopTree::do_one_iteration_loop ( PhaseIdealLoop *phase) {
3149+ if (!_head->as_Loop ()->is_valid_counted_loop ()) {
31503150 return false ; // Only for counted loop
3151-
3151+ }
31523152 CountedLoopNode *cl = _head->as_CountedLoop ();
31533153 if (!cl->has_exact_trip_count () || cl->trip_count () != 1 ) {
31543154 return false ;
@@ -3181,13 +3181,13 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_
31813181 compute_trip_count (phase);
31823182
31833183 // Convert one iteration loop into normal code.
3184- if (policy_do_one_iteration_loop (phase))
3184+ if (do_one_iteration_loop (phase)) {
31853185 return true ;
3186-
3186+ }
31873187 // Check and remove empty loops (spam micro-benchmarks)
3188- if (policy_do_remove_empty_loop (phase))
3188+ if (do_remove_empty_loop (phase)) {
31893189 return true ; // Here we removed an empty loop
3190-
3190+ }
31913191 bool should_peel = policy_peeling (phase); // Should we peel?
31923192
31933193 bool should_unswitch = policy_unswitching (phase);
0 commit comments