jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8329032: C2 compiler register allocation support for APX EGPRs

Open jatin-bhateja opened this issue 1 year ago • 4 comments

Intel® Advanced Performance Extensions (Intel® APX) adds 16 new 64 bit general purpose register also known as Extended General Purpose Registers in IA-32e 64 bit mode.

This initial patch adds following support:-

  1. C2 compiler register allocation support.
  2. State save restoration while transitioning from C2 JIT compiled code to runtime services.
  3. Applicable extensions to native interface used by runtime for patching instruction.

We plan to address C1 register support in subsequent patch as there are hard upper bound allocation limits (currently set to r11) imposed by existing implementation of linear scan algorithm after which it reserves remaining register for special purpose.

Patch has been regressed over stand alone test points after merging with other APX support patches [1][2] under review.

We plan to do thorough validation using Intel's SDE during course of time and release incremental patches for bug fixes found during testing.

[1] https://github.com/openjdk/jdk/pull/18476 [2] https://github.com/openjdk/jdk/pull/18562

PS: Intent of this draft PR is to facilitate validation of existing APX related PRs under review.


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8329032: C2 compiler register allocation support for APX EGPRs (Sub-task - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19042

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

Using diff file

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

jatin-bhateja avatar May 01 '24 18:05 jatin-bhateja

:wave: 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.

bridgekeeper[bot] avatar May 01 '24 18:05 bridgekeeper[bot]

@jatin-bhateja 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:

8329032: C2 compiler register allocation support for APX EGPRs

Reviewed-by: kvn, sviswanathan

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

  • a81e1bf1e1a6f00280b9be987c03fe20915fd52c: 8332252: Clean up vmTestbase/vm/share
  • 99e4d77aac72cdddb4973805d28c225f17ea965f: 8333117: Remove support of remote and manual debuggee launchers
  • 9ef86da5f8e2579fa1fdf40b4a6f556882e1177d: 8334170: bug6492108.java test failed with exception Image comparison failed at (0, 0) for image 4
  • 001d6860199436c5fb14bd681d640d462b472015: 8332587: RISC-V: secondary_super_cache does not scale well
  • 5cad0b4df7f5ccb6d462dc948c2ea5ad5da6e2ed: 8322708: Global HTML attributes are not allowed
  • 642084629a9a793a055cba8a950fdb61b7450093: 8334396: RISC-V: verify perf of ReverseBytesI/L
  • c6f3bf4bd61405c2ed374b15ef82cc987f52cd52: 8334026: Provide a diagnostic PrintMemoryMapAtExit switch on Linux
  • cabd1046d08865f122663d18708d40e5c885c1c3: 8334164: The fix for JDK-8322811 should use _filename.is_set() rather than strcmp()
  • d7dad50af5df356089101ca440fca5232fadb81e: 8334544: C2: wrong control assigned in PhaseIdealLoop::clone_assertion_predicate_for_unswitched_loops()
  • ff30240926224b2f98e173bcd606c157af788919: 8334239: Introduce macro for ubsan method/function exclusions
  • ... and 16 more: https://git.openjdk.org/jdk/compare/6f860f8f6f69369130ed79e71255005b5beed45a...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[bot] avatar May 01 '24 18:05 openjdk[bot]

@jatin-bhateja 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[bot] avatar May 01 '24 18:05 openjdk[bot]

@jatin-bhateja this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8329032
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

openjdk[bot] avatar May 09 '24 23:05 openjdk[bot]

/label add hotspot-compiler-dev

jatin-bhateja avatar Jun 13 '24 15:06 jatin-bhateja

@jatin-bhateja The hotspot-compiler label was successfully added.

openjdk[bot] avatar Jun 13 '24 15:06 openjdk[bot]

Looks like there is issue with 32-bit builds. See GHA linux-x86 / build failure.

vnkozlov avatar Jun 13 '24 15:06 vnkozlov

Some JVMCI tests failed in GHA on all x64 platforms:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000109b66d2c, pid=19199, tid=26883
#
# JRE version: OpenJDK Runtime Environment (24.0) (fastdebug build 24-internal-jatin-bhateja)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 24-internal-jatin-bhateja, mixed mode, sharing, tiered, jvmci, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# V  [libjvm.dylib+0x117ed2c]  StackValue* StackValue::create_stack_value<RegisterMap>(ScopeValue*, unsigned char*, RegisterMap const*)+0x27c

vnkozlov avatar Jun 14 '24 17:06 vnkozlov

Looks good. I pushed #19758 changes to remove unused code in nativeInst_x86.* @jatin-bhateja, please merge latest mainline to include the changes. I will start testing after that.

vnkozlov avatar Jun 18 '24 14:06 vnkozlov

Looks good. I pushed #19758 changes to remove unused code in nativeInst_x86.* @jatin-bhateja, please merge latest mainline to include the changes. I will start testing after that.

Hi @vnkozlov , Please submit it for testing.

jatin-bhateja avatar Jun 18 '24 16:06 jatin-bhateja

I start testing

vnkozlov avatar Jun 18 '24 16:06 vnkozlov

Thanks @vnkozlov and @sviswa7 for approvals.

jatin-bhateja avatar Jun 20 '24 23:06 jatin-bhateja

/integrate

jatin-bhateja avatar Jun 20 '24 23:06 jatin-bhateja

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

  • 4b4a483b6fe7a6fcfdfe6f68faac29099a64c982: 8330699: Obsolete -XX:+UseEmptySlotsInSupers
  • 187710e1c1714ba28c7802efd4f7bb32a366d79d: 8333300: [JVMCI] add support for generational ZGC
  • de8ee97718d7e12b541b310cf5b67f3e10e91ad9: 8334333: MissingResourceCauseTestRun.java fails if run by root
  • 265a0f5547d0ddb220391aef679c122768f02a00: 8334490: Normalize string with locale invariant toLowerCase()
  • 1b1dba8082969244effa86ac03c6053b3b0ddc43: 8333358: java/io/IO/IO.java test fails intermittently
  • a81e1bf1e1a6f00280b9be987c03fe20915fd52c: 8332252: Clean up vmTestbase/vm/share
  • 99e4d77aac72cdddb4973805d28c225f17ea965f: 8333117: Remove support of remote and manual debuggee launchers
  • 9ef86da5f8e2579fa1fdf40b4a6f556882e1177d: 8334170: bug6492108.java test failed with exception Image comparison failed at (0, 0) for image 4
  • 001d6860199436c5fb14bd681d640d462b472015: 8332587: RISC-V: secondary_super_cache does not scale well
  • 5cad0b4df7f5ccb6d462dc948c2ea5ad5da6e2ed: 8322708: Global HTML attributes are not allowed
  • ... and 21 more: https://git.openjdk.org/jdk/compare/6f860f8f6f69369130ed79e71255005b5beed45a...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Jun 20 '24 23:06 openjdk[bot]

@jatin-bhateja Pushed as commit e5de26ddf0550da9e6d074d5b9ab4a943170adca.

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

openjdk[bot] avatar Jun 20 '24 23:06 openjdk[bot]