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

Marc Chevalier mchevalier at openjdk.org
Mon Jun 23 06:43:31 UTC 2025


On Fri, 20 Jun 2025 19:14:05 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> 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`.

I've run some test without this special handling and I couldn't see nothing more failing. Maybe it was more necessary in Vladimir's original usecase (reachability). In my case, maybe I don't need `adr_type` to handle nicely `TupleNode`s, but let's not set a trap for the future.

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

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


More information about the graal-dev mailing list