RFR: 8354477: C2 SuperWord: make use of memory edges more explicit

Emanuel Peter epeter at openjdk.org
Thu Apr 17 09:03:55 UTC 2025


On Sun, 13 Apr 2025 13:40:13 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> This is a small refactoring, to make it more explicit that the "additional dependencies" are memory dependencies.
> 
> This is also preparatory work for [JDK-8324751](https://bugs.openjdk.org/browse/JDK-8324751), where we have two memory edge categories: strong and weak.
> 
> I was able to pass around `vtn_dependencies` in fewer occasions, and also renamed it to `vtn_memory_dependencies`.

src/hotspot/share/opto/superwordVTransformBuilder.cpp line 102:

> 100:     for (uint k = 0; k < pack->size(); k++) {
> 101:       add_dependencies_of_node_to_vtnode(pack->at(k), vtn, vtn_dependencies);
> 102:     }

Now only applies for load / store.

src/hotspot/share/opto/superwordVTransformBuilder.cpp line 129:

> 127:     }
> 128: 
> 129:     add_dependencies_of_node_to_vtnode(n, vtn, vtn_dependencies);

Now only applies for load / store.

src/hotspot/share/opto/superwordVTransformBuilder.cpp line 181:

> 179:   VTransformNode* req = get_vtnode_or_wrap_as_input_scalar(n->in(index));
> 180:   vtn->set_req(index, req);
> 181:   vtn_dependencies.set(req->_idx);

Not useful any more. We used to track all dependencies this way, but we really only need to track the memory dependencies.

src/hotspot/share/opto/superwordVTransformBuilder.cpp line 308:

> 306: 
> 307:     // Only add memory dependencies to memory nodes. All others are taken care of with the req.
> 308:     if (n->is_Mem() && !pred->is_Mem()) { continue; }

Was exclusion for non-memory edges.

src/hotspot/share/opto/superwordVTransformBuilder.cpp line 313:

> 311: 
> 312:     // Reduction self-cycle?
> 313:     if (vtn == dependency && _vloop_analyzer.reductions().is_marked_reduction(n)) { continue; }

Was exclusion for non-memory edges.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24613#discussion_r2041131560
PR Review Comment: https://git.openjdk.org/jdk/pull/24613#discussion_r2041131610
PR Review Comment: https://git.openjdk.org/jdk/pull/24613#discussion_r2041131746
PR Review Comment: https://git.openjdk.org/jdk/pull/24613#discussion_r2041131820
PR Review Comment: https://git.openjdk.org/jdk/pull/24613#discussion_r2041131857


More information about the hotspot-compiler-dev mailing list