RFR: 8333258: C2: high memory usage in PhaseCFG::insert_anti_dependences()
Roland Westrelin
roland at openjdk.org
Thu Jun 20 13:50:10 UTC 2024
On Thu, 20 Jun 2024 12:45:53 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> First a question: Why does your `already_enqueued` exit early if `worklist_mem.at(j-1) != mem`? Are we sure that there will not be a `mem, store` pair at a lower index `i`?
I ran testing with some verification code that checked that and it never failed. But in any case, that doesn't really matter. The logic I've added tries to prevent a pathological case from happening. There's no correctness issue involved. So if once in a while we re-enqueue a `mem, store`, that doesn't make much of a difference.
> An idea: this really looks like we are storing a `Pair<mem, store>`. Could we not use a set of some kind, maybe a `ResourceHashtable`? That would allow a possibly faster lookup. Ah, or maybe you can combine the `idx` of `mem` and `store` to a unique combined idx, and use that for a `VectorSet`?
Yes, it is a `Pair<mem, store>`. What you're describing seems like we're trying to solve a problem that we don't know exist. Shouldn't we stick to simplest possible implementation unless it's shown to not perform well? I just ran ctw on java.base and looked at the CITime output. I don't see a difference with or without this patch.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19791#issuecomment-2180754800
More information about the hotspot-compiler-dev
mailing list