Skip to content

Conversation

@eme64
Copy link
Contributor

@eme64 eme64 commented Nov 4, 2024

There used to be a bug where this happens:

  • SuperWord vectorizes, and picks a field-store as he alignment reference, using a CastP2X on he object pointer.
  • Later, all field loads disappear, and the Allocation of the object is eliminated.
  • The GC code then thinks the CastP2X is part of the GC barrier code... and crashes with wrong assumptions about that part of the IR.

We should obviously not use field-accesses as alignment references for SuperWord. A few other changes have fixed this issue:

  • JDK-8328544: it disallows any non-array accesses that do not have an int-index. This code was backported and so should on its own fix the issue everywhere. But maybe somebody has the idea and wants to be more smart... allowing such memory accesses without int-indices. For that we should add this regression test.
// We did not find the int_index. Just to be safe, reject this VPointer.
if (!_has_int_index_after_convI2L) {
  return false;
}
  • Recently, we now only allow memory access to be alignment references if they are actually vectorized... which cannot happen with field stores.
  • Roberto's change with GC barriers also removed the asserting/crashing code. Though I'm not sure if that means the IR is then ok.

At any rate: the bug seems fixed, but we should add and possibly backport this regression test anyway.


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-8342498: Add test for Allocation elimination after use as alignment reference by SuperWord (Enhancement - P2)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21875

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 4, 2024

👋 Welcome back epeter! 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 Nov 4, 2024

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

8342498: Add test for Allocation elimination after use as alignment reference by SuperWord

Reviewed-by: thartmann, kvn

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

  • 7f8450c: 8343473: Update copyright year of AddmodsOption.java
  • b74652b: 8343167: Unnecessary define checks in InterpreterRuntime after JDK-8199809
  • 646d64e: 8340307: Add explanation around MemorySegment:reinterpret regarding arenas
  • 8d6cfba: 8336267: Method and Constructor signature parsing can be shared on the root object
  • 1f7d524: 8343437: ClassDesc.of incorrectly permitting empty names

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 changed the title JDK-8342498 8342498: Add test for Allocation elimination after use as alignment reference by SuperWord Nov 4, 2024
@openjdk
Copy link

openjdk bot commented Nov 4, 2024

@eme64 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 Nov 4, 2024
@eme64 eme64 marked this pull request as ready for review November 4, 2024 13:23
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 4, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 4, 2024

Webrevs

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Great job extracting this test, Emanuel. Looks good to me!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 4, 2024
Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@eme64
Copy link
Contributor Author

eme64 commented Nov 5, 2024

Thanks @vnkozlov for the approval.
Thanks @TobiHartmann for the review and all the helpful suggestions along the way!

/integrate

@openjdk
Copy link

openjdk bot commented Nov 5, 2024

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

  • f3671be: 8335392: C2 MergeStores: enhanced pointer parsing
  • 4fc6d41: 8341194: [REDO] Implement C2 VectorizedHashCode on AArch64
  • abf2dc7: 8343298: Improve stability of runtime/cds/DeterministicDump.java test
  • dafa2e5: 8343124: Tests fails with java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainTask cannot access
  • 0f7dd98: 8251926: PPC: Remove an unused variable in assembler_ppc.cpp
  • cd91a44: 8343549: SeededSecureRandomTest needn't be in a package
  • 20f3aaf: 8343471: RISC-V: compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java fails after JDK-8334999
  • 67907d5: 8343500: Optimize ArrayClassDescImpl computeDescriptor
  • 714472d: 8341798: Fix ExceptionOccurred in jdk.jdwp.agent
  • 825ceb1: 8341796: Fix ExceptionOccurred in jdk.hotspot.agent
  • ... and 11 more: https://git.openjdk.org/jdk/compare/895a7b64f01dec7248549b127875edcf006457cf...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 5, 2024

@eme64 Pushed as commit f62fc48.

💡 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-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants