RFR: 8369646: Detection of redundant conversion patterns in add_users_of_use_to_worklist is too restrictive [v4]
Emanuel Peter
epeter at openjdk.org
Tue Nov 4 08:56:47 UTC 2025
On Tue, 4 Nov 2025 08:41:24 GMT, Benoît Maillard <bmaillard at openjdk.org> wrote:
>> src/hotspot/share/opto/phaseX.cpp line 2568:
>>
>>> 2566: // ConvI2F->ConvF2I->ConvI2F
>>> 2567: // Note: there may be other 3-nodes conversion chains that would require to be added here, but these
>>> 2568: // are the only ones that are known to trigger missed optimizations otherwise
>>
>> You may want to update the description, and give a bit of extra information. Because you are saying `n` does not have to be a conversion, but it may be that `n` is about to be replaced with a conversion, right?
>
> Yes, in some cases `add_users_of_use_to_worklist` is called with the node about to be replaced as argument `n`. The point is that we might replace `n` with a node that already has other uses, and we only want to notify the uses for which there is a potential change.
> But this is in no way specific to this one optimization, so I think adding something here would cause more confusion than anything else. Perhaps we should update the description of `add_users_of_use_to_worklist` then?
Right, this is not specific to this optimization here. Why not add something at the level of `add_users_of_use_to_worklist`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27900#discussion_r2489325144
More information about the hotspot-compiler-dev
mailing list