47 //------------------------------policy_unswitching----------------------------- |
47 //------------------------------policy_unswitching----------------------------- |
48 // Return TRUE or FALSE if the loop should be unswitched |
48 // Return TRUE or FALSE if the loop should be unswitched |
49 // (ie. clone loop with an invariant test that does not exit the loop) |
49 // (ie. clone loop with an invariant test that does not exit the loop) |
50 bool IdealLoopTree::policy_unswitching( PhaseIdealLoop *phase ) const { |
50 bool IdealLoopTree::policy_unswitching( PhaseIdealLoop *phase ) const { |
51 if( !LoopUnswitching ) { |
51 if( !LoopUnswitching ) { |
|
52 return false; |
|
53 } |
|
54 if (!_head->is_Loop()) { |
52 return false; |
55 return false; |
53 } |
56 } |
54 uint nodes_left = MaxNodeLimit - phase->C->unique(); |
57 uint nodes_left = MaxNodeLimit - phase->C->unique(); |
55 if (2 * _body.size() > nodes_left) { |
58 if (2 * _body.size() > nodes_left) { |
56 return false; // Too speculative if running low on nodes. |
59 return false; // Too speculative if running low on nodes. |