RFR: 8343148: C2: Refactor uses of "PhaseValue::*con*() + PhaseIdealLoop::set_ctrl()" into separate method [v4]

Christian Hagedorn chagedorn at openjdk.org
Mon Nov 11 11:56:17 UTC 2024


On Mon, 11 Nov 2024 08:28:02 GMT, theoweidmannoracle <duke at openjdk.org> wrote:

>> src/hotspot/share/opto/loopopts.cpp line 195:
>> 
>>> 193:       set_root_as_ctrl(x);
>>> 194:       continue;
>>> 195:     }
>> 
>> This looks like "band-aid" - this should be assert. May be investigate in separate RFE.
>
> I opened an RFE for this https://bugs.openjdk.org/browse/JDK-8343907

If you modify the following code above to use your new `makecon()` (could be done either way), could this then be turned into an assert? By looking at the code, it suggests that we only miss to set ctrl in the `singleton` case which would then be covered.
https://github.com/openjdk/jdk/blob/5ca6698ba418e82ff93471fbb495759850f26f63/src/hotspot/share/opto/loopopts.cpp#L123-L125
You could also only change `makecon()` above and revisit this code later again to remove the `set_root_as_ctrl()` and add an assert.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21836#discussion_r1836547506


More information about the hotspot-compiler-dev mailing list