提交 2d2d011b 编写于 作者: R rasbold

6684385: Loop unswitching crashes without LoopNode

Summary: Without LoopNode, exit early from loop unswitching and partial peeling
Reviewed-by: kvn, never, sgoldman
上级 cbec2694
...@@ -51,6 +51,9 @@ bool IdealLoopTree::policy_unswitching( PhaseIdealLoop *phase ) const { ...@@ -51,6 +51,9 @@ bool IdealLoopTree::policy_unswitching( PhaseIdealLoop *phase ) const {
if( !LoopUnswitching ) { if( !LoopUnswitching ) {
return false; return false;
} }
if (!_head->is_Loop()) {
return false;
}
uint nodes_left = MaxNodeLimit - phase->C->unique(); uint nodes_left = MaxNodeLimit - phase->C->unique();
if (2 * _body.size() > nodes_left) { if (2 * _body.size() > nodes_left) {
return false; // Too speculative if running low on nodes. return false; // Too speculative if running low on nodes.
......
...@@ -2257,6 +2257,9 @@ bool PhaseIdealLoop::is_valid_clone_loop_form( IdealLoopTree *loop, Node_List& p ...@@ -2257,6 +2257,9 @@ bool PhaseIdealLoop::is_valid_clone_loop_form( IdealLoopTree *loop, Node_List& p
// //
bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) { bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) {
if (!loop->_head->is_Loop()) {
return false; }
LoopNode *head = loop->_head->as_Loop(); LoopNode *head = loop->_head->as_Loop();
if (head->is_partial_peel_loop() || head->partial_peel_has_failed()) { if (head->is_partial_peel_loop() || head->partial_peel_has_failed()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册