src/share/vm/opto/loopPredicate.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7077439 Sdiff src/share/vm/opto

src/share/vm/opto/loopPredicate.cpp

Print this page




 701   return bol;
 702 }
 703 
 704 //------------------------------ loop_predication_impl--------------------------
 705 // Insert loop predicates for null checks and range checks
 706 bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) {
 707   if (!UseLoopPredicate) return false;
 708 
 709   if (!loop->_head->is_Loop()) {
 710     // Could be a simple region when irreducible loops are present.
 711     return false;
 712   }
 713   LoopNode* head = loop->_head->as_Loop();
 714 
 715   if (head->unique_ctrl_out()->Opcode() == Op_NeverBranch) {
 716     // do nothing for infinite loops
 717     return false;
 718   }
 719 
 720   CountedLoopNode *cl = NULL;
 721   if (head->is_CountedLoop()) {
 722     cl = head->as_CountedLoop();
 723     // do nothing for iteration-splitted loops
 724     if (!cl->is_normal_loop()) return false;
 725     // Avoid RCE if Counted loop's test is '!='.
 726     BoolTest::mask bt = cl->loopexit()->test_trip();
 727     if (bt != BoolTest::lt && bt != BoolTest::gt)
 728       cl = NULL;
 729   }
 730 
 731   Node* entry = head->in(LoopNode::EntryControl);
 732   ProjNode *predicate_proj = NULL;
 733   // Loop limit check predicate should be near the loop.
 734   if (LoopLimitCheck) {
 735     predicate_proj = find_predicate_insertion_point(entry, Deoptimization::Reason_loop_limit_check);
 736     if (predicate_proj != NULL)
 737       entry = predicate_proj->in(0)->in(0);
 738   }
 739 
 740   predicate_proj = find_predicate_insertion_point(entry, Deoptimization::Reason_predicate);
 741   if (!predicate_proj) {




 701   return bol;
 702 }
 703 
 704 //------------------------------ loop_predication_impl--------------------------
 705 // Insert loop predicates for null checks and range checks
 706 bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) {
 707   if (!UseLoopPredicate) return false;
 708 
 709   if (!loop->_head->is_Loop()) {
 710     // Could be a simple region when irreducible loops are present.
 711     return false;
 712   }
 713   LoopNode* head = loop->_head->as_Loop();
 714 
 715   if (head->unique_ctrl_out()->Opcode() == Op_NeverBranch) {
 716     // do nothing for infinite loops
 717     return false;
 718   }
 719 
 720   CountedLoopNode *cl = NULL;
 721   if (head->is_valid_counted_loop()) {
 722     cl = head->as_CountedLoop();
 723     // do nothing for iteration-splitted loops
 724     if (!cl->is_normal_loop()) return false;
 725     // Avoid RCE if Counted loop's test is '!='.
 726     BoolTest::mask bt = cl->loopexit()->test_trip();
 727     if (bt != BoolTest::lt && bt != BoolTest::gt)
 728       cl = NULL;
 729   }
 730 
 731   Node* entry = head->in(LoopNode::EntryControl);
 732   ProjNode *predicate_proj = NULL;
 733   // Loop limit check predicate should be near the loop.
 734   if (LoopLimitCheck) {
 735     predicate_proj = find_predicate_insertion_point(entry, Deoptimization::Reason_loop_limit_check);
 736     if (predicate_proj != NULL)
 737       entry = predicate_proj->in(0)->in(0);
 738   }
 739 
 740   predicate_proj = find_predicate_insertion_point(entry, Deoptimization::Reason_predicate);
 741   if (!predicate_proj) {


src/share/vm/opto/loopPredicate.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File