RFR: 8359603: Missed optimization in PhaseIterGVN for redundant ConvX2Y->ConvY2X->ConvX2Y sequences due to missing notification in PhaseIterGVN::add_users_of_use_to_worklist [v4]
Benoît Maillard
bmaillard at openjdk.org
Mon Jul 28 12:35:17 UTC 2025
On Mon, 28 Jul 2025 12:23:27 GMT, Benoît Maillard <bmaillard at openjdk.org> wrote:
>> src/hotspot/share/opto/phaseX.cpp line 2565:
>>
>>> 2563: // ConvF2I->ConvI2F->ConvF2I
>>> 2564: // ConvF2L->ConvL2F->ConvF2L
>>> 2565: // ConvI2F->ConvF2I->ConvI2F
>>
>> Another thought: Since this is an incomplete list of variations (especially missing, for example, the I2D version while the I2F version is here), should we leave a comment about not being able to trigger issues with the other versions? Otherwise, it could suggest that it was just forgotten.
>
> The notification issue that is solved here only happens with optimizations that have this chain pattern with three nodes (checking the input of the input) and this is specific to conversions that have a loss of precision. ConvI2D is not here because the `ConvI2D->ConvD2I` gets optimized to a NOP already (`ConvD2INode::Identity`). But there are also chains for which there is a known optimization and for which I was not able to trigger a missed optimization, so it would make sense to have mention this in any case.
I have added a short note, let me know what you think!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26368#discussion_r2236219134
More information about the hotspot-compiler-dev
mailing list