[lworld+vector] RFR: 8304310: Initial compilers and runtime handling for multifield backed vectors. [v5]
Jatin Bhateja
jbhateja at openjdk.org
Fri Apr 14 07:17:03 UTC 2023
On Tue, 11 Apr 2023 00:39:28 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> src/hotspot/share/opto/vector.cpp line 318:
>>
>>> 316: if (vec_box->outcnt() > 0) {
>>> 317: Node* vbox_alloc = vec_box->get_oop();
>>> 318: assert(vbox_alloc->is_Proj() && vbox_alloc->in(0)->isa_VectorBoxAllocate(), "");
>>
>> Before we have the `PhiNode` as the oop and vect inputs, which are from the transformations like `merge_through_phi`, but now the oop is only the VBA?
>
> I wanted to get away with VectorBoxAllocateNode (a macro node) in a subsequent patch, I kept it currently because it being a SafePoint node carries JVMState for re-initialization of GraphKit during expansion, this helps in accessing control and memory edges needed during new_instance creation for vector_boxes.
>
> Otherwise, InlineTypeNode handle control flow merges inherently.
> https://github.com/openjdk/valhalla/blob/lworld%2Bvector/src/hotspot/share/opto/inlinetypenode.hpp#L91
>
> But since JVMState of merging control flow will be different hence we will need to create a different allocation in each incoming control flow as was done previously.
**Issue around early VectorBoxAllocate expansions: -**

_Q. Why do we need an explicit VectorBoxAllocate IR along with VectorBox?_
_A. This is because we need memory and control edges to stitch the graph pallet created after buffering, VectorBoxAllocate is a Safepoint node carrying JVMstate and other relevant edges thus re-initializing GraphKit corresponding to a given JVM state is seamless._
_Other possible solution could be to associate memory and control edges with VectorBox nodes OR bookkeep entire JVMState into VectorBox for a later use, but this will pose issues at convergence points where VectorBoxes coming from different control flow merge and so does current VBAs and this is augmented by PhaseVector::expand_vbox_node_helper which processes each incoming VectorBoxAllocate separately._
_If we just preserve JVMState for a VectorBox then we need to have a synthetic IR for bookkeeping it since box forwarding across PhiNode result into creation of just one VectorBox at converge point, so keeping VBA looks relevant and clean solution for the time being._
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1166386677
More information about the valhalla-dev
mailing list