RFR: 8325651: C2 SuperWord: refactor the dependency graph [v2]

Emanuel Peter epeter at openjdk.org
Fri Mar 8 06:47:07 UTC 2024


On Thu, 7 Mar 2024 16:14:38 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> src/hotspot/share/opto/vectorization.cpp line 225:
>> 
>>> 223:   DependencyNode* dn = new (_arena) DependencyNode(n, memory_pred_edges, _arena);
>>> 224:   _dependency_nodes.at_put_grow(_body.bb_idx(n), dn, nullptr);
>>> 225: }
>> 
>> The call to `add_node()` suggests that we add a node no matter what. I therefore suggest to either change `add_node` to something like `maybe_add_node` or do the check like that:
>> 
>> if (memory_pred_edges.is_nonempty()) {
>>   add_node(n1, memory_pred_edges);
>> }
>
> For completeness, should we also add a comment here or/and at `DependencyNode` that such a node is only created when there is no direct connection in the C2 memory graph since we would visit direct connections in `PredsIterator` anyways?

Wrote this now:

      if (memory_pred_edges.is_nonempty()) {
        // Data edges are taken implicitly from the C2 graph, thus we only add
        // a dependency node if we have memory edges.
        add_node(n1, memory_pred_edges);
      }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17812#discussion_r1517226544


More information about the hotspot-compiler-dev mailing list