Skip to content

8309268: C2: "assert(in_bb(n)) failed: must be" after JDK-8306302#14268

Closed
eme64 wants to merge 2 commits intoopenjdk:masterfrom
eme64:JDK-8309268
Closed

8309268: C2: "assert(in_bb(n)) failed: must be" after JDK-8306302#14268
eme64 wants to merge 2 commits intoopenjdk:masterfrom
eme64:JDK-8309268

Conversation

@eme64
Copy link
Contributor

@eme64 eme64 commented Jun 1, 2023

This is the fix to a regression caused in the CMoveV fix JDK-8306302.

I had implicitly assumed that all Cmp in the loop also have their in(1) inside the loop (in_bb). This is not always true, and hence we hit the assert.

Solution

However, we know that at least one of the two inputs of a Cmp must also be in the loop, else the Cmp would float outside the loop. So if in(1) is not in the loop then we can just pick in(2) for the velt_type.

Testing
I added 2 regression tests that were provided in the bug, and also extended TestVectorConditionalMove.java (though it is currently problemlisted because of an IR framework bug). This extension also triggered the assert, and now properly vectorizes.

I tested up to tier6 and stress testing. I ran the tests both with TestVectorConditionalMove problemlisted and without the problemlisting.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8309268: C2: "assert(in_bb(n)) failed: must be" after JDK-8306302

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14268/head:pull/14268
$ git checkout pull/14268

Update a local copy of the PR:
$ git checkout pull/14268
$ git pull https://git.openjdk.org/jdk.git pull/14268/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14268

View PR using the GUI difftool:
$ git pr show -t 14268

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14268.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 1, 2023

👋 Welcome back epeter! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 1, 2023

@eme64 The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jun 1, 2023
@eme64 eme64 marked this pull request as ready for review June 2, 2023 06:57
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 2, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 2, 2023

Webrevs

Copy link
Contributor

@robcasloz robcasloz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I just have a few minor suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you turn this comment into an assertion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Use some constaints in the comparison
// Use some constants in the comparison

for (int i = 0; i < SIZE; i++) {
Asserts.assertEquals(rD[i], cmoveDGTforD(aD[i], bD[i], cD[i], dD[i]));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove one of the empty lines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an Oracle copyright entry to the header of this file, see e.g.

* Copyright (c) 2022, Red Hat, Inc. All rights reserved.
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.

@openjdk
Copy link

openjdk bot commented Jun 2, 2023

@eme64 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:

8309268: C2: "assert(in_bb(n)) failed: must be" after JDK-8306302

Reviewed-by: rcastanedalo, kvn, thartmann

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 63 new commits pushed to the master branch:

  • b6c9232: 8305225: A service broken error despite annotation processor generating it if directives listed
  • 05fb6c6: 8309336: Incorrect switch in enum not reported properly
  • 08c91c2: 8309332: RISC-V: Improve PrintOptoAssembly output of vector nodes
  • ecb1753: 8309334: ProcessTools.main() does not properly set thread names when using the virtual thread wrapper
  • ac1597b: 8309409: Update HttpInputStreamTest and BodyProcessorInputStreamTest to use hg.openjdk.org
  • fdb5893: 8309391: Remove non-failing tests from test/jdk/ProblemList-Virtual.txt
  • 6edd786: 8309265: Serial: Remove the code related to GC overheap limit
  • 61bb014: 8309254: Implement fast-path for ASCII-compatible CharsetEncoders on RISC-V
  • 62c935d: 8308978: regression with a deadlock involving FollowReferences
  • aff9cea: 8303530: Redefine JAXP Configuration File
  • ... and 53 more: https://git.openjdk.org/jdk/compare/4aea7dab152de4c61724eec9a40024c990f8dabc...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 2, 2023
Copy link
Contributor

@robcasloz robcasloz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my suggestions, looks good!

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update is good.

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too.

@eme64
Copy link
Contributor Author

eme64 commented Jun 5, 2023

Thanks @robcasloz for the review and suggestions!
Thanks @TobiHartmann @vnkozlov for the reviews!
/integrate

@openjdk
Copy link

openjdk bot commented Jun 5, 2023

Going to push as commit 22a9a86.
Since your change was applied there have been 63 commits pushed to the master branch:

  • b6c9232: 8305225: A service broken error despite annotation processor generating it if directives listed
  • 05fb6c6: 8309336: Incorrect switch in enum not reported properly
  • 08c91c2: 8309332: RISC-V: Improve PrintOptoAssembly output of vector nodes
  • ecb1753: 8309334: ProcessTools.main() does not properly set thread names when using the virtual thread wrapper
  • ac1597b: 8309409: Update HttpInputStreamTest and BodyProcessorInputStreamTest to use hg.openjdk.org
  • fdb5893: 8309391: Remove non-failing tests from test/jdk/ProblemList-Virtual.txt
  • 6edd786: 8309265: Serial: Remove the code related to GC overheap limit
  • 61bb014: 8309254: Implement fast-path for ASCII-compatible CharsetEncoders on RISC-V
  • 62c935d: 8308978: regression with a deadlock involving FollowReferences
  • aff9cea: 8303530: Redefine JAXP Configuration File
  • ... and 53 more: https://git.openjdk.org/jdk/compare/4aea7dab152de4c61724eec9a40024c990f8dabc...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 5, 2023
@openjdk openjdk bot closed this Jun 5, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 5, 2023
@openjdk
Copy link

openjdk bot commented Jun 5, 2023

@eme64 Pushed as commit 22a9a86.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants

Comments