RFR: 8343148: C2: Refactor uses of "PhaseValue::*con*() + PhaseIdealLoop::set_ctrl()" into separate method [v4]
theoweidmannoracle
duke at openjdk.org
Mon Nov 11 07:43:16 UTC 2024
On Fri, 8 Nov 2024 17:39:32 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> theoweidmannoracle has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add set_root_as_ctrl
>
> src/hotspot/share/opto/loopnode.cpp line 3147:
>
>> 3145: ConINode* zero = igvn->intcon(0);
>> 3146: if (iloop != nullptr) {
>> 3147: iloop->set_root_as_ctrl(zero);
>
> Please look on history of this code. This is suspicious - constant nodes should be always attached to Root.
@TobiHartmann Pointed out that this method is also called from code outside of loop opts, for example, `PhaseMacroExpand::expand_macro_nodes`. Since there's no PhaseIdealLoop in this case, nullptr is passed instead and we cannot set control as we are not inside a loop opt.
Maybe @rwestrel can also take a look as he originally introduced this code in [this PR](https://github.com/openjdk/jdk/pull/7364/files#diff-d49652d43244d52415873c37bf6990269b0d6e2f2111f4f971660470b6bca738R2860).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21836#discussion_r1836075707
More information about the hotspot-compiler-dev
mailing list