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

8342393: Promote commutative vector IR node sharing #22863

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jatin-bhateja
Copy link
Member

@jatin-bhateja jatin-bhateja commented Dec 23, 2024

Patch promotes the sharing of commutative vector IR with the same inputs but different input ordering.
Unlike scalar IR where we perform edge swapping by sorting inputs based on node indices during IR idealization, for vector IR we chose a simpler approach to decorate commutative operations with a special node-level flag during IR construction thus
obviating any dependency on explicit idealization routines. This flag is later used during GVN hashing to enable node sharing.

Following are the performance stats for JMH micro included with the patch.

Granite Rapids (P-core Xeon Server)
Baseline : 
Benchmark                                                                (size)   Mode  Cnt      Score   Error   Units
VectorCommutativeOperSharingBenchmark.commutativeByteOperationShairing     1024  thrpt    2   8982.549          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeIntOperationShairing      1024  thrpt    2   6072.773          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeLongOperationShairing     1024  thrpt    2   2368.856          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeShortOperationShairing    1024  thrpt    2  15215.087          ops/ms

Withopt:
Benchmark                                                                (size)   Mode  Cnt      Score   Error   Units
VectorCommutativeOperSharingBenchmark.commutativeByteOperationShairing     1024  thrpt    2  11963.554          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeIntOperationShairing      1024  thrpt    2   7036.088          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeLongOperationShairing     1024  thrpt    2   2906.731          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeShortOperationShairing    1024  thrpt    2  17148.131          ops/ms

Sierra Forest (E-core Xeon Server)
Baseline:
Benchmark                                                                (size)   Mode  Cnt     Score   Error   Units
VectorCommutativeOperSharingBenchmark.commutativeByteOperationShairing     1024  thrpt    2  2444.359          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeIntOperationShairing      1024  thrpt    2  1710.256          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeLongOperationShairing     1024  thrpt    2   308.766          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeShortOperationShairing    1024  thrpt    2  3902.179          ops/ms

Withopt:
Benchmark                                                                (size)   Mode  Cnt     Score   Error   Units
VectorCommutativeOperSharingBenchmark.commutativeByteOperationShairing     1024  thrpt    2  3352.839          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeIntOperationShairing      1024  thrpt    2  2918.805          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeLongOperationShairing     1024  thrpt    2   409.482          ops/ms
VectorCommutativeOperSharingBenchmark.commutativeShortOperationShairing    1024  thrpt    2  6955.057          ops/ms


Please review and share your comments.

Best Regards,
Jatin


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-8342393: Promote commutative vector IR node sharing (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22863

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 23, 2024

👋 Welcome back jbhateja! 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 Dec 23, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Dec 23, 2024

@jatin-bhateja 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 Dec 23, 2024
@jatin-bhateja jatin-bhateja changed the title 8342393: Promote vector IR node sharing 8342393: Promote commutative vector IR node sharing Jan 7, 2025
@jatin-bhateja jatin-bhateja marked this pull request as ready for review January 7, 2025 17:51
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 7, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 7, 2025

Copy link
Contributor

@iwanowww iwanowww left a comment

Choose a reason for hiding this comment

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

Nice improvement, Jatin.

src/hotspot/share/opto/vectornode.hpp Show resolved Hide resolved
src/hotspot/share/opto/phaseX.cpp Outdated Show resolved Hide resolved
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.

Looks promising, thanks for the work!

src/hotspot/share/opto/vectornode.hpp Show resolved Hide resolved
src/hotspot/share/opto/vectornode.hpp Show resolved Hide resolved
src/hotspot/share/opto/phaseX.cpp Outdated Show resolved Hide resolved
src/hotspot/share/opto/phaseX.cpp Outdated Show resolved Hide resolved
@openjdk
Copy link

openjdk bot commented Jan 9, 2025

@jatin-bhateja Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

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 rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants