Skip to content

Conversation

@chhagedorn
Copy link
Member

@chhagedorn chhagedorn commented Dec 16, 2022

JDK-8292889 added the following optimization to BoolNode::Ideal() for patterns that include CMoveI nodes:

// Change "bool eq/ne (cmp (cmove (bool tst (cmp2)) 1 0) 0)" into "bool tst/~tst (cmp2)"
if (cop == Op_CmpI &&
(_test._test == BoolTest::eq || _test._test == BoolTest::ne) &&
cmp1_op == Op_CMoveI && cmp2->find_int_con(1) == 0) {
// 0 should be on the true branch
if (cmp1->in(CMoveNode::IfTrue)->find_int_con(1) == 0 &&
cmp1->in(CMoveNode::IfFalse)->find_int_con(0) != 0) {
BoolNode* target = cmp1->in(CMoveNode::Condition)->as_Bool();

However, we could have a CMoveI during IGVN that will later be folded because the Bool condition node was replaced by a constant but IGVN has not processed this node, yet:

Screenshot from 2022-12-16 09-40-28

We fail when trying to call as_Bool() on 28 ConI. The fix is straight forward to additionally check if we actually have a BoolNode.

Thanks,
Christian


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-8298824: C2 crash: assert(is_Bool()) failed: invalid node class: ConI

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11705

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 16, 2022

👋 Welcome back chagedorn! 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 openjdk bot added the rfr Pull request is ready for review label Dec 16, 2022
@openjdk
Copy link

openjdk bot commented Dec 16, 2022

@chhagedorn 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 Dec 16, 2022
@mlbridge
Copy link

mlbridge bot commented Dec 16, 2022

Webrevs

Copy link
Contributor

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

@openjdk
Copy link

openjdk bot commented Dec 16, 2022

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

8298824: C2 crash: assert(is_Bool()) failed: invalid node class: ConI

Reviewed-by: roland, 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 35 new commits pushed to the master branch:

  • ba942c2: 8298244: AArch64: Optimize vector implementation of AddReduction for floating point
  • 7938f8c: 8298639: Perform I/O operations in bulk for RandomAccessFile
  • bfa921a: 8160404: RelocationHolder constructors have bugs
  • bf9a8ce: 8249826: 5 javax/net/ssl/SSLEngine tests use @ignore w/o bug-id
  • 0eeaeb8: 8298808: Check script code on detecting the base locales
  • 81e23ab: 8298809: Clean up vm/compiler/InterfaceCalls JMH
  • 3696711: Merge
  • f771c56: 8298797: Specification of some restricted methods is incorrect
  • 0ba4734: 8287699: jdk/jfr/api/consumer/TestRecordingFileWrite.java fails with exception: java.lang.Exception: Found event that should not be there.
  • c47e64e: 8297979: ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeapMemoryUsage()
  • ... and 25 more: https://git.openjdk.org/jdk/compare/5f63f7a742a1071a87ca69463bae6e04a44fe462...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 Dec 16, 2022
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.

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

@chhagedorn
Copy link
Member Author

Thanks @rwestrel, @vnkozlov and @TobiHartmann for your reviews!

@chhagedorn
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 19, 2022

Going to push as commit 5e678f7.
Since your change was applied there have been 35 commits pushed to the master branch:

  • ba942c2: 8298244: AArch64: Optimize vector implementation of AddReduction for floating point
  • 7938f8c: 8298639: Perform I/O operations in bulk for RandomAccessFile
  • bfa921a: 8160404: RelocationHolder constructors have bugs
  • bf9a8ce: 8249826: 5 javax/net/ssl/SSLEngine tests use @ignore w/o bug-id
  • 0eeaeb8: 8298808: Check script code on detecting the base locales
  • 81e23ab: 8298809: Clean up vm/compiler/InterfaceCalls JMH
  • 3696711: Merge
  • f771c56: 8298797: Specification of some restricted methods is incorrect
  • 0ba4734: 8287699: jdk/jfr/api/consumer/TestRecordingFileWrite.java fails with exception: java.lang.Exception: Found event that should not be there.
  • c47e64e: 8297979: ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeapMemoryUsage()
  • ... and 25 more: https://git.openjdk.org/jdk/compare/5f63f7a742a1071a87ca69463bae6e04a44fe462...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 19, 2022

@chhagedorn Pushed as commit 5e678f7.

💡 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