Skip to content

8328528: C2 should optimize long-typed parallel iv in an int counted loop #18489

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

Closed
wants to merge 45 commits into from

Conversation

tabjy
Copy link
Member

@tabjy tabjy commented Mar 26, 2024

Currently, parallel iv optimization only happens in an int counted loop with int-typed parallel iv's. This PR adds support for long-typed iv to be optimized.

Additionally, this ticket contributes to the resolution of JDK-8275913. Meanwhile, I'm working on adding support for parallel IV replacement for long counted loops which will depend on this PR.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 2 Reviewers)

Issue

  • JDK-8328528: C2 should optimize long-typed parallel iv in an int counted loop (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18489

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 26, 2024

👋 Welcome back kxu! 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 26, 2024

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

8328528: C2 should optimize long-typed parallel iv in an int counted loop

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

  • 330f2b5: 8342295: compiler/jvmci/TestJVMCISavedProperties.java fails due to garbage in output
  • 1f35748: 8342102: ZGC: Optimize copy constructors in ZPhysicalMemory
  • 66ddaaa: 8340241: RISC-V: Returns mispredicted
  • 07f550b: 8340818: Add a new jtreg test root to test the generated documentation
  • 27ef6c9: 8341470: BigDecimal.stripTrailingZeros() optimization
  • 5d5d88a: 8339570: Add Tidy build support for JDK tests
  • 239d84a: 8342578: GHA: RISC-V: Bootstrap using Debian snapshot is still failing
  • aa060f2: 8342334: CDS: Scratch mirrors should not point to dead klasses
  • 680dc5d: 8342496: C2/Shenandoah: SEGV in compiled code when running jcstress
  • 8f2b23b: 8341407: C2: assert(main_limit == cl->limit() || get_ctrl(main_limit) == new_limit_ctrl) failed: wrong control for added limit
  • ... and 356 more: https://git.openjdk.org/jdk/compare/fb703258774ca14a6a239fc6d47a37e021e6036a...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 (@rwestrel, @eme64, @TobiHartmann, @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 Mar 26, 2024

@tabjy 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 26, 2024
@tabjy tabjy marked this pull request as ready for review March 27, 2024 00:30
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 27, 2024
@mlbridge
Copy link

mlbridge bot commented Mar 27, 2024

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.

That looks good to me. A comment that shows what the transformation does with pseudo code before and pseudo code after (before/after subgraphs) would be helpful I think.

@dean-long
Copy link
Member

Do we also handle the reverse, int-typed parallel iv in a long counted loop?

On a related topic, I noticed that checks for is_range_check_if seem to require the type to match the loop type, but I wonder if that could be relaxed.

@tabjy
Copy link
Member Author

tabjy commented Apr 10, 2024

@dean-long

No, it doesn't at this stage. C2 never supported parallel iv of any type in long counted loops. However, I'm working on a patch adding supports for long and int iv in long counted loops. Since there are code dependencies, I'd prefer to have this pr merged first.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 18, 2024
@tabjy
Copy link
Member Author

tabjy commented Oct 18, 2024

/integrate

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

openjdk bot commented Oct 18, 2024

@tabjy
Your change (at version 04b2c6a) is now ready to be sponsored by a Committer.

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.

Two suggestions but otherwise, looks good to me, too.

@openjdk openjdk bot removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated labels Oct 18, 2024
@tabjy tabjy requested a review from chhagedorn October 18, 2024 21:08
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 21, 2024
@rwestrel
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 21, 2024

@rwestrel The PR has been updated since the change author (@tabjy) issued the integrate command - the author must perform this command again.

@tabjy
Copy link
Member Author

tabjy commented Oct 21, 2024

/integrate

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

openjdk bot commented Oct 21, 2024

@tabjy
Your change (at version 81bce8f) is now ready to be sponsored by a Committer.

@rwestrel
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 21, 2024

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

  • 330f2b5: 8342295: compiler/jvmci/TestJVMCISavedProperties.java fails due to garbage in output
  • 1f35748: 8342102: ZGC: Optimize copy constructors in ZPhysicalMemory
  • 66ddaaa: 8340241: RISC-V: Returns mispredicted
  • 07f550b: 8340818: Add a new jtreg test root to test the generated documentation
  • 27ef6c9: 8341470: BigDecimal.stripTrailingZeros() optimization
  • 5d5d88a: 8339570: Add Tidy build support for JDK tests
  • 239d84a: 8342578: GHA: RISC-V: Bootstrap using Debian snapshot is still failing
  • aa060f2: 8342334: CDS: Scratch mirrors should not point to dead klasses
  • 680dc5d: 8342496: C2/Shenandoah: SEGV in compiled code when running jcstress
  • 8f2b23b: 8341407: C2: assert(main_limit == cl->limit() || get_ctrl(main_limit) == new_limit_ctrl) failed: wrong control for added limit
  • ... and 356 more: https://git.openjdk.org/jdk/compare/fb703258774ca14a6a239fc6d47a37e021e6036a...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 21, 2024

@rwestrel @tabjy Pushed as commit 80ec552.

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

6 participants