RFR: 8347901: C2 should remove unused leaf / pure runtime calls [v2]

Vladimir Ivanov vlivanov at openjdk.org
Fri Jun 20 19:16:29 UTC 2025


On Fri, 20 Jun 2025 12:00:52 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

>> src/hotspot/share/opto/multnode.cpp line 126:
>> 
>>> 124:       // Jumping over Tuples: the i-th projection of a Tuple is the i-th input of the Tuple.
>>> 125:       ctrl = ctrl->in(_con);
>>> 126:     }
>> 
>> Do you need to special-case this here? Why does the `ProjNode::Identity` not suffice? Are there potentially other locations where we now would need this special logic?
>
> That is a good question. That is something I picked from Vladimir's implementation and it seemed legitimate. But now you say it, is it needed? Not sure. I'm trying to find that out. Would `::Identity` be enough? It's tempting to say so, right! I'd say it can be not enough if we need `adr_type` before idealizing the `ProjNode` (no idea if that happens). Is there any other places to adapt? One could think so, but actually, I can't find such an example. Other methods of `ProjNode` for instance rely on the type of the input (which is correctly handled in `TupleNode`), and so should already work fine.
> 
> I'm trying to understand what happens if we don't have that. But maybe @iwanowww would have some helpful insight?

I don't remember all the details now, but there were some problems when `ProjNode::adr_type()` encounters `TupleNode`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25760#discussion_r2159543440


More information about the graal-dev mailing list