src/share/vm/opto/loopPredicate.cpp

changeset 3038
4e761e7e6e12
parent 2877
bad7ecd0b6ed
child 3043
c96c3eb1efae
     1.1 --- a/src/share/vm/opto/loopPredicate.cpp	Thu Jul 21 11:25:07 2011 -0700
     1.2 +++ b/src/share/vm/opto/loopPredicate.cpp	Tue Jul 26 19:35:23 2011 -0700
     1.3 @@ -817,6 +817,10 @@
     1.4      cl = head->as_CountedLoop();
     1.5      // do nothing for iteration-splitted loops
     1.6      if (!cl->is_normal_loop()) return false;
     1.7 +    // Avoid RCE if Counted loop's test is '!='.
     1.8 +    BoolTest::mask bt = cl->loopexit()->test_trip();
     1.9 +    if (bt != BoolTest::lt && bt != BoolTest::gt)
    1.10 +      cl = NULL;
    1.11    }
    1.12  
    1.13    Node* entry = head->in(LoopNode::EntryControl);
    1.14 @@ -958,7 +962,7 @@
    1.15        if (TraceLoopPredicate) tty->print_cr("lower bound check if: %d", lower_bound_iff->_idx);
    1.16  
    1.17        // Test the upper bound
    1.18 -      Node* upper_bound_bol = rc_predicate(loop, ctrl, scale, offset, init, limit, stride, rng, true);
    1.19 +      Node* upper_bound_bol = rc_predicate(loop, lower_bound_proj, scale, offset, init, limit, stride, rng, true);
    1.20        IfNode* upper_bound_iff = upper_bound_proj->in(0)->as_If();
    1.21        _igvn.hash_delete(upper_bound_iff);
    1.22        upper_bound_iff->set_req(1, upper_bound_bol);

mercurial