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

8294261: AArch64: Use pReg instead of pRegGov when possible #10461

Closed
wants to merge 1 commit into from

Conversation

nsjian
Copy link

@nsjian nsjian commented Sep 28, 2022

Currently we allocate SVE predicate register p0-p6 for pRegGov operand, which are used as governing predicates for load/store and arithmetic, and also define pReg operand for all allocatable predicate registers. Since some SVE instructions are fine to use/define p8-p15, e.g. predicate operations, this patch makes the matcher work for mixed use of pRegGov and pReg, and tries to match pReg when possible. If a predicate reg is defined as pReg but used as pRegGov, register allocator will handle that properly.

With p8-p15 being used as non-temp register, we need to save them as well when saving all registers. The code of setting predicate reg slot in OopMap in RegisterSaver::save_live_registers() is also removed, because on safepoint, vector masks have been transformed to vector [1].

Tested on different SVE systems. Also tested with making RA to allocate p8-p15 first for vReg operand, so that a p8-p15 reg has more chance to be allocated, and if an SVE instruction, emitted by ad rule, does not accept p8-p5, assembler will crash.

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/vector.cpp#L265


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-8294261: AArch64: Use pReg instead of pRegGov when possible

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10461

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

Using diff file

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

Currently we allocate SVE predicate register p0-p6 for pRegGov operand,
which are used as governing predicates for load/store and arithmetic,
and also define pReg operand for all allocatable predicate registers.
Since some SVE instructions are fine to use/define p8-p15, e.g.
predicate operations, this patch makes the matcher work for mixed use
of pRegGov and pReg, and tries to match pReg when possible. If a
predicate reg is defined as pReg but used as pRegGov, register
allocator will handle that properly.

With p8-p15 being used as non-temp register, we need to save them as
well when saving all registers. The code of setting predicate reg slot
in OopMap in RegisterSaver::save_live_registers() is also removed,
because on safepoint, vector masks have been transformed to vector [1].

Tested on different SVE systems. Also tested with making RA to allocate
p8-p15 first for vReg operand, so that a p8-p15 reg has more chance to
be allocated, and if an SVE instruction, emitted by ad rule, does not
accept p8-p5, assembler will crash.

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/vector.cpp#L265
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 28, 2022

👋 Welcome back njian! 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 Sep 28, 2022
@openjdk
Copy link

openjdk bot commented Sep 28, 2022

@nsjian 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 Sep 28, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 28, 2022

Webrevs

Copy link
Contributor

@nick-arm nick-arm left a comment

Choose a reason for hiding this comment

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

Looks OK to me!

@openjdk
Copy link

openjdk bot commented Oct 3, 2022

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

8294261: AArch64: Use pReg instead of pRegGov when possible

Reviewed-by: ngasson, xgong

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

  • 542cc60: 8294366: RISC-V: Partially mark out incompressible regions
  • 495c043: 7124710: interleaved RedefineClasses() and RetransformClasses() calls may have a problem
  • d39d8c8: 8170389: java.text.DigitList.getDouble() : Controversy between javadoc and code
  • 3466e99: 8294691: dynamicArchive/RelativePath.java is running other test case
  • 823b53d: 8294987: Streamline DerOutputStream write
  • 6a266c4: 8292879: com/sun/jdi/ClassUnloadEventTest.java failed due to classes not unloading
  • fe7a461: 8294920: Missing SP value in Linux x86_32 thread context
  • 4cbac40: 8294717: (bf) DirectByteBuffer constructor will leak if allocating Deallocator or Cleaner fails with OOME
  • c1166a3: 8289561: java/lang/instrument/NativeMethodPrefixAgent.java fails with "ERROR: Injection failure: java.lang.UnsupportedOperationException: Records requires ASM8"
  • a1747ef: 8294941: GHA: Cut down cross-compilation sysroots
  • ... and 130 more: https://git.openjdk.org/jdk/compare/5e1e449c116d44fb77a21ce4cd5187cfc55263f2...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 Oct 3, 2022
@nsjian
Copy link
Author

nsjian commented Oct 8, 2022

Looks OK to me!

Thanks for the review! @nick-arm

Copy link

@XiaohongGong XiaohongGong left a comment

Choose a reason for hiding this comment

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

LGTM!

@nsjian
Copy link
Author

nsjian commented Oct 11, 2022

LGTM!

Thanks for the review! @XiaohongGong

@nsjian
Copy link
Author

nsjian commented Oct 11, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Oct 11, 2022

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

  • 891156a: 8295003: Do not mention applets in the "java.awt.color" package
  • e6c33e6: 8295014: Remove unnecessary explicit casts to void* in CHeapObjBase
  • 1bfcc27: 8294931: JFR: Simplify SettingInfo
  • eb90c4f: 8294377: Prepare to stop auto-inheriting documentation for subclasses of exceptions whose documentation is inherited
  • 4df4a1f: 8287832: jdk/jfr/event/runtime/TestActiveSettingEvent.java failed with "Expected two batches of Active Setting events"
  • 35d17a0: 8293864: Kitchensink24HStress.java fails with SIGSEGV in JfrCheckpointManager::lease
  • c5f462e: 8294956: GHA: qemu-debootstrap is deprecated, use the regular one
  • 269252a: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel
  • 6ed74ef: 8295005: compiler/loopopts/TestRemoveEmptyLoop.java fails with release VMs after JDK-8294839
  • 8a148bc: 8294848: Unnecessary SSLCipher dispose implementations
  • ... and 141 more: https://git.openjdk.org/jdk/compare/5e1e449c116d44fb77a21ce4cd5187cfc55263f2...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 11, 2022

@nsjian Pushed as commit 4b17d28.

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

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
3 participants