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

Vladimir Ivanov vlivanov at openjdk.org
Sat May 10 03:18:03 UTC 2025


On Fri, 9 May 2025 16:06:13 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

> My goal is to start with control-less nodes, but find the late control during loop optimization, control-pin them at this point (because that's when the information is available) with both control input and output (needed for the expansion in CallLeaf), and continuing with control-pinned nodes.

If you combine lowering with pinning, you could replace a data node with a CFG node (CallLeaf in your case) at the point in CFG you choose. A single CFG node is enough to insert  a CFG-only node, but you need to ensure the graph stays schedulable after the insertion.

If you want to start with pinned node, the simplest way would be to make `CallPure` a subclass of `CallLeaf`, require it to be CFG-only (no memory in/out, no IO, etc) and populate only control in/out when inserting it into the graph during parsing.

> For now, I'm happy with the control I get from parsing.

Keep in mind that it assumes the node is pinned in CFG from the very beginning. Once the node starts in data-only mode, the control input it gained during parsing may end up too early for node's inputs to be scheduleable.

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

PR Comment: https://git.openjdk.org/jdk/pull/24966#issuecomment-2868277578


More information about the graal-dev mailing list