Integrated: 8329531: compiler/c2/irTests/TestIfMinMax.java fails with IRViolationException: There were one or multiple IR rule failures.
Jasmine Karthikeyan
jkarthikeyan at openjdk.org
Wed Apr 24 05:25:34 UTC 2024
On Thu, 11 Apr 2024 01:38:28 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:
> This patch fixes an issue with the `TestIfMinMax` IR test where specific random seeds cause the branch probability to be so low that the branch cannot CMove, causing the IR check to fail for min/max reductions. For example, if the first value returned by `Random#nextInt` was `int_min` then the branch will be only taken once, which works out to `1/512 => ~0.002`. This value is smaller than the CMove threshold `0.01`, so it cannot CMove.
> I've added sequential values from 1 to 50 and -1 to -50 before inserting random values in the array, so there will be a guaranteed 50 successes and 50 failures for each run. I've also replaced the multiplication by two with an opaque multiplication by one to prevent the randomly generated numbers from becoming larger, like what the test `MinMaxRed_Int` does.
>
> Thoughts and reviews would be appreciated!
This pull request has now been integrated.
Changeset: 438e6431
Author: Jasmine Karthikeyan <jkarthikeyan at openjdk.org>
Committer: Tobias Hartmann <thartmann at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/438e64310dc186d05de758103df1ea5504dcf33e
Stats: 49 lines in 1 file changed: 29 ins; 0 del; 20 mod
8329531: compiler/c2/irTests/TestIfMinMax.java fails with IRViolationException: There were one or multiple IR rule failures.
Reviewed-by: epeter, dfenacci
-------------
PR: https://git.openjdk.org/jdk/pull/18734
More information about the hotspot-compiler-dev
mailing list