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

Christian Hagedorn chagedorn at openjdk.org
Mon Oct 20 14:25:24 UTC 2025


On Mon, 20 Oct 2025 13:38:49 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
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Apply suggestions from code review
>   
>   Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>

Update looks good, thanks!

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27889#pullrequestreview-3356682142


More information about the hotspot-compiler-dev mailing list