< prev index next >

src/hotspot/share/opto/loopnode.cpp

Print this page




2692       C->clear_major_progress();
2693       C->record_method_not_compilable("empty program detected during loop optimization");
2694     }
2695     return;
2696   }
2697 
2698   // Nothing to do, so get out
2699   bool stop_early = !C->has_loops() && !skip_loop_opts && !do_split_ifs && !_verify_me && !_verify_only;
2700   bool do_expensive_nodes = C->should_optimize_expensive_nodes(_igvn);
2701   if (stop_early && !do_expensive_nodes) {
2702     _igvn.optimize();           // Cleanup NeverBranches
2703     return;
2704   }
2705 
2706   // Set loop nesting depth
2707   _ltree_root->set_nest( 0 );
2708 
2709   // Split shared headers and insert loop landing pads.
2710   // Do not bother doing this on the Root loop of course.
2711   if( !_verify_me && !_verify_only && _ltree_root->_child ) {





2712     C->print_method(PHASE_BEFORE_BEAUTIFY_LOOPS, 3);
2713     if( _ltree_root->_child->beautify_loops( this ) ) {
2714       // IdealLoopTree::split_outer_loop may produce phi-nodes with a single in edge.
2715       // Transform them away.
2716       _igvn.optimize();



2717 
2718       // Re-build loop tree!
2719       _ltree_root->_child = NULL;
2720       _nodes.clear();
2721       reallocate_preorders();
2722       build_loop_tree();
2723 
2724       // Check for bailout, and return
2725       if (C->failing()) {
2726         return;
2727       }
2728       // Reset loop nesting depth
2729       _ltree_root->set_nest( 0 );
2730 
2731       C->print_method(PHASE_AFTER_BEAUTIFY_LOOPS, 3);
2732     }
2733   }
2734 
2735   // Reset major-progress flag for the driver's heuristics
2736   C->clear_major_progress();




2692       C->clear_major_progress();
2693       C->record_method_not_compilable("empty program detected during loop optimization");
2694     }
2695     return;
2696   }
2697 
2698   // Nothing to do, so get out
2699   bool stop_early = !C->has_loops() && !skip_loop_opts && !do_split_ifs && !_verify_me && !_verify_only;
2700   bool do_expensive_nodes = C->should_optimize_expensive_nodes(_igvn);
2701   if (stop_early && !do_expensive_nodes) {
2702     _igvn.optimize();           // Cleanup NeverBranches
2703     return;
2704   }
2705 
2706   // Set loop nesting depth
2707   _ltree_root->set_nest( 0 );
2708 
2709   // Split shared headers and insert loop landing pads.
2710   // Do not bother doing this on the Root loop of course.
2711   if( !_verify_me && !_verify_only && _ltree_root->_child ) {
2712     bool change = true;
2713     // Fix point iterate beautify_loops until it returns false
2714     // Then no strucutral change has been made.
2715     while (change) {
2716       change = false;
2717       C->print_method(PHASE_BEFORE_BEAUTIFY_LOOPS, 3);
2718       if( _ltree_root->_child->beautify_loops( this ) ) {
2719         // IdealLoopTree::split_outer_loop may reduce phi-nodes to loop invariants,
2720         // and we want to get rid of them
2721         _igvn.optimize();
2722         change = true; // do one more iteration after clean up
2723         orig_worklist_size = _igvn._worklist.size();
2724       }
2725 
2726       // Re-build loop tree!
2727       _ltree_root->_child = NULL;
2728       _nodes.clear();
2729       reallocate_preorders();
2730       build_loop_tree();
2731 
2732       // Check for bailout, and return
2733       if (C->failing()) {
2734         return;
2735       }
2736       // Reset loop nesting depth
2737       _ltree_root->set_nest( 0 );
2738 
2739       C->print_method(PHASE_AFTER_BEAUTIFY_LOOPS, 3);
2740     }
2741   }
2742 
2743   // Reset major-progress flag for the driver's heuristics
2744   C->clear_major_progress();


< prev index next >