# HG changeset patch # User phedlin # Date 1555505701 -7200 # Node ID d6f55ea4e32515aa75bcadbc2532f1f2bd0f3c96 # Parent 1a5305f51bfdce105a9c3e632de467603e3b3435 8223139: Rename mandatory policy-do routines. Summary: Rename 'policy_do_remove_empty_loop' to 'do_remove_empty_loop', 'policy_do_one_iteration_loop' to 'do_one_iteration_loop'. Reviewed-by: vlivanov, dl diff -r 1a5305f51bfd -r d6f55ea4e325 src/hotspot/share/opto/loopTransform.cpp --- a/src/hotspot/share/opto/loopTransform.cpp Thu May 02 11:05:47 2019 +0200 +++ b/src/hotspot/share/opto/loopTransform.cpp Wed Apr 17 14:55:01 2019 +0200 @@ -2952,11 +2952,11 @@ 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; @@ -3066,12 +3066,12 @@ 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; @@ -3104,13 +3104,13 @@ 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); diff -r 1a5305f51bfd -r d6f55ea4e325 src/hotspot/share/opto/loopnode.hpp --- a/src/hotspot/share/opto/loopnode.hpp Thu May 02 11:05:47 2019 +0200 +++ b/src/hotspot/share/opto/loopnode.hpp Wed Apr 17 14:55:01 2019 +0200 @@ -558,10 +558,10 @@ 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