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

8256883: C2: Add a RegMask iterator #1397

Closed
wants to merge 6 commits into from

Conversation

cl4es
Copy link
Member

@cl4es cl4es commented Nov 23, 2020

By implementing a simple RegMaskIterator we can speed this up and possibly make the code a bit clearer by doing so.

As a data point, this reduce the C2Compiler::initialize overhead from 8.82M instructions to 8.58M instructions, from the improvement in PhaseChaitin::post_allocate_copy_removal (~16k insns/compilation). The gain varies with type of compilation, so on the naive tests in SimpleRepeatCompilation it's in the noise (~2k insns/compilation on `trivialMath, for example).


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux aarch64 Linux arm Linux ppc64le Linux s390x Linux x64 Linux x86 Windows x64 macOS x64
Build ✔️ (1/1 passed) ✔️ (1/1 passed) ✔️ (1/1 passed) ✔️ (1/1 passed) ✔️ (6/6 passed) ✔️ (2/2 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed)

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1397/head:pull/1397
$ git checkout pull/1397

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 23, 2020

👋 Welcome back redestad! 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 23, 2020

@cl4es 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 23, 2020
@cl4es cl4es marked this pull request as ready for review November 23, 2020 19:36
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 23, 2020
@mlbridge
Copy link

mlbridge bot commented Nov 23, 2020

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.

There are 2 places in ZGC code (x86 and aarch64) which could use new iterator too:
https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp#L482

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org and removed hotspot-compiler hotspot-compiler-dev@openjdk.org labels Nov 23, 2020
@cl4es
Copy link
Member Author

cl4es commented Nov 23, 2020

/label remove hotspot
/label add hotspot-gc
/label add hotspot-compiler

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label Nov 23, 2020
@openjdk
Copy link

openjdk bot commented Nov 23, 2020

@cl4es
The hotspot label was successfully removed.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Nov 23, 2020
@openjdk
Copy link

openjdk bot commented Nov 23, 2020

@cl4es
The hotspot-gc label was successfully added.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Nov 23, 2020
@openjdk
Copy link

openjdk bot commented Nov 23, 2020

@cl4es
The hotspot-compiler label was successfully added.

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 Nov 24, 2020

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

8256883: C2: Add a RegMask iterator

Reviewed-by: kvn, pliden, eosterlund

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

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 Nov 24, 2020
Copy link
Contributor

@pliden pliden left a comment

Choose a reason for hiding this comment

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

ZGC changes look good.

Copy link
Contributor

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

@cl4es
Copy link
Member Author

cl4es commented Nov 24, 2020

@vnkozlov @pliden @fisk - thank you for reviewing!

I ran ZGC tier1-7 testing on linux-x64 and linux-aarch64 overnight, all passed.

/integrate

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

openjdk bot commented Nov 24, 2020

@cl4es Since your change was applied there have been 31 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit fa3cfcd.

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

openjdk-notifier bot referenced this pull request Nov 24, 2020
Reviewed-by: kvn, pliden, eosterlund
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 hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants