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

8319781: RISC-V: Refactor UseRVV related checks #16580

Closed
wants to merge 4 commits into from

Conversation

Hamlin-Li
Copy link

@Hamlin-Li Hamlin-Li commented Nov 9, 2023

Hi,
Can you review the patch to refactor the code related UseRVV checks?
Thanks!

There are some code (flag setting/checking) depending on UseRVV's value, these code should be refactored, especially after the change of https://bugs.openjdk.org/browse/JDK-8319408:

  1. some code needs to get the final UseRVV's value rather than the initial value, e.g. ChaCha20 intrinsic.
  2. refactored to be more readable.
  3. also add note to make sure the future code get the final UseRVV value instead of inital value.

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-8319781: RISC-V: Refactor UseRVV related checks (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16580

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

Using diff file

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

Webrev

Link to Webrev Comment

@Hamlin-Li Hamlin-Li mentioned this pull request Nov 9, 2023
3 tasks
@bridgekeeper
Copy link

bridgekeeper bot commented Nov 9, 2023

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

openjdk bot commented Nov 9, 2023

@Hamlin-Li 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 Nov 9, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 9, 2023

Webrevs

@robehn
Copy link
Contributor

robehn commented Nov 13, 2023

Hey, how is the changes to SpecialEncodeISOArray related ?

c2_initialize();
#endif // COMPILER2

// NOTE: Make sure codes dependent on UseRVV are put at the behind of c2_initialize(),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// NOTE: Make sure codes dependent on UseRVV are put at the behind of c2_initialize(),
// NOTE: Make sure codes dependent on UseRVV are put after c2_initialize(),

Copy link
Author

Choose a reason for hiding this comment

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

Thanks!

@Hamlin-Li
Copy link
Author

Hey, how is the changes to SpecialEncodeISOArray related ?

This patch is also to respond the comment at #16481 (comment)

@robehn
Copy link
Contributor

robehn commented Nov 13, 2023

Hey, how is the changes to SpecialEncodeISOArray related ?

This patch is also to respond the comment at #16481 (comment)

Ok, looks good!

@openjdk
Copy link

openjdk bot commented Nov 13, 2023

@Hamlin-Li 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:

8319781: RISC-V: Refactor UseRVV related checks

Reviewed-by: rehn, fyang

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 1 new commit pushed to the master branch:

  • 9c98270: 8254693: Add Panama feature to pass heap segments to native code

Please see this link for an up-to-date comparison between the source branch of this pull request and 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 13, 2023
@@ -289,17 +293,9 @@ void VM_Version::c2_initialize() {

if (!UseRVV) {
FLAG_SET_DEFAULT(SpecialEncodeISOArray, false);
Copy link
Member

Choose a reason for hiding this comment

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

Could you please remove this line while you are on it? I don't think we need to reset SpecialEncodeISOArray here.

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure, as there are some code in share/classfile/vmIntrinsics.cpp which depends on SpecialEncodeISOArray's value:

  case vmIntrinsics::_encodeISOArray:
  case vmIntrinsics::_encodeAsciiArray:
  case vmIntrinsics::_encodeByteISOArray:
    if (!SpecialEncodeISOArray) return true;
    break;

Copy link
Member

@RealFYang RealFYang Nov 13, 2023

Choose a reason for hiding this comment

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

The reason is that SpecialEncodeISOArray is a DIAGNOSTIC option which I think is for debugging / trouble-shooting purpose. The other four ones are SpecialStringCompareTo, SpecialStringIndexOf, SpecialStringEquals and SpecialArraysEquals. So this code snippet checking for SpecialEncodeISOArray is in function vmIntrinsics::disabled_by_jvm_flags. So I think we are safe to have this change. In fact, SpecialEncodeISOArray and the others are not checked or modified by other platforms either.

Copy link
Author

Choose a reason for hiding this comment

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

It makes sense, Thanks!

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.

Updated change looks good. Thanks.

@Hamlin-Li
Copy link
Author

@robehn @luhenry @RealFYang Thanks for your reviewing!

/integrate

@openjdk
Copy link

openjdk bot commented Nov 15, 2023

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

  • bad6999: 8313672: C2: PhaseCCP does not correctly track analysis dependencies involving shift, convert, and mask
  • fbe1937: 8319955: Improve dependencies removal during class unloading
  • 4c1540b: 8287284: C2: loop optimization performs split_thru_phi infinitely many times
  • 70f0c01: 8320054: Remove unused _count from NMT walker classes
  • e7486e8: 8315986: [macos14] javax/swing/JMenuItem/4654927/bug4654927.java: component must be showing on the screen to determine its location
  • a6343c0: 8319999: Refactor MetaspaceShared::use_full_module_graph()
  • d9a89c5: 8319572: Test jdk/incubator/vector/LoadJsvmlTest.java ignores VM flags
  • 1e76ba0: 8319439: Move BufferNode from PtrQueue files to new files
  • d5abe49: 8319628: DateFormat does not mention IllegalArgumentException for invalid style args
  • d725b73: 8301310: The SendRawSysexMessage test may cause a JVM crash
  • ... and 10 more: https://git.openjdk.org/jdk/compare/c80e691adf6f9ac1a41b2329ce366710e604e34e...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 15, 2023

@Hamlin-Li Pushed as commit fac6b51.

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

@Hamlin-Li Hamlin-Li deleted the refactor-UseRVV-code branch February 27, 2024 08:46
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
4 participants