1.1 --- a/src/share/vm/opto/loopTransform.cpp Tue Sep 30 15:53:55 2008 -0700 1.2 +++ b/src/share/vm/opto/loopTransform.cpp Thu Oct 02 08:37:44 2008 -0700 1.3 @@ -679,6 +679,10 @@ 1.4 CountedLoopNode *post_head = old_new[main_head->_idx]->as_CountedLoop(); 1.5 post_head->set_post_loop(main_head); 1.6 1.7 + // Reduce the post-loop trip count. 1.8 + CountedLoopEndNode* post_end = old_new[main_end ->_idx]->as_CountedLoopEnd(); 1.9 + post_end->_prob = PROB_FAIR; 1.10 + 1.11 // Build the main-loop normal exit. 1.12 IfFalseNode *new_main_exit = new (C, 1) IfFalseNode(main_end); 1.13 _igvn.register_new_node_with_optimizer( new_main_exit ); 1.14 @@ -748,6 +752,9 @@ 1.15 pre_head->set_pre_loop(main_head); 1.16 Node *pre_incr = old_new[incr->_idx]; 1.17 1.18 + // Reduce the pre-loop trip count. 1.19 + pre_end->_prob = PROB_FAIR; 1.20 + 1.21 // Find the pre-loop normal exit. 1.22 Node* pre_exit = pre_end->proj_out(false); 1.23 assert( pre_exit->Opcode() == Op_IfFalse, "" ); 1.24 @@ -767,8 +774,8 @@ 1.25 register_new_node( min_cmp , new_pre_exit ); 1.26 register_new_node( min_bol , new_pre_exit ); 1.27 1.28 - // Build the IfNode 1.29 - IfNode *min_iff = new (C, 2) IfNode( new_pre_exit, min_bol, PROB_FAIR, COUNT_UNKNOWN ); 1.30 + // Build the IfNode (assume the main-loop is executed always). 1.31 + IfNode *min_iff = new (C, 2) IfNode( new_pre_exit, min_bol, PROB_ALWAYS, COUNT_UNKNOWN ); 1.32 _igvn.register_new_node_with_optimizer( min_iff ); 1.33 set_idom(min_iff, new_pre_exit, dd_main_head); 1.34 set_loop(min_iff, loop->_parent);