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

Marc Chevalier mchevalier at openjdk.org
Fri Jun 20 12:03:32 UTC 2025


On Wed, 18 Jun 2025 14:44:26 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/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?

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

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


More information about the graal-dev mailing list