Skip to content
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

8290529: C2: assert(BoolTest(btest).is_canonical()) failure #9553

Closed
wants to merge 8 commits into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Jul 19, 2022

For the test case:

  1. In Parse::do_if(), tst0 is:

(Bool#lt (CmpU 0 Parm0))

  1. transformed by gvn in tst:

(Bool#gt (CmpU Parm0 0))

  1. That test is not canonical and is negated and retransformed which
    results in:

(Bool#eq (CmpI Parm0 0))

The assert fires because that test is not canonical either.

The root cause I think is that the (CmpU .. 0) -> (CmpI .. 0) only
triggers if the condition of the CmpU is canonical (and results in a
non canonical test). Tweaking it so it applies even if the condition
is not leads to the following change in the steps above:

  1. (Bool#ne (CmpI Parm0 0))

which is a canonical test.


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-8290529: C2: assert(BoolTest(btest).is_canonical()) failure

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9553

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 19, 2022

👋 Welcome back roland! 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 Jul 19, 2022
@openjdk
Copy link

openjdk bot commented Jul 19, 2022

@rwestrel 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 Jul 19, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 19, 2022

Webrevs

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.

Changes are good. If possible add IR framework test.

@@ -1621,12 +1621,12 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// Change x u< 1 or x u<= 0 to x == 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Update comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about updating this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. Sorry I forgot about that one. I updated the comment.

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 17, 2022

@rwestrel This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@rwestrel
Copy link
Contributor Author

Changes are good. If possible add IR framework test.

Thanks for looking a this. Are you asking that the test that I added to catch this specific problem be turned into and IR framework test or are you asking for a separate test to verify the transformation in general?

@vnkozlov
Copy link
Contributor

Changes are good. If possible add IR framework test.

Thanks for looking a this. Are you asking that the test that I added to catch this specific problem be turned into and IR framework test or are you asking for a separate test to verify the transformation in general?

Separate IR test to verify the transformation in general.

@openjdk openjdk bot removed the rfr Pull request is ready for review label Aug 30, 2022
@rwestrel
Copy link
Contributor Author

Changes are good. If possible add IR framework test.

Thanks for looking a this. Are you asking that the test that I added to catch this specific problem be turned into and IR framework test or are you asking for a separate test to verify the transformation in general?

Separate IR test to verify the transformation in general.

I added one.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 30, 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.

Good.

@openjdk
Copy link

openjdk bot commented Sep 1, 2022

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

8290529: C2: assert(BoolTest(btest).is_canonical()) failure

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

  • bc5ffc8: 8293100: RISC-V: Need to save and restore callee-saved FloatRegisters in StubGenerator::generate_call_stub
  • 98ce45f: 8292981: Unify and restructure integer printing format specifiers
  • 3ac91b0: 8293003: Review running time of Warn5 regression test
  • e0168a0: 8288012: AArch64: unnecessary macro expansion in stubGenerator_aarch64
  • 99c3ab0: 8293010: JDI ObjectReference/referringObjects/referringObjects001 fails: assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE)) failed: checking
  • 0fb9469: 8290126: Add a check in JavadocTester for "javadoc should not crash"
  • 0a4d0ce: 8293121: (fs) Refactor UnixFileSystem copying into generic Unix, Linux, and BSD implementations
  • 032be16: 8292066: Convert TestInputArgument.sh and TestSystemLoadAvg.sh to java version
  • e393973: 8292990: Improve test coverage for XPath Axes: parent
  • fa68371: 8292584: assert(cb != __null) failed: must be with -XX:-Inline
  • ... and 136 more: https://git.openjdk.org/jdk/compare/79597f1ea6844f374beeeba219719cd9d5fe7d03...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 Sep 1, 2022
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.

So the root cause is JDK-8276162, correct?

@rwestrel
Copy link
Contributor Author

rwestrel commented Sep 2, 2022

So the root cause is JDK-8276162, correct?

It's the one that is causing it to show up now but JDK-8209544 is the one that introduced the bug.

@rwestrel
Copy link
Contributor Author

rwestrel commented Sep 2, 2022

@vnkozlov @TobiHartmann thanks for the reviews

@rwestrel
Copy link
Contributor Author

rwestrel commented Sep 2, 2022

For the record: Test CmpUWithZero.java requires the compareUnsigned intrinsic which in turn requires the CmpU3 only implemented on x86_64 so I made that test x86_64 only.

@TobiHartmann
Copy link
Member

Thanks for the clarifications.

@rwestrel
Copy link
Contributor Author

rwestrel commented Sep 2, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Sep 2, 2022

Going to push as commit 77e21c5.
Since your change was applied there have been 151 commits pushed to the master branch:

  • fcc0cf9: 8292375: Convert ProtectionDomainCacheTable to ResourceHashtable
  • 6fc58b8: 8293207: Add assert to JVM_ReferenceRefersTo to clarify its API
  • ce06a3b: 8293023: Change CardTable::is_in_young signature
  • 26cac08: 8293209: Parallel: Remove unused variables in PSParallelCompact::invoke
  • 46523b8: 8293219: Microsoft toolchain selection picks 32-bit tools over 64-bit
  • bc5ffc8: 8293100: RISC-V: Need to save and restore callee-saved FloatRegisters in StubGenerator::generate_call_stub
  • 98ce45f: 8292981: Unify and restructure integer printing format specifiers
  • 3ac91b0: 8293003: Review running time of Warn5 regression test
  • e0168a0: 8288012: AArch64: unnecessary macro expansion in stubGenerator_aarch64
  • 99c3ab0: 8293010: JDI ObjectReference/referringObjects/referringObjects001 fails: assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE)) failed: checking
  • ... and 141 more: https://git.openjdk.org/jdk/compare/79597f1ea6844f374beeeba219719cd9d5fe7d03...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 2, 2022

@rwestrel Pushed as commit 77e21c5.

💡 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
3 participants