RFR: 8333258: C2: high memory usage in PhaseCFG::insert_anti_dependences() [v2]
Roland Westrelin
roland at openjdk.org
Tue Jun 25 15:23:19 UTC 2024
On Tue, 25 Jun 2024 14:27:44 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Ah, it the comment is still here:
>> https://github.com/openjdk/jdk/pull/19791#issuecomment-2180754800
>
> Thank you, @eme64. The last statement have to be adjusted based on Roland's answer you pointed.
We start by pushing:
(null, initial_mem)
then we pop it and push all uses of `initial_mem` before we pop anything:
(initial_mem, store_1)
(initial_mem, store_2)
(initial_mem, store_3)
...
(initial_mem, store_n-1)
(initial_mem, store_n)
Then we pop a pair:
(initial_mem, store_n)
And we push uses of `store_n` only if it is a `MergeMem`
(initial_mem, store1)
(initial_mem, store2)
(initial_mem, store3)
...
(initial_mem, storen-1)
(store_n, store_n_1)
...
(store_n, store_n_n)
And we keep going.
What you're saying is we can end up with:
(mem1, ...)
(mem2, ...)
(mem1, ...)
For that `mem1` and `mem2` have to be a `MergeMem`. So There has to be a cycle from `mem1` to `mem1` through `mem2` all of which are `MergeMem`. That can't happen right? Or am I missing something?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19791#discussion_r1653032037
More information about the hotspot-compiler-dev
mailing list