Integrated: 8369898: C2 SuperWord: assert(has_ctrl(i)) failed: should be control, not loop

Emanuel Peter epeter at openjdk.org
Tue Oct 21 05:46:16 UTC 2025


On Mon, 20 Oct 2025 07:11:34 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> In `PhaseIdealLoop::create_new_if_for_multiversion`, we replace `multiversion_slow_proj` with the new `region` that merges the `new_multiversion_slow_proj` and `new_if_false`. Using `igvn.replace_node` moves all the control inputs of the outputs of the old `multiversion_slow_proj` to the new `region`. This is sufficient during IGVN, but not during loop-opts: the "controllees" of `multiversion_slow_proj` (the nodes that used to answer to `get_ctrl` with `multiversion_slow_proj`) should now be "controllees" of `region` (answer `region` for `get_ctrl`).
> 
> This is what `lazy_replace` is for:
> - It puts a "forwarding" in the `_loop_and_ctrl` table: instead of mapping `multiversion_slow_proj` to its loop, it now points to the new ctrl node `region`.
> - When we call `get_ctrl` on a "controllee" of the old `multiversion_slow_proj`, we then skip over `multiversion_slow_proj` via the "forwarding" to the new `region`.
> 
> I'm proposing a PR to improve the documentation and some renamings around `get_ctrl` and `lazy_replace`:
> https://github.com/openjdk/jdk/pull/27892
> 
> A previous PR that used `lazy_replace`, in case you want to understand more:
> https://github.com/openjdk/jdk/pull/15720

This pull request has now been integrated.

Changeset: 634746a0
Author:    Emanuel Peter <epeter at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/634746a0f167da50c2aef010756f607a436696e9
Stats:     98 lines in 2 files changed: 97 ins; 0 del; 1 mod

8369898: C2 SuperWord: assert(has_ctrl(i)) failed: should be control, not loop

Reviewed-by: chagedorn, kvn

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

PR: https://git.openjdk.org/jdk/pull/27889


More information about the hotspot-compiler-dev mailing list