RFR: 8260473: [vector] ZGC: VectorReshape test produces incorrect results with ZGC enabled [v4]

王超 github.com+25214855+casparcwang at openjdk.java.net
Fri Jan 29 06:51:43 UTC 2021


On Fri, 29 Jan 2021 04:02:34 GMT, 王超 <github.com+25214855+casparcwang at openjdk.org> wrote:

> > ArrayCopyNode::load performs the same work as it does here in PhaseVector::optimize_vector_boxes .
> > Is there a need to provide a similar function in PhaseVector or GraphKit?
> 
> My point is since PhaseVector effectively enters the parsing phase (by signaling about the possibility of post-parse inlining), technically I don't see why `GraphKit::access_load_at` won't work. But I need to spend more time looking into the details.
> 
> So far, I took a look at the review thread of 8212243 (which introduced `ArrayCopyNode::load`) and found the following discussion between Roland and Erik:
> https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2018-October/030971.html
> 
> ```
> > ... Also it beats  me that this is strictly speaking a load barrier for loads performed in 
> > arraycopy. Would it be possible to use something like access_load_at  instead? ...
> ...
> GraphKit is a parse time only thing. So the existing gc interface
> doesn't offer any way to add barriers once parsing is over. This code
> runs after parsing in optimization phases.
> ...
> ```
> 
> Considering `PhaseVector::optimize_vector_boxes()` already has access to a usable `GraphKit` instance, it is possible that `GraphKit::access_load_at` will "just work".

As far as I can see, during the parse phase, GraphKit contains the jvm state info which can be used to get the control and memory for creating new nodes. But during optimization, the jvm state info may be missing like the situation in `PhaseVector::optimize_vector_boxes` or Macro Expansion. So it should use C2OptAccess to create the Load Node directly by providing control and memory nodes.

I think a similar api like `GraphKit::access_load_at ` should be provided for usage during optimization stages,  but where should the API be placed? GraphKit or PhaseIterGVN or somewhere else?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2253


More information about the hotspot-compiler-dev mailing list