RFR: 8260650: test failed with "assert(false) failed: infinite loop in PhaseIterGVN::optimize" [v2]

Vladimir Kozlov kvn at openjdk.java.net
Tue Mar 16 18:10:09 UTC 2021


On Tue, 16 Mar 2021 16:19:23 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

>> src/hotspot/share/opto/phaseX.cpp line 850:
>> 
>>> 848:     k = i;
>>> 849: #ifdef ASSERT
>>> 850:     if (loop_count >= K * C->live_nodes()) {
>> 
>> This should be `K + C->live_nodes()` instead of `*`.
>> The code in `optimize()` uses `*` because it goes over all nodes. But here you iterate only one node.
>
> It's not very obvious to me. I think the limits should actually be the same everywhere because in the edge case, when all the nodes are connected and you start with the right one, all the same optimizations can happen within the loop in `transform_old`. Imagine a graph that is a huge foldable one-side-leaning expression tree. Its processing can either fully happen in the loop in `transform_old` if you start from the top, or it can happen in `optimize` when you start from the bottom and do the worklist-based processing one by one. Depends whether you can go forward in the graph or need to backtrack, but the amount of computation is kind of the same. Or am I wrong?

Yes, for such particular graph number of computation will be about the same. But not in general case.
`N * 1000` is overkill in `transform_old()` - it will not help with catching bad cases if you have to wait so long.
And the limit in `optimize()` should not be the same - in worse cases it does `* N` computations done in `transform_old()`.

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

PR: https://git.openjdk.java.net/jdk/pull/3022


More information about the hotspot-compiler-dev mailing list