RFR: 8364766: C2: Improve Value() of DivI and DivL for non-constant inputs [v10]

Tobias Hotz duke at openjdk.org
Fri Nov 14 21:50:27 UTC 2025


On Fri, 14 Nov 2025 21:42:28 GMT, Tobias Hotz <duke at openjdk.org> wrote:

>> 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.

Thinking about it some more, we can add IR validation to `testLongRange`, though. This one is not dependent on random constants, so it should always work. That way, we should notice the other rule as well

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26143#discussion_r2529052842


More information about the hotspot-compiler-dev mailing list