107 // Find first invariant test that doesn't exit the loop |
107 // Find first invariant test that doesn't exit the loop |
108 LoopNode *head = loop->_head->as_Loop(); |
108 LoopNode *head = loop->_head->as_Loop(); |
109 |
109 |
110 IfNode* unswitch_iff = find_unswitching_candidate((const IdealLoopTree *)loop); |
110 IfNode* unswitch_iff = find_unswitching_candidate((const IdealLoopTree *)loop); |
111 assert(unswitch_iff != NULL, "should be at least one"); |
111 assert(unswitch_iff != NULL, "should be at least one"); |
|
112 |
|
113 #ifndef PRODUCT |
|
114 if (TraceLoopOpts) { |
|
115 tty->print("Unswitch %d ", head->unswitch_count()+1); |
|
116 loop->dump_head(); |
|
117 } |
|
118 #endif |
112 |
119 |
113 // Need to revert back to normal loop |
120 // Need to revert back to normal loop |
114 if (head->is_CountedLoop() && !head->as_CountedLoop()->is_normal_loop()) { |
121 if (head->is_CountedLoop() && !head->as_CountedLoop()->is_normal_loop()) { |
115 head->as_CountedLoop()->set_normal_loop(); |
122 head->as_CountedLoop()->set_normal_loop(); |
116 } |
123 } |