RFR: 8333258: C2: high memory usage in PhaseCFG::insert_anti_dependences()
Emanuel Peter
epeter at openjdk.org
Thu Jun 20 13:22:10 UTC 2024
On Thu, 20 Jun 2024 12:28:18 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> We should use `VectorSet` for something like that.
>> `worklist_visited` is definitely should be `VectorSet`.
>> Instead of `already_enqueued` we should add `VectorSet` for `mem` to check if it was processed before. This assumes that this loop don't modify graph. Unfortunately we have one modification `store->add_prec(load);` which we should do something about. I may miss other ocde which modify graph.
>
> VectorSet would work for worklist_visited but it's not the thing that I'm trying to fix here. @vnkozlov's comment is not only about worklist_visited.
>
> Also if there are few uses, the existing code would only have to go over a few `worklist_visited` elements while using a `VectorSet` would possibly require zeroing a small array. Is it that clear cut that a `VectorSet` is always better?
@rwestrel I'm sure that most of my questions / babbel above is because I don't understand the algorithm yet. Feel free to summarize it. But I think I understand the general idea: we are trying to limit duplicate edge visits. Not sure if in all cases or only in special cases and why?
I think you could add a nice explanatory comment, about what edges we need to traverse, and why and where we limit the duplication.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19791#issuecomment-2180668011
More information about the hotspot-compiler-dev
mailing list