Skip to content
Permalink
Browse files
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
  • Loading branch information
GoeLin committed Oct 4, 2021
1 parent e1cbfa5 commit 28dec4f39f75a6dcb5835a2d58440871bd38bddf
Showing 2 changed files with 15 additions and 15 deletions.
@@ -3022,11 +3022,11 @@ void IdealLoopTree::remove_main_post_loops(CountedLoopNode *cl, PhaseIdealLoop *
phase->_igvn.replace_input_of(main_cmp, 2, main_cmp->in(2)->in(1));
}

//------------------------------policy_do_remove_empty_loop--------------------
// Micro-benchmark spamming. Policy is to always remove empty loops.
// The 'DO' part is to replace the trip counter with the value it will
// have on the last iteration. This will break the loop.
bool IdealLoopTree::policy_do_remove_empty_loop( PhaseIdealLoop *phase ) {
//------------------------------do_remove_empty_loop---------------------------
// We always attempt remove empty loops. The approach is to replace the trip
// counter with the value it will have on the last iteration. This will break
// the loop.
bool IdealLoopTree::do_remove_empty_loop(PhaseIdealLoop *phase) {
// Minimum size must be empty loop
if (_body.size() > EMPTY_LOOP_SIZE)
return false;
@@ -3143,12 +3143,12 @@ bool IdealLoopTree::policy_do_remove_empty_loop( PhaseIdealLoop *phase ) {
return true;
}

//------------------------------policy_do_one_iteration_loop-------------------
//------------------------------do_one_iteration_loop--------------------------
// Convert one iteration loop into normal code.
bool IdealLoopTree::policy_do_one_iteration_loop( PhaseIdealLoop *phase ) {
if (!_head->as_Loop()->is_valid_counted_loop())
bool IdealLoopTree::do_one_iteration_loop(PhaseIdealLoop *phase) {
if (!_head->as_Loop()->is_valid_counted_loop()) {
return false; // Only for counted loop

}
CountedLoopNode *cl = _head->as_CountedLoop();
if (!cl->has_exact_trip_count() || cl->trip_count() != 1) {
return false;
@@ -3181,13 +3181,13 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_
compute_trip_count(phase);

// Convert one iteration loop into normal code.
if (policy_do_one_iteration_loop(phase))
if (do_one_iteration_loop(phase)) {
return true;

}
// Check and remove empty loops (spam micro-benchmarks)
if (policy_do_remove_empty_loop(phase))
if (do_remove_empty_loop(phase)) {
return true; // Here we removed an empty loop

}
bool should_peel = policy_peeling(phase); // Should we peel?

bool should_unswitch = policy_unswitching(phase);
@@ -561,10 +561,10 @@ class IdealLoopTree : public ResourceObj {
bool policy_unswitching( PhaseIdealLoop *phase ) const;

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

// Convert one iteration loop into normal code.
bool policy_do_one_iteration_loop( PhaseIdealLoop *phase );
bool do_one_iteration_loop( PhaseIdealLoop *phase );

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

1 comment on commit 28dec4f

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 28dec4f Oct 4, 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.