RFR: 8367028: compiler/c2/irTests/TestFloat16ScalarOperations.java failing intermittently because of constant folding

Christian Hagedorn chagedorn at openjdk.org
Tue Dec 9 07:51:57 UTC 2025


On Fri, 5 Dec 2025 14:43:57 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> The test uses random constants. But we forgot to exclude special values such as `zero`, otherwise the operations can be folded (idealized) and the IR tests fail. For example `x + 0.42` would not be folded, but `x + 0` would be folded to `x`.
> 
> Solution: restrict the range we sample from. Used to be `[0, 1)`, now I just do `[0.1, 0.9)`.

Looks good, thanks!

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28678#pullrequestreview-3555956837


More information about the hotspot-compiler-dev mailing list