Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/loopUnswitch.cpp @ 108:a761c2d3b76a
6684385: Loop unswitching crashes without LoopNode
Summary: Without LoopNode, exit early from loop unswitching and partial peeling
Reviewed-by: kvn, never, sgoldman
author | rasbold |
---|---|
date | Wed, 09 Apr 2008 09:25:45 -0700 |
parents | a61af66fc99e |
children | d1605aabd0a1 8d191a7697e2 |
comparison
equal
deleted
inserted
replaced
107:93b6525e3b82 | 108:a761c2d3b76a |
---|---|
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. |