RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v3]

Emanuel Peter epeter at openjdk.org
Tue Oct 21 07:21:07 UTC 2025


On Mon, 20 Oct 2025 13:36:13 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> src/hotspot/share/opto/loopnode.hpp line 1176:
>> 
>>> 1174:   // - Update the node inputs of all uses.
>>> 1175:   // - Lazily update the ctrl and idom info of all uses, via a ctrl/idom forwarding.
>>> 1176:   void replace_ctrl_node_and_forward_ctrl_and_idom(Node *old_node, Node *new_node) {
>> 
>> Maybe add here and/or in `install_lazy_ctrl_and_idom_forwarding()` an assert that we have a CFG nodes (i.e. `is_CFG()`) additionally to the `!has_ctrl()` asserts.
>
> Just noticed this: We often (intuitively?) seem to use "control" when talking about just some control nodes and "ctrl" when talking about the nodes found/fetched from `_loop_or_ctrl`. Under this light, we might want to name the method "replace_control_node_and_forward_ctrl_and_idom" to better distinguish them. But I don't have a strong opinion about it - your call 👍

I'm not sure we do that consistently. I think I'll just keep it as is, in a shorter form. The name is already quite long 😅 

Adding the `is_CFG`, good idea!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2446988758


More information about the shenandoah-dev mailing list