RFR: 8347901: C2 should remove unused leaf / pure runtime calls [v2]
Marc Chevalier
mchevalier at openjdk.org
Mon Jun 23 07:39:32 UTC 2025
On Fri, 20 Jun 2025 15:42:53 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Mostly comments
>
> src/hotspot/share/opto/callnode.cpp line 1342:
>
>> 1340:
>> 1341: Node* CallLeafPureNode::Ideal(PhaseGVN* phase, bool can_reshape) {
>> 1342: if (is_dead()) { // dead node
>
> Suggestion:
>
> if (is_dead()) {
>
> The comment seemed redundant. You could say who else is responsible of cleaning up the dead node though.
>
> What would happen if the `CallLeafPureNode` loses its control projection, but not the other uses? I don't even know if that is possible. What do you think?
IGVN takes care of removing a node without output.
This was motivated by https://bugs.openjdk.org/browse/JDK-8353341 I think @TobiHartmann told me it's common not to touch dead nodes during idealization.
I think it is possible to lose control projection but not data because data was already found dead, but data wasn't yet (but should happen shortly after). As soon as the data projection disappear, the node should be removed. `remove_dead_node` (used in IGVN) is aggressively removing a dead node and all the usages that become recursively dead. It's the classic constraint of having to find that both data and control are top when one is.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25760#discussion_r2160923801
More information about the graal-dev
mailing list