RFR: 8275326: C2: assert(no_dead_loop) failed: dead loop detected [v3]

Christian Hagedorn chagedorn at openjdk.java.net
Mon Nov 29 11:23:42 UTC 2021


On Sun, 28 Nov 2021 23:27:24 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Christian Hagedorn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>> 
>>  - New fix
>>  - Merge branch 'master' into JDK-8275326
>>  - handle GVN
>>  - C2: assert(no_dead_loop) failed: dead loop detected
>
> src/hotspot/share/opto/cfgnode.cpp line 2315:
> 
>> 2313:         }
>> 2314: 
>> 2315:         if (igvn) {
> 
> This whole split through `mergemem` part of code is guarded by `can_reshape` check at line #2196 which is `true` only during IGVN (`PhaseIterGVN`). So you don't need to worry about executing this in parser.
> But checking `igvn` value is fine here since you use it as we do at line #2278.

Good point. I guess I could clean this up and the other `if (igvn)` checks after L2196

> src/hotspot/share/opto/cfgnode.cpp line 2321:
> 
>> 2319:           // visiting it in the transformations below.
>> 2320:           igvn->replace_node(this, result);
>> 2321:           igvn->set_type(result, result->bottom_type());
> 
> Did you consider simply cut off Phi's inputs with `top` by using `replace_input_of()`?

Unfortunately, this does not work. When doing the dead loop check for `11853 Phi` in the `phase->transform(phi)` call below, we find the `this` phi (`989 Phi`) by following the inputs of `11853 Phi` and conclude it's dead loop safe. This means we would need to cut the outputs of `989 Phi`. The only good way I found to achieve that is to directly replace the `this` phi here with the resulting mergemem node. Otherwise, we somehow need to restore the outputs again after the transformations to correctly subsume the `this` phi later.

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

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


More information about the hotspot-compiler-dev mailing list