Skip to content

Commit

Permalink
[Backport] 8274855: vectorapi tests failing with assert(!vbox->is_Phi…
Browse files Browse the repository at this point in the history
…()) failed

Summary: 8274855: vectorapi tests failing with assert(!vbox->is_Phi()) failed

Test Plan: ci jtreg

Reviewed-by: JoshuaZhuwj

Issue: dragonwell-project#571
  • Loading branch information
JinZhonghui committed Dec 7, 2023
1 parent 98b76b9 commit 198794a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/hotspot/share/opto/vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,21 @@ Node* PhaseVector::expand_vbox_node_helper(Node* vbox,
}
new_phi = C->initial_gvn()->transform(new_phi);
return new_phi;
} else if (vbox->is_Phi() && (vect->is_Vector() || vect->is_LoadVector())) {
// Handle the case when the allocation input to VectorBoxNode is a phi
// but the vector input is not, which can definitely be the case if the
// vector input has been value-numbered. It seems to be safe to do by
// construction because VectorBoxNode and VectorBoxAllocate come in a
// specific order as a result of expanding an intrinsic call. After that, if
// any of the inputs to VectorBoxNode are value-numbered they can only
// move up and are guaranteed to dominate.
Node* new_phi = new PhiNode(vbox->as_Phi()->region(), box_type);
for (uint i = 1; i < vbox->req(); i++) {
Node* new_box = expand_vbox_node_helper(vbox->in(i), vect, box_type, vect_type);
new_phi->set_req(i, new_box);
}
new_phi = C->initial_gvn()->transform(new_phi);
return new_phi;
} else if (vbox->is_Proj() && vbox->in(0)->Opcode() == Op_VectorBoxAllocate) {
VectorBoxAllocateNode* vbox_alloc = static_cast<VectorBoxAllocateNode*>(vbox->in(0));
return expand_vbox_alloc_node(vbox_alloc, vect, box_type, vect_type);
Expand Down

0 comments on commit 198794a

Please sign in to comment.