-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8329531: compiler/c2/irTests/TestIfMinMax.java fails with IRViolationException: There were one or multiple IR rule failures. #18734
Conversation
👋 Welcome back jkarthikeyan! A progress list of the required criteria for merging this PR into |
@jaskarth This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 268 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@eme64, @dafedafe) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, thanks for the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this @jaskarth.
Quick question: I noticed that by setting b[i] = 1;
now a few tests always set 1 on the right-hand-side of the max/min operations. Could it possibly limit their scope?
Thanks for the review @eme64, and thanks for taking a look @dafedafe! I think the scope of the tests shouldn't be limited by this change. The vectorization IR test is the only test that takes the 1s as the right hand argument, and I think functionally the it should behave the same as the true/false ratio will still be roughly equal before and after. Before we were comparing |
Thanks again for the reviews :) /integrate |
/sponsor |
Going to push as commit 438e643.
Your commit was automatically rebased without conflicts. |
@TobiHartmann @jaskarth Pushed as commit 438e643. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
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 byRandom#nextInt
wasint_min
then the branch will be only taken once, which works out to1/512 => ~0.002
. This value is smaller than the CMove threshold0.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!
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18734/head:pull/18734
$ git checkout pull/18734
Update a local copy of the PR:
$ git checkout pull/18734
$ git pull https://git.openjdk.org/jdk.git pull/18734/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18734
View PR using the GUI difftool:
$ git pr show -t 18734
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18734.diff
Webrev
Link to Webrev Comment