Skip to content

Commit 28dec4f

Browse files
committed
8223139: Rename mandatory policy-do routines.
Rename 'policy_do_remove_empty_loop' to 'do_remove_empty_loop', 'policy_do_one_iteration_loop' to 'do_one_iteration_loop'. Backport-of: ceef0f6
1 parent e1cbfa5 commit 28dec4f

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/hotspot/share/opto/loopTransform.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

src/hotspot/share/opto/loopnode.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,10 @@ class IdealLoopTree : public ResourceObj {
561561
bool policy_unswitching( PhaseIdealLoop *phase ) const;
562562

563563
// Micro-benchmark spamming. Remove empty loops.
564-
bool policy_do_remove_empty_loop( PhaseIdealLoop *phase );
564+
bool do_remove_empty_loop( PhaseIdealLoop *phase );
565565

566566
// Convert one iteration loop into normal code.
567-
bool policy_do_one_iteration_loop( PhaseIdealLoop *phase );
567+
bool do_one_iteration_loop( PhaseIdealLoop *phase );
568568

569569
// Return TRUE or FALSE if the loop should be peeled or not. Peel if we can
570570
// make some loop-invariant test (usually a null-check) happen before the

0 commit comments

Comments
 (0)