src/hotspot/share/opto/gcm.cpp
changeset 58962 2dcfc28a314d
parent 57721 4fbcbd248c52
child 58979 1edb08142cea
equal deleted inserted replaced
58961:5d462d4b7a8b 58962:2dcfc28a314d
   848   // The stack should contain exactly the root
   848   // The stack should contain exactly the root
   849   stack.clear();
   849   stack.clear();
   850   stack.push(root, root->outcnt());
   850   stack.push(root, root->outcnt());
   851 
   851 
   852   // Clear the visited bits
   852   // Clear the visited bits
   853   visited.Clear();
   853   visited.clear();
   854 }
   854 }
   855 
   855 
   856 // Iterator for the Node_Backward_Iterator
   856 // Iterator for the Node_Backward_Iterator
   857 Node *Node_Backward_Iterator::next() {
   857 Node *Node_Backward_Iterator::next() {
   858 
   858 
  1370   schedule_pinned_nodes(visited);
  1370   schedule_pinned_nodes(visited);
  1371 
  1371 
  1372   // Find the earliest Block any instruction can be placed in.  Some
  1372   // Find the earliest Block any instruction can be placed in.  Some
  1373   // instructions are pinned into Blocks.  Unpinned instructions can
  1373   // instructions are pinned into Blocks.  Unpinned instructions can
  1374   // appear in last block in which all their inputs occur.
  1374   // appear in last block in which all their inputs occur.
  1375   visited.Clear();
  1375   visited.clear();
  1376   Node_Stack stack(arena, (C->live_nodes() >> 2) + 16); // pre-grow
  1376   Node_Stack stack(arena, (C->live_nodes() >> 2) + 16); // pre-grow
  1377   if (!schedule_early(visited, stack)) {
  1377   if (!schedule_early(visited, stack)) {
  1378     // Bailout without retry
  1378     // Bailout without retry
  1379     C->record_method_not_compilable("early schedule failed");
  1379     C->record_method_not_compilable("early schedule failed");
  1380     return;
  1380     return;
  1390   }
  1390   }
  1391 
  1391 
  1392   // Now schedule all codes as LATE as possible.  This is the LCA in the
  1392   // Now schedule all codes as LATE as possible.  This is the LCA in the
  1393   // dominator tree of all USES of a value.  Pick the block with the least
  1393   // dominator tree of all USES of a value.  Pick the block with the least
  1394   // loop nesting depth that is lowest in the dominator tree.
  1394   // loop nesting depth that is lowest in the dominator tree.
  1395   // ( visited.Clear() called in schedule_late()->Node_Backward_Iterator() )
  1395   // ( visited.clear() called in schedule_late()->Node_Backward_Iterator() )
  1396   schedule_late(visited, stack);
  1396   schedule_late(visited, stack);
  1397   if (C->failing()) {
  1397   if (C->failing()) {
  1398     // schedule_late fails only when graph is incorrect.
  1398     // schedule_late fails only when graph is incorrect.
  1399     assert(!VerifyGraphEdges, "verification should have failed");
  1399     assert(!VerifyGraphEdges, "verification should have failed");
  1400     return;
  1400     return;
  1471 #endif
  1471 #endif
  1472 
  1472 
  1473   // Schedule locally.  Right now a simple topological sort.
  1473   // Schedule locally.  Right now a simple topological sort.
  1474   // Later, do a real latency aware scheduler.
  1474   // Later, do a real latency aware scheduler.
  1475   GrowableArray<int> ready_cnt(C->unique(), C->unique(), -1);
  1475   GrowableArray<int> ready_cnt(C->unique(), C->unique(), -1);
  1476   visited.Clear();
  1476   visited.reset();
  1477   for (uint i = 0; i < number_of_blocks(); i++) {
  1477   for (uint i = 0; i < number_of_blocks(); i++) {
  1478     Block* block = get_block(i);
  1478     Block* block = get_block(i);
  1479     if (!schedule_local(block, ready_cnt, visited, recalc_pressure_nodes)) {
  1479     if (!schedule_local(block, ready_cnt, visited, recalc_pressure_nodes)) {
  1480       if (!C->failure_reason_is(C2Compiler::retry_no_subsuming_loads())) {
  1480       if (!C->failure_reason_is(C2Compiler::retry_no_subsuming_loads())) {
  1481         C->record_method_not_compilable("local schedule failed");
  1481         C->record_method_not_compilable("local schedule failed");