RFR: 8364766: C2: Improve Value() of DivI and DivL for non-constant inputs [v10]
Tobias Hotz
duke at openjdk.org
Fri Nov 14 21:45:08 UTC 2025
On Thu, 13 Nov 2025 12:07:38 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> test/hotspot/jtreg/compiler/igvn/IntegerDivValueTests.java line 286:
>>
>>> 284: // transform_long_divide splits up the division into multiple other nodes, such as MulHiLNode, which does not have a good Value() implemantion.
>>> 285: // When JDK-8366815 is fixed, these rules should be reenabled
>>> 286: // Alternatively, a better MulHiLNode::Value() implemantion should also lead to constant folding
>>
>> Could you have some temporary IR rule that now passes, but fails once `JDK-8366815` is fixed? Otherwise, I'm afraid we will miss these comments here, and they will never be cleaned up.
>
> Same elsewhere in this file.
I guess it is not really possible for this method. Depending on the random constants that have been chosen, a different sequence of nodes will be emitted by `transform_long_divide`, and sometimes a `MulHiLNode` will not be emitted and the expression may constant fold after all.
So I fear we just have to remember this, but as https://github.com/openjdk/jdk/pull/27886 looks pretty close to being done as well, I guess this will not be too hard.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26143#discussion_r2529036809
More information about the hotspot-compiler-dev
mailing list