< prev index next >

src/hotspot/share/opto/loopPredicate.cpp

Print this page

        

*** 513,524 **** Invariance(Arena* area, IdealLoopTree* lpt) : _lpt(lpt), _phase(lpt->_phase), _visited(area), _invariant(area), _stack(area, 10 /* guess */), _clone_visited(area), _old_new(area) { ! Node* head = _lpt->_head; ! Node* entry = head->in(LoopNode::EntryControl); if (entry->outcnt() != 1) { // If a node is pinned between the predicates and the loop // entry, we won't be able to move any node in the loop that // depends on it above it in a predicate. Mark all those nodes // as non loop invariatnt. --- 513,524 ---- Invariance(Arena* area, IdealLoopTree* lpt) : _lpt(lpt), _phase(lpt->_phase), _visited(area), _invariant(area), _stack(area, 10 /* guess */), _clone_visited(area), _old_new(area) { ! LoopNode* head = _lpt->_head->as_Loop(); ! Node* entry = head->skip_strip_mined()->in(LoopNode::EntryControl); if (entry->outcnt() != 1) { // If a node is pinned between the predicates and the loop // entry, we won't be able to move any node in the loop that // depends on it above it in a predicate. Mark all those nodes // as non loop invariatnt.
*** 799,808 **** --- 799,812 ---- if (head->unique_ctrl_out()->Opcode() == Op_NeverBranch) { // do nothing for infinite loops return false; } + if (head->Opcode() == Op_Loop && head->is_strip_mined()) { + return false; + } + CountedLoopNode *cl = NULL; if (head->is_valid_counted_loop()) { cl = head->as_CountedLoop(); // do nothing for iteration-splitted loops if (!cl->is_normal_loop()) return false;
*** 810,820 **** BoolTest::mask bt = cl->loopexit()->test_trip(); if (bt != BoolTest::lt && bt != BoolTest::gt) cl = NULL; } ! Node* entry = head->in(LoopNode::EntryControl); ProjNode *predicate_proj = NULL; // Loop limit check predicate should be near the loop. predicate_proj = find_predicate_insertion_point(entry, Deoptimization::Reason_loop_limit_check); if (predicate_proj != NULL) entry = predicate_proj->in(0)->in(0); --- 814,824 ---- BoolTest::mask bt = cl->loopexit()->test_trip(); if (bt != BoolTest::lt && bt != BoolTest::gt) cl = NULL; } ! Node* entry = head->skip_strip_mined()->in(LoopNode::EntryControl); ProjNode *predicate_proj = NULL; // Loop limit check predicate should be near the loop. predicate_proj = find_predicate_insertion_point(entry, Deoptimization::Reason_loop_limit_check); if (predicate_proj != NULL) entry = predicate_proj->in(0)->in(0);
*** 1005,1014 **** --- 1009,1020 ---- tty->print("Loop Predication Performed:"); loop->dump_head(); } #endif + head->verify_strip_mined(1); + return hoisted; } //------------------------------loop_predication-------------------------------- // driver routine for loop predication optimization
< prev index next >