src/hotspot/share/opto/loopopts.cpp
changeset 55307 ed12027517c0
parent 55150 ba171f871932
child 57632 9c523692db7e
equal deleted inserted replaced
55306:ea43db53de91 55307:ed12027517c0
  1193 
  1193 
  1194 //------------------------------split_if_with_blocks_post----------------------
  1194 //------------------------------split_if_with_blocks_post----------------------
  1195 // Do the real work in a non-recursive function.  CFG hackery wants to be
  1195 // Do the real work in a non-recursive function.  CFG hackery wants to be
  1196 // in the post-order, so it can dirty the I-DOM info and not use the dirtied
  1196 // in the post-order, so it can dirty the I-DOM info and not use the dirtied
  1197 // info.
  1197 // info.
  1198 void PhaseIdealLoop::split_if_with_blocks_post(Node *n, bool last_round) {
  1198 void PhaseIdealLoop::split_if_with_blocks_post(Node *n) {
  1199 
  1199 
  1200   // Cloning Cmp through Phi's involves the split-if transform.
  1200   // Cloning Cmp through Phi's involves the split-if transform.
  1201   // FastLock is not used by an If
  1201   // FastLock is not used by an If
  1202   if (n->is_Cmp() && !n->is_FastLock() && !last_round) {
  1202   if (n->is_Cmp() && !n->is_FastLock()) {
  1203     Node *n_ctrl = get_ctrl(n);
  1203     Node *n_ctrl = get_ctrl(n);
  1204     // Determine if the Node has inputs from some local Phi.
  1204     // Determine if the Node has inputs from some local Phi.
  1205     // Returns the block to clone thru.
  1205     // Returns the block to clone thru.
  1206     Node *n_blk = has_local_phi_input(n);
  1206     Node *n_blk = has_local_phi_input(n);
  1207     if (n_blk != n_ctrl) {
  1207     if (n_blk != n_ctrl) {
  1449   if( n_op == Op_Opaque2 &&
  1449   if( n_op == Op_Opaque2 &&
  1450       n->in(1) != NULL &&
  1450       n->in(1) != NULL &&
  1451       get_loop(get_ctrl(n)) == get_loop(get_ctrl(n->in(1))) ) {
  1451       get_loop(get_ctrl(n)) == get_loop(get_ctrl(n->in(1))) ) {
  1452     _igvn.replace_node( n, n->in(1) );
  1452     _igvn.replace_node( n, n->in(1) );
  1453   }
  1453   }
  1454 
       
  1455 #if INCLUDE_ZGC
       
  1456   if (UseZGC) {
       
  1457     ZBarrierSetC2::loop_optimize_gc_barrier(this, n, last_round);
       
  1458   }
       
  1459 #endif
       
  1460 }
  1454 }
  1461 
  1455 
  1462 //------------------------------split_if_with_blocks---------------------------
  1456 //------------------------------split_if_with_blocks---------------------------
  1463 // Check for aggressive application of 'split-if' optimization,
  1457 // Check for aggressive application of 'split-if' optimization,
  1464 // using basic block level info.
  1458 // using basic block level info.
  1465 void PhaseIdealLoop::split_if_with_blocks(VectorSet &visited, Node_Stack &nstack, bool last_round) {
  1459 void PhaseIdealLoop::split_if_with_blocks(VectorSet &visited, Node_Stack &nstack) {
  1466   Node* root = C->root();
  1460   Node* root = C->root();
  1467   visited.set(root->_idx); // first, mark root as visited
  1461   visited.set(root->_idx); // first, mark root as visited
  1468   // Do pre-visit work for root
  1462   // Do pre-visit work for root
  1469   Node* n   = split_if_with_blocks_pre(root);
  1463   Node* n   = split_if_with_blocks_pre(root);
  1470   uint  cnt = n->outcnt();
  1464   uint  cnt = n->outcnt();
  1486     }
  1480     }
  1487     else {
  1481     else {
  1488       // All of n's children have been processed, complete post-processing.
  1482       // All of n's children have been processed, complete post-processing.
  1489       if (cnt != 0 && !n->is_Con()) {
  1483       if (cnt != 0 && !n->is_Con()) {
  1490         assert(has_node(n), "no dead nodes");
  1484         assert(has_node(n), "no dead nodes");
  1491         split_if_with_blocks_post(n, last_round);
  1485         split_if_with_blocks_post(n);
  1492       }
  1486       }
  1493       if (must_throttle_split_if()) {
  1487       if (must_throttle_split_if()) {
  1494         nstack.clear();
  1488         nstack.clear();
  1495       }
  1489       }
  1496       if (nstack.is_empty()) {
  1490       if (nstack.is_empty()) {