RFR: 8333393: PhaseCFG::insert_anti_dependences can fail to raise LCAs and to add necessary anti-dependence edges [v4]

Christian Hagedorn chagedorn at openjdk.org
Fri Feb 28 10:43:55 UTC 2025


On Fri, 28 Feb 2025 08:52:12 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:

>> src/hotspot/share/opto/cfgnode.cpp line 2435:
>> 
>>> 2433:       ResourceMark rm;
>>> 2434:       VectorSet visited;
>>> 2435:       Node_List worklist;
>> 
>> You could also use a `Unique_Node_List` instead of a `Node_List` + `VectorSet`:
>> 
>> Unique_Node_List worklist;
>> for (uint i = 0; i < worklist.size(); i++) {
>> }
>
> Correct me if I'm wrong, but doesn't this pattern lead to higher memory consumption because we need to keep already visited nodes in the worklist? It probably doesn't matter much in practice, but I find the current approach more hygienic.

That's true that we have more memory consumption. But it's probably neglectable. However, we seem to use both approaches throughout our code base, so I don't have a strong opinion about what which version we use here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23691#discussion_r1975197336


More information about the hotspot-compiler-dev mailing list