提交 015f654c 编写于 作者: T thartmann

8134739: compiler/loopopts/superword/TestVectorizationWithInvariant crashes in loop opts

Summary: Bail out of superword optimization if loop was removed (i.e., if zero-trip Opaque1Node was removed).
Reviewed-by: kvn, roland

--HG--
extra : rebase_source : c0aaf50465968cd558ac8f12e9f4577cbc2774c2
上级 7545e896
......@@ -279,6 +279,7 @@ public:
if (iv_phi == NULL) {
return NULL;
}
assert(iv_phi->is_Phi(), "should be PhiNode");
Node *ln = iv_phi->in(0);
if (ln->is_CountedLoop() && ln->as_CountedLoop()->loopexit() == this) {
return (CountedLoopNode*)ln;
......
......@@ -2208,15 +2208,25 @@ void SuperWord::align_initial_loop_index(MemNode* align_to_ref) {
//----------------------------get_pre_loop_end---------------------------
// Find pre loop end from main loop. Returns null if none.
CountedLoopEndNode* SuperWord::get_pre_loop_end(CountedLoopNode *cl) {
Node *ctrl = cl->in(LoopNode::EntryControl);
CountedLoopEndNode* SuperWord::get_pre_loop_end(CountedLoopNode* cl) {
Node* ctrl = cl->in(LoopNode::EntryControl);
if (!ctrl->is_IfTrue() && !ctrl->is_IfFalse()) return NULL;
Node *iffm = ctrl->in(0);
Node* iffm = ctrl->in(0);
if (!iffm->is_If()) return NULL;
Node *p_f = iffm->in(0);
Node* bolzm = iffm->in(1);
if (!bolzm->is_Bool()) return NULL;
Node* cmpzm = bolzm->in(1);
if (!cmpzm->is_Cmp()) return NULL;
Node* opqzm = cmpzm->in(2);
// Can not optimize a loop if zero-trip Opaque1 node is optimized
// away and then another round of loop opts attempted.
if (opqzm->Opcode() != Op_Opaque1) {
return NULL;
}
Node* p_f = iffm->in(0);
if (!p_f->is_IfFalse()) return NULL;
if (!p_f->in(0)->is_CountedLoopEnd()) return NULL;
CountedLoopEndNode *pre_end = p_f->in(0)->as_CountedLoopEnd();
CountedLoopEndNode* pre_end = p_f->in(0)->as_CountedLoopEnd();
CountedLoopNode* loop_node = pre_end->loopnode();
if (loop_node == NULL || !loop_node->is_pre_loop()) return NULL;
return pre_end;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册