Skip to content

8305783: x86_64: Optimize AbsI and AbsL #13402

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 3 commits into from
Closed

Conversation

merykitty
Copy link
Member

@merykitty merykitty commented Apr 9, 2023

Hi,

This patch optimizes the sequence emitted by AbsINode and AbsLNode to save some instructions and 1 temp register. Please take a look and kindly leave your reviews.

Thanks a lot.


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

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13402

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 9, 2023

👋 Welcome back qamai! 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 Apr 9, 2023
@openjdk
Copy link

openjdk bot commented Apr 9, 2023

@merykitty 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 Apr 9, 2023
@merykitty
Copy link
Member Author

Running the patch on org.openjdk.bench.java.lang.MathBench shows noticeable improvement:

                                        Before                    After
Benchmark           Mode  Cnt        Score       Error        Score       Error   Units   Change
MathBench.absInt   thrpt    8  2848176.368 ± 18552.810  3442310.540 ± 65838.237  ops/ms  +20.86%
MathBench.absLong  thrpt    8  2851886.891 ± 17565.736  3389983.543 ± 36466.553  ops/ms  +18.87%

@mlbridge
Copy link

mlbridge bot commented Apr 9, 2023

Webrevs

Copy link
Member

@jaskarth jaskarth left a comment

Choose a reason for hiding this comment

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

Patch looks nice! (I am not a reviewer.) I have one comment with the code.

I was also thinking that the unconditional usage of cmov here may lead to performance issues if the abs is part of a loop-carried dependency, as I've seen that happen before with MinI/MaxI nodes before. I did a small test to see if that was the case here and it seems there's no regression, so very nice!

@merykitty
Copy link
Member Author

@jaskarth Thanks a lot for your review, I think this cannot introduce more dependency into the operation since it depends on src already. I also added more description to the format sections

@jaskarth
Copy link
Member

Great, thank you!

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.

@openjdk
Copy link

openjdk bot commented Apr 12, 2023

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

8305783: x86_64: Optimize AbsI and AbsL

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

  • b9bdbe9: 8305524: AArch64: Fix arraycopy issue on SVE caused by matching rule vmask_gen_sub
  • 82e8b03: 8305203: Simplify trimming operation in Region::Ideal
  • 27cf638: 8300912: Update java/nio/MappedByteBuffer/PmemTest.java to run on x86_64 only
  • 42fa000: 8305484: Compiler::init_c1_runtime unnecessarily uses an Arena that lives for the lifetime of the process
  • 475e9a7: 8305809: (fs) Review obsolete Linux kernel dependency on os.version (Unix kernel 2.6.39)
  • 1de772c: 8294806: jpackaged-app ignores splash screen from jar file
  • d9db906: 8305368: G1 remset chunk claiming may use relaxed memory ordering
  • c789d24: 8305370: Inconsistent use of for_young_only_phase parameter in G1 predictions
  • c6d7cf6: 8305663: Wrong iteration order of pause array in g1MMUTracker
  • ce4b995: 8305761: Resolve multiple definition of 'jvm' when statically linking with JDK native libraries
  • ... and 149 more: https://git.openjdk.org/jdk/compare/d063b8964fbdd6ca1d9527dabb40fed59bbc8ad7...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 Apr 12, 2023
@merykitty
Copy link
Member Author

@TobiHartmann Thanks for your review, I will integrate the change

@merykitty
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Apr 12, 2023

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

  • d8af7a6: 8304725: AsyncGetCallTrace can cause SIGBUS on M1
  • b9bdbe9: 8305524: AArch64: Fix arraycopy issue on SVE caused by matching rule vmask_gen_sub
  • 82e8b03: 8305203: Simplify trimming operation in Region::Ideal
  • 27cf638: 8300912: Update java/nio/MappedByteBuffer/PmemTest.java to run on x86_64 only
  • 42fa000: 8305484: Compiler::init_c1_runtime unnecessarily uses an Arena that lives for the lifetime of the process
  • 475e9a7: 8305809: (fs) Review obsolete Linux kernel dependency on os.version (Unix kernel 2.6.39)
  • 1de772c: 8294806: jpackaged-app ignores splash screen from jar file
  • d9db906: 8305368: G1 remset chunk claiming may use relaxed memory ordering
  • c789d24: 8305370: Inconsistent use of for_young_only_phase parameter in G1 predictions
  • c6d7cf6: 8305663: Wrong iteration order of pause array in g1MMUTracker
  • ... and 150 more: https://git.openjdk.org/jdk/compare/d063b8964fbdd6ca1d9527dabb40fed59bbc8ad7...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 12, 2023

@merykitty Pushed as commit 99a9dbc.

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

@merykitty merykitty deleted the abs branch April 27, 2023 03:00
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.

3 participants