1403 _worklist.remove(dead); 1404 C->remove_modified_node(dead); 1405 // Constant node that has no out-edges and has only one in-edge from 1406 // root is usually dead. However, sometimes reshaping walk makes 1407 // it reachable by adding use edges. So, we will NOT count Con nodes 1408 // as dead to be conservative about the dead node count at any 1409 // given time. 1410 if (!dead->is_Con()) { 1411 C->record_dead_node(dead->_idx); 1412 } 1413 if (dead->is_macro()) { 1414 C->remove_macro_node(dead); 1415 } 1416 if (dead->is_expensive()) { 1417 C->remove_expensive_node(dead); 1418 } 1419 CastIINode* cast = dead->isa_CastII(); 1420 if (cast != NULL && cast->has_range_check()) { 1421 C->remove_range_check_cast(cast); 1422 } 1423 } 1424 } // while (_stack.is_nonempty()) 1425 } 1426 1427 //------------------------------subsume_node----------------------------------- 1428 // Remove users from node 'old' and add them to node 'nn'. 1429 void PhaseIterGVN::subsume_node( Node *old, Node *nn ) { 1430 assert( old != hash_find(old), "should already been removed" ); 1431 assert( old != C->top(), "cannot subsume top node"); 1432 // Copy debug or profile information to the new version: 1433 C->copy_node_notes_to(nn, old); 1434 // Move users of node 'old' to node 'nn' 1435 for (DUIterator_Last imin, i = old->last_outs(imin); i >= imin; ) { 1436 Node* use = old->last_out(i); // for each use... 1437 // use might need re-hashing (but it won't if it's a new node) 1438 rehash_node_delayed(use); 1439 // Update use-def info as well 1440 // We remove all occurrences of old within use->in, 1441 // so as to avoid rehashing any node more than once. 1442 // The hash table probe swamps any outer loop overhead. | 1403 _worklist.remove(dead); 1404 C->remove_modified_node(dead); 1405 // Constant node that has no out-edges and has only one in-edge from 1406 // root is usually dead. However, sometimes reshaping walk makes 1407 // it reachable by adding use edges. So, we will NOT count Con nodes 1408 // as dead to be conservative about the dead node count at any 1409 // given time. 1410 if (!dead->is_Con()) { 1411 C->record_dead_node(dead->_idx); 1412 } 1413 if (dead->is_macro()) { 1414 C->remove_macro_node(dead); 1415 } 1416 if (dead->is_expensive()) { 1417 C->remove_expensive_node(dead); 1418 } 1419 CastIINode* cast = dead->isa_CastII(); 1420 if (cast != NULL && cast->has_range_check()) { 1421 C->remove_range_check_cast(cast); 1422 } 1423 if (dead->is_ValueTypePtr()) { 1424 C->remove_value_type_ptr(dead->as_ValueTypePtr()); 1425 } 1426 } 1427 } // while (_stack.is_nonempty()) 1428 } 1429 1430 //------------------------------subsume_node----------------------------------- 1431 // Remove users from node 'old' and add them to node 'nn'. 1432 void PhaseIterGVN::subsume_node( Node *old, Node *nn ) { 1433 assert( old != hash_find(old), "should already been removed" ); 1434 assert( old != C->top(), "cannot subsume top node"); 1435 // Copy debug or profile information to the new version: 1436 C->copy_node_notes_to(nn, old); 1437 // Move users of node 'old' to node 'nn' 1438 for (DUIterator_Last imin, i = old->last_outs(imin); i >= imin; ) { 1439 Node* use = old->last_out(i); // for each use... 1440 // use might need re-hashing (but it won't if it's a new node) 1441 rehash_node_delayed(use); 1442 // Update use-def info as well 1443 // We remove all occurrences of old within use->in, 1444 // so as to avoid rehashing any node more than once. 1445 // The hash table probe swamps any outer loop overhead. |