< prev index next >

src/hotspot/share/opto/loopPredicate.cpp

Print this page




1371         }
1372       }
1373       Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(call->uncommon_trap_request());
1374       if (reason == Deoptimization::Reason_predicate) {
1375         break;
1376       }
1377 
1378       if (predicate_proj != NULL) {
1379         hoisted = loop_predication_impl_helper(loop, proj, predicate_proj, cl, zero, invar, Deoptimization::Reason_predicate) | hoisted;
1380       }
1381     } // end while
1382   }
1383 
1384   if (follow_branches) {
1385     PathFrequency pf(loop->_head, this);
1386 
1387     // Some projections were skipped by regular predicates because of
1388     // an early loop exit. Try them with profile data.
1389     while (if_proj_list.size() > 0) {
1390       Node* proj = if_proj_list.pop();
1391       float f = pf.to(proj);
1392       if (proj->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none) &&
1393           f * loop_trip_cnt >= 1) {
1394         hoisted = loop_predication_impl_helper(loop, proj->as_Proj(), profile_predicate_proj, cl, zero, invar, Deoptimization::Reason_profile_predicate) | hoisted;
1395       }
1396     }
1397 
1398     // And look into all branches
1399     Node_Stack stack(0);
1400     VectorSet seen(Thread::current()->resource_area());
1401     Node_List if_proj_list_freq(area);
1402     while (regions.size() > 0) {
1403       Node* c = regions.pop();
1404       loop_predication_follow_branches(c, loop, loop_trip_cnt, pf, stack, seen, if_proj_list_freq);
1405     }
1406 
1407     for (uint i = 0; i < if_proj_list_freq.size(); i++) {
1408       ProjNode* proj = if_proj_list_freq.at(i)->as_Proj();
1409       hoisted = loop_predication_impl_helper(loop, proj, profile_predicate_proj, cl, zero, invar, Deoptimization::Reason_profile_predicate) | hoisted;
1410     }
1411   }
1412 
1413 #ifndef PRODUCT




1371         }
1372       }
1373       Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(call->uncommon_trap_request());
1374       if (reason == Deoptimization::Reason_predicate) {
1375         break;
1376       }
1377 
1378       if (predicate_proj != NULL) {
1379         hoisted = loop_predication_impl_helper(loop, proj, predicate_proj, cl, zero, invar, Deoptimization::Reason_predicate) | hoisted;
1380       }
1381     } // end while
1382   }
1383 
1384   if (follow_branches) {
1385     PathFrequency pf(loop->_head, this);
1386 
1387     // Some projections were skipped by regular predicates because of
1388     // an early loop exit. Try them with profile data.
1389     while (if_proj_list.size() > 0) {
1390       Node* proj = if_proj_list.pop();

1391       if (proj->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none) &&
1392           pf.to(proj) * loop_trip_cnt >= 1) {
1393         hoisted = loop_predication_impl_helper(loop, proj->as_Proj(), profile_predicate_proj, cl, zero, invar, Deoptimization::Reason_profile_predicate) | hoisted;
1394       }
1395     }
1396 
1397     // And look into all branches
1398     Node_Stack stack(0);
1399     VectorSet seen(Thread::current()->resource_area());
1400     Node_List if_proj_list_freq(area);
1401     while (regions.size() > 0) {
1402       Node* c = regions.pop();
1403       loop_predication_follow_branches(c, loop, loop_trip_cnt, pf, stack, seen, if_proj_list_freq);
1404     }
1405 
1406     for (uint i = 0; i < if_proj_list_freq.size(); i++) {
1407       ProjNode* proj = if_proj_list_freq.at(i)->as_Proj();
1408       hoisted = loop_predication_impl_helper(loop, proj, profile_predicate_proj, cl, zero, invar, Deoptimization::Reason_profile_predicate) | hoisted;
1409     }
1410   }
1411 
1412 #ifndef PRODUCT


< prev index next >