Skip to content

Conversation

@mhaessig
Copy link
Contributor

@mhaessig mhaessig commented Mar 28, 2025

Issue Summary

The add_ring() implementations of OrINode and OrLNode are missing the optimization that an or with a value where all bits are ones (since we have signed integers in this case ~0 == -1) will always yield all zeroes.

Changes

This PR makes the following straight forward changes:

  • Or(I|L)Node::add_ring() returns -1 if one of the two inputs is -1.
  • Add Or(I|L) nodes to the IR framework.
  • Add a regression IR test for the implemented optimization.

Testing


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-8352893: C2: OrL/INode::add_ring optimize (x | -1) to -1 (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24289

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 28, 2025

👋 Welcome back mhaessig! 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 Mar 28, 2025

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

8352893: C2: OrL/INode::add_ring optimize (x | -1) to -1

Reviewed-by: epeter, thartmann, kvn

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

  • 15d36ee: 8353330: Test runtime/cds/appcds/SignedJar.java fails in CDSHeapVerifier
  • e6fe249: 8323100: com/sun/tools/attach/StartManagementAgent.java failed with "WaitForSingleObject failed"
  • 096e70d: 8352437: Support --add-exports with -XX:+AOTClassLinking
  • 6970cf6: 8352775: JVM crashes with -XX:AOTMode=create -XX:+UseZGC
  • afcad8c: 5043343: FileImageInputStream and FileImageOutputStream do not properly track streamPos for RandomAccessFile
  • 6891490: 8353324: Clean up of comments and import after 8319192
  • 07fd666: 8342984: Bump minimum boot jdk to JDK 24
  • 6a46d55: 8353129: CDS ArchiveRelocation tests fail after JDK-8325132
  • 19eabaf: 8353227: JFR: Prepare tests for strong parser validation
  • 564066d: 8353118: Deprecate the use of java.locale.useOldISOCodes system property
  • ... and 67 more: https://git.openjdk.org/jdk/compare/b9907801afaf4c613482ce3cb1b38262ce13df29...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.

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 (@vnkozlov, @eme64, @TobiHartmann) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 28, 2025
@openjdk
Copy link

openjdk bot commented Mar 28, 2025

@mhaessig 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 Mar 28, 2025
@mlbridge
Copy link

mlbridge bot commented Mar 28, 2025

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.

Good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 28, 2025
Copy link
Contributor

@eme64 eme64 left a comment

Choose a reason for hiding this comment

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

@mhaessig It looks good, just two comments below :)

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Mar 31, 2025
Copy link
Contributor

@eme64 eme64 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 the updates, looks good to me now :)

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 1, 2025
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.

@mhaessig
Copy link
Contributor Author

mhaessig commented Apr 2, 2025

Thank you for reviewing!

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 2, 2025
@openjdk
Copy link

openjdk bot commented Apr 2, 2025

@mhaessig
Your change (at version e02adc4) is now ready to be sponsored by a Committer.

@eme64
Copy link
Contributor

eme64 commented Apr 2, 2025

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 2, 2025

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

  • 15d36ee: 8353330: Test runtime/cds/appcds/SignedJar.java fails in CDSHeapVerifier
  • e6fe249: 8323100: com/sun/tools/attach/StartManagementAgent.java failed with "WaitForSingleObject failed"
  • 096e70d: 8352437: Support --add-exports with -XX:+AOTClassLinking
  • 6970cf6: 8352775: JVM crashes with -XX:AOTMode=create -XX:+UseZGC
  • afcad8c: 5043343: FileImageInputStream and FileImageOutputStream do not properly track streamPos for RandomAccessFile
  • 6891490: 8353324: Clean up of comments and import after 8319192
  • 07fd666: 8342984: Bump minimum boot jdk to JDK 24
  • 6a46d55: 8353129: CDS ArchiveRelocation tests fail after JDK-8325132
  • 19eabaf: 8353227: JFR: Prepare tests for strong parser validation
  • 564066d: 8353118: Deprecate the use of java.locale.useOldISOCodes system property
  • ... and 67 more: https://git.openjdk.org/jdk/compare/b9907801afaf4c613482ce3cb1b38262ce13df29...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 2, 2025

@eme64 @mhaessig Pushed as commit f301663.

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

@mhaessig mhaessig deleted the JDK-8352893-or branch June 20, 2025 07:08
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