src/hotspot/share/opto/loopnode.cpp
changeset 52711 f480ad035c73
parent 52608 61241fc2217a
child 52925 9c18c9d839d3
equal deleted inserted replaced
52710:70adb0f573a7 52711:f480ad035c73
  2772       C->record_method_not_compilable("empty program detected during loop optimization");
  2772       C->record_method_not_compilable("empty program detected during loop optimization");
  2773     }
  2773     }
  2774     return;
  2774     return;
  2775   }
  2775   }
  2776 
  2776 
       
  2777   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
  2777   // Nothing to do, so get out
  2778   // Nothing to do, so get out
  2778   bool stop_early = !C->has_loops() && !skip_loop_opts && !do_split_ifs && !_verify_me && !_verify_only;
  2779   bool stop_early = !C->has_loops() && !skip_loop_opts && !do_split_ifs && !_verify_me && !_verify_only &&
       
  2780     !bs->is_gc_specific_loop_opts_pass(mode);
  2779   bool do_expensive_nodes = C->should_optimize_expensive_nodes(_igvn);
  2781   bool do_expensive_nodes = C->should_optimize_expensive_nodes(_igvn);
       
  2782   bool strip_mined_loops_expanded = bs->strip_mined_loops_expanded(mode);
  2780   if (stop_early && !do_expensive_nodes) {
  2783   if (stop_early && !do_expensive_nodes) {
  2781     _igvn.optimize();           // Cleanup NeverBranches
  2784     _igvn.optimize();           // Cleanup NeverBranches
  2782     return;
  2785     return;
  2783   }
  2786   }
  2784 
  2787 
  2852   visited.set( C->top()->_idx ); // Set C->top() as visited now
  2855   visited.set( C->top()->_idx ); // Set C->top() as visited now
  2853   build_loop_early( visited, worklist, nstack );
  2856   build_loop_early( visited, worklist, nstack );
  2854 
  2857 
  2855   // Given early legal placement, try finding counted loops.  This placement
  2858   // Given early legal placement, try finding counted loops.  This placement
  2856   // is good enough to discover most loop invariants.
  2859   // is good enough to discover most loop invariants.
  2857   if( !_verify_me && !_verify_only )
  2860   if (!_verify_me && !_verify_only && !strip_mined_loops_expanded) {
  2858     _ltree_root->counted_loop( this );
  2861     _ltree_root->counted_loop( this );
       
  2862   }
  2859 
  2863 
  2860   // Find latest loop placement.  Find ideal loop placement.
  2864   // Find latest loop placement.  Find ideal loop placement.
  2861   visited.Clear();
  2865   visited.Clear();
  2862   init_dom_lca_tags();
  2866   init_dom_lca_tags();
  2863   // Need C->root() on worklist when processing outs
  2867   // Need C->root() on worklist when processing outs
  2918     }
  2922     }
  2919 
  2923 
  2920     // Cleanup any modified bits
  2924     // Cleanup any modified bits
  2921     _igvn.optimize();
  2925     _igvn.optimize();
  2922 
  2926 
       
  2927     if (C->log() != NULL) {
       
  2928       log_loop_tree(_ltree_root, _ltree_root, C->log());
       
  2929     }
       
  2930     return;
       
  2931   }
       
  2932 
       
  2933   if (bs->optimize_loops(this, mode, visited, nstack, worklist)) {
       
  2934     _igvn.optimize();
  2923     if (C->log() != NULL) {
  2935     if (C->log() != NULL) {
  2924       log_loop_tree(_ltree_root, _ltree_root, C->log());
  2936       log_loop_tree(_ltree_root, _ltree_root, C->log());
  2925     }
  2937     }
  2926     return;
  2938     return;
  2927   }
  2939   }
  4134       }
  4146       }
  4135     }
  4147     }
  4136   }
  4148   }
  4137 }
  4149 }
  4138 
  4150 
  4139 // Verify that no data node is schedules in the outer loop of a strip
  4151 // Verify that no data node is scheduled in the outer loop of a strip
  4140 // mined loop.
  4152 // mined loop.
  4141 void PhaseIdealLoop::verify_strip_mined_scheduling(Node *n, Node* least) {
  4153 void PhaseIdealLoop::verify_strip_mined_scheduling(Node *n, Node* least) {
  4142 #ifdef ASSERT
  4154 #ifdef ASSERT
  4143   if (get_loop(least)->_nest == 0) {
  4155   if (get_loop(least)->_nest == 0) {
  4144     return;
  4156     return;
  4145   }
  4157   }
  4146   IdealLoopTree* loop = get_loop(least);
  4158   IdealLoopTree* loop = get_loop(least);
  4147   Node* head = loop->_head;
  4159   Node* head = loop->_head;
  4148   if (head->is_OuterStripMinedLoop()) {
  4160   if (head->is_OuterStripMinedLoop() &&
       
  4161       // Verification can't be applied to fully built strip mined loops
       
  4162       head->as_Loop()->outer_loop_end()->in(1)->find_int_con(-1) == 0) {
  4149     Node* sfpt = head->as_Loop()->outer_safepoint();
  4163     Node* sfpt = head->as_Loop()->outer_safepoint();
  4150     ResourceMark rm;
  4164     ResourceMark rm;
  4151     Unique_Node_List wq;
  4165     Unique_Node_List wq;
  4152     wq.push(sfpt);
  4166     wq.push(sfpt);
  4153     for (uint i = 0; i < wq.size(); i++) {
  4167     for (uint i = 0; i < wq.size(); i++) {