RFR: 8263227: C2: inconsistent spilling due to dead nodes in exception block

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Thu Apr 8 13:53:15 UTC 2021


On Thu, 8 Apr 2021 10:46:10 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> src/hotspot/share/opto/lcm.cpp line 1415:
>> 
>>> 1413:       if (dead) {
>>> 1414:         // Remove projections if n is a dead multi-node.
>>> 1415:         for (uint k = j + n->outcnt(); sb->get_node(k)->is_Proj(); k--) {
>> 
>> I don't get this logic. The loop is not executed if sb->get_node(j + n->outcnt()) is not Proj node.
>
> Thanks for reviewing, Vladimir! The intention of this loop is to remove all projections of a multi-node `n` before removing `n` itself (if it has been found to be dead). I indeed have to rethink this code as e.g. the loop can be executed if `n` is not a multi-node but `k` ends up pointing to a projection of another node. I will investigate and come back with a new revision.

On second thought, at the loop entry, the only users of `n` are (unused) projections or else `n` wouldn't be dead. Assuming these projections are scheduled right after `n`, the code should be OK. In any case, I will submit a (hopefully) clearer revision.

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

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


More information about the hotspot-compiler-dev mailing list