RFR: 8369898: C2 SuperWord: assert(has_ctrl(i)) failed: should be control, not loop [v2]
    Emanuel Peter 
    epeter at openjdk.org
       
    Mon Oct 20 13:38:49 UTC 2025
    
    
  
> 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>
-------------
Changes:
  - all: https://git.openjdk.org/jdk/pull/27889/files
  - new: https://git.openjdk.org/jdk/pull/27889/files/74eb443a..6e23865a
Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27889&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27889&range=00-01
  Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/27889.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27889/head:pull/27889
PR: https://git.openjdk.org/jdk/pull/27889
    
    
More information about the hotspot-compiler-dev
mailing list