RFR(S): 8137049: Code quality: reducing an trivial integer loop does not produce an optimal code

Roland Westrelin roland.westrelin at oracle.com
Wed Feb 3 11:21:13 UTC 2016


In this loop:

for (int i = 0; i < ops; ++i) {

the loop is guarded by:

if (0 < ops) {

which is canonicalized by BoolNode::Ideal() ("Move constants to the right of compare's to canonicalize”) and the code in IdealLoopTree::policy_do_remove_empty_loop() doesn’t recognize the guard shape and peels one iteration of the loop.


More information about the hotspot-compiler-dev mailing list