Skip to content

8304293: RISC-V: JDK-8276799 missed atomic intrinsic support for C1#13053

Closed
feilongjiang wants to merge 1 commit intoopenjdk:masterfrom
feilongjiang:riscv_miss_c1_atomic_intrinsic
Closed

8304293: RISC-V: JDK-8276799 missed atomic intrinsic support for C1#13053
feilongjiang wants to merge 1 commit intoopenjdk:masterfrom
feilongjiang:riscv_miss_c1_atomic_intrinsic

Conversation

@feilongjiang
Copy link
Member

@feilongjiang feilongjiang commented Mar 16, 2023

The following intrinsics in C1 are controlled by supports_atomic_xxx, but they are not set properly on RISC-V:

  • _getAndAddInt
  • _getAndAddLong
  • _getAndSetInt
  • _getAndSetLong
  • _getAndSetReference

RISC-V provides a set of atomic instructions [1], these intrinsics could be enabled by default.

Here is the HIR output of C1:

before:

B18 (V) [189, 196] -> B20 pred: B8 B17 
empty stack
inlining depth 0
__bci__use__tid____instr____________________________________
  0    0    a251   <instance 0x00000040a802fb98 klass=jdk/internal/misc/Unsafe>
  3    0    a252   null   
  4    0    l254   274954985816L
  7    0    l255   1L
. 8    0    l256   a251.invokespecial(a252, l254, l255)
                   jdk/internal/misc/Unsafe.getAndAddLong(Ljava/lang/Object;JJ)J
. 193  0    l258   a42._24 := l256 (J) tid
. 196  0     259   goto B20

after:

B18 (V) [189, 196] -> B20 pred: B8 B17 
empty stack
inlining depth 0
__bci__use__tid____instr____________________________________
  0    0    a251   <instance 0x00000040a802fb98 klass=jdk/internal/misc/Unsafe>
  3    0    a252   null   
  4    0    l254   274954985816L
  7    0    l255   1L
. 8    0    l256   UnsafeGetAndSet (add)(a252, l254, value l255)
. 193  0    l258   a42._24 := l256 (J) tid
. 196  0     259   goto B20
  1. https://github.com/riscv/riscv-isa-manual/blob/8b9047d8d20ef548f7996efee1550760d7bc1279/src/a.tex#L416-L422

Testing:

  • hotspot_tier1 & jdk_tier1 on Unmatched board (release build)

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-8304293: RISC-V: JDK-8276799 missed atomic intrinsic support for C1

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13053

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 16, 2023

👋 Welcome back fjiang! 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 Mar 16, 2023
@openjdk
Copy link

openjdk bot commented Mar 16, 2023

@feilongjiang The following label will be automatically applied to this pull request:

  • hotspot

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 hotspot-dev@openjdk.org label Mar 16, 2023
@feilongjiang feilongjiang marked this pull request as draft March 16, 2023 03:42
@openjdk openjdk bot removed the rfr Pull request is ready for review label Mar 16, 2023
@feilongjiang feilongjiang force-pushed the riscv_miss_c1_atomic_intrinsic branch from cd94f26 to 81e0084 Compare March 16, 2023 03:46
@feilongjiang feilongjiang marked this pull request as ready for review March 16, 2023 03:46
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 16, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 16, 2023

Webrevs

Copy link
Member

@RealFYang RealFYang 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. Thanks for finding this.

@openjdk
Copy link

openjdk bot commented Mar 16, 2023

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

8304293: RISC-V: JDK-8276799 missed atomic intrinsic support for C1

Reviewed-by: fyang, yzhu

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

  • e339e18: 7016187: javac -h could generate conflict .h for inner class and class name with '_'
  • 033c0b1: 8304437: ProblemList com/sun/jdi/ThreadMemoryLeadTest.java with ZGC
  • 7503ecc: 8304138: [JVMCI] Test FailedSpeculation existence before appending.
  • f8482c2: 8297638: Memory leak in case of many started-dead threads
  • c56f011: 8298995: tools/jpackage/share/AddLauncherTest.java#id1 failed "AddLauncherTest.test; checks=53"
  • 254288a: 8014021: TreeMaker.Params behaves inconsistently when the owning method has the same number of parameters as the number of parameter types requested
  • 8f5bb53: 8015831: Add lint check for calling overridable methods from a constructor
  • b085ab9: 8180387: com.sun.source.util.JavacTask should have a protected constructor.
  • bfb812a: 8292818: replace 96-bit representation for field metadata with variable-sized streams
  • 932be35: 8298469: Obsolete legacy parallel class loading workaround for non-parallel-capable class loaders
  • ... and 27 more: https://git.openjdk.org/jdk/compare/2b81faeb3514060e6c8c950ef4e39e299c43199d...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 (@RealFYang) 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 openjdk bot added the ready Pull request is ready to be integrated label Mar 16, 2023
Copy link

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

@feilongjiang
Copy link
Member Author

@RealFYang @yhzhu20 -- Thanks!
/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Mar 20, 2023
@openjdk
Copy link

openjdk bot commented Mar 20, 2023

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

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Mar 20, 2023

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

  • e339e18: 7016187: javac -h could generate conflict .h for inner class and class name with '_'
  • 033c0b1: 8304437: ProblemList com/sun/jdi/ThreadMemoryLeadTest.java with ZGC
  • 7503ecc: 8304138: [JVMCI] Test FailedSpeculation existence before appending.
  • f8482c2: 8297638: Memory leak in case of many started-dead threads
  • c56f011: 8298995: tools/jpackage/share/AddLauncherTest.java#id1 failed "AddLauncherTest.test; checks=53"
  • 254288a: 8014021: TreeMaker.Params behaves inconsistently when the owning method has the same number of parameters as the number of parameter types requested
  • 8f5bb53: 8015831: Add lint check for calling overridable methods from a constructor
  • b085ab9: 8180387: com.sun.source.util.JavacTask should have a protected constructor.
  • bfb812a: 8292818: replace 96-bit representation for field metadata with variable-sized streams
  • 932be35: 8298469: Obsolete legacy parallel class loading workaround for non-parallel-capable class loaders
  • ... and 27 more: https://git.openjdk.org/jdk/compare/2b81faeb3514060e6c8c950ef4e39e299c43199d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 20, 2023

@RealFYang @feilongjiang Pushed as commit c09f83e.

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

@feilongjiang feilongjiang deleted the riscv_miss_c1_atomic_intrinsic branch April 25, 2023 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants