Skip to content

Conversation

@theoweidmannoracle
Copy link
Contributor

@theoweidmannoracle theoweidmannoracle commented Nov 13, 2024

This PR introduces

  • several new optimizations to unsigned division and modulo
    • x % 1, x % x, x % 2^k
    • x / 1, x / x, x / 2^k
    • does not implement the Granlund and Montgomery algorithm, which has been implemented for signed modulo division in the past. It is unclear if a lot is to be gained by implementing this.
  • tests to test existing optimizations for signed division and modulo
    • does not test the Granlund and Montgomery algorithm directly

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-8332268: C2: Add missing optimizations for UDivI/L and UModI/L and unify the shared logic with the signed nodes (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22061

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 13, 2024

👋 Welcome back theoweidmannoracle! 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 Nov 13, 2024

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

8332268: C2: Add missing optimizations for UDivI/L and UModI/L and unify the shared logic with the signed nodes

Reviewed-by: chagedorn, thartmann, epeter, qamai

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

  • a21d21f: 8345609: [C1] LIR Operations with one input should be implemented as LIR_Op1
  • 2382a2d: 8345661: Simplify page size alignment in code heap reservation
  • 076bfa6: 8345656: Move os alignment functions out of ReservedSpace
  • 2826838: 8345658: WB_NMTCommitMemory redundantly records an NMT tag
  • c9ec271: 8345800: Update copyright year to 2024 for serviceability in files where it was missed
  • 8e0f929: 8345805: Update copyright year to 2024 for other files where it was missed
  • f88c1c6: 8345773: Class-File API debug printing capability
  • e88e793: 8343148: C2: Refactor uses of "PhaseValue::con() + PhaseIdealLoop::set_ctrl()" into separate method
  • 1e9204f: 8345273: Fix -Wzero-as-null-pointer-constant warnings in s390 code
  • c40140e: 8334581: Remove no-arg constructor BasicSliderUI()
  • ... and 224 more: https://git.openjdk.org/jdk/compare/d33ad07c32f23aee799750c9964ab26d0cbe56f4...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 (@TobiHartmann, @eme64, @merykitty, @chhagedorn) 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
Copy link

openjdk bot commented Nov 13, 2024

@theoweidmannoracle 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 Nov 13, 2024
@merykitty
Copy link
Member

This seems similar to #9947 . Feel free to take over if you are working on this as I am not working on the PR right now and I forgot which state it is in.

@theoweidmannoracle
Copy link
Contributor Author

@merykitty Thanks for the pointer. If I understand correctly, your PR is more focused on improving division by applying numerical transformations, while the focus of this PR is to add basic optimizations to unsigned division and modulo (such as division by 1) and test the optimizations present for signed division. So I think your PR would indeed complement this PR very well.

@theoweidmannoracle theoweidmannoracle marked this pull request as ready for review November 13, 2024 11:56
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 13, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 13, 2024

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 otherwise. Nice tests!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 20, 2024
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.

Nice improvements, some comments/ questions below about testing.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Nov 25, 2024
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 10, 2024
Copy link
Member

@chhagedorn chhagedorn 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 fixing the cases! Some minor variable renaming suggestions for the existing code that you moved. Otherwise, looks good to me, too.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 10, 2024
…i.java

Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 10, 2024
@theoweidmannoracle
Copy link
Contributor Author

@chhagedorn Thanks for the suggestions. I renamed the variables.

@openjdk
Copy link

openjdk bot commented Dec 10, 2024

⚠️ @theoweidmannoracle This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 11, 2024
@theoweidmannoracle
Copy link
Contributor Author

/integrate

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 11, 2024
@openjdk
Copy link

openjdk bot commented Dec 11, 2024

@theoweidmannoracle This pull request has not yet been marked as ready for integration.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 11, 2024
@theoweidmannoracle
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 11, 2024
@openjdk
Copy link

openjdk bot commented Dec 11, 2024

@theoweidmannoracle
Your change (at version 4f33cd6) is now ready to be sponsored by a Committer.

@chhagedorn
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 11, 2024

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

  • 45c914c: 8343607: C2: Shenandoah crashes during barrier expansion in Continuation::enter
  • a21d21f: 8345609: [C1] LIR Operations with one input should be implemented as LIR_Op1
  • 2382a2d: 8345661: Simplify page size alignment in code heap reservation
  • 076bfa6: 8345656: Move os alignment functions out of ReservedSpace
  • 2826838: 8345658: WB_NMTCommitMemory redundantly records an NMT tag
  • c9ec271: 8345800: Update copyright year to 2024 for serviceability in files where it was missed
  • 8e0f929: 8345805: Update copyright year to 2024 for other files where it was missed
  • f88c1c6: 8345773: Class-File API debug printing capability
  • e88e793: 8343148: C2: Refactor uses of "PhaseValue::con() + PhaseIdealLoop::set_ctrl()" into separate method
  • 1e9204f: 8345273: Fix -Wzero-as-null-pointer-constant warnings in s390 code
  • ... and 225 more: https://git.openjdk.org/jdk/compare/d33ad07c32f23aee799750c9964ab26d0cbe56f4...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 11, 2024
@openjdk openjdk bot closed this Dec 11, 2024
@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 Dec 11, 2024
@openjdk
Copy link

openjdk bot commented Dec 11, 2024

@chhagedorn @theoweidmannoracle Pushed as commit d381d58.

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

5 participants