Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

8258272: LoadVectorMaskedNode can't be replaced by zero con #105

Closed
wants to merge 3 commits into from

Conversation

neliasso
Copy link

@neliasso neliasso commented Jan 11, 2021

A test fails for this code:

byte [] src = new byte[0];
byte [] dest = Arrays::copy_of(src);

This is transformed to something like:
byte [] src = new byte[0];
byte [] dest = new byte[0];
System.arraycopy(src, 0, dest, 0, src.lenght());

This causes a problem in LoadNode::Value for the new LoadVectorMasked nodes. LoadNode::Value sees that the load will always load a zero - and will try to replace itself with a zero constant. That doesn't work for the LoadVectorMaskedNodes currently.

This patch adds a check to the zero-optimization to pass on vector types.

This patch is currently missing a new test. Since we are nearing the end of bugfixing in JDK16 I decided to publish the fix first so that any discussion of the fix can be had now.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8258272: LoadVectorMaskedNode can't be replaced by zero con

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk16 pull/105/head:pull/105
$ git checkout pull/105

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 11, 2021

👋 Welcome back neliasso! 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 Jan 11, 2021

@neliasso 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.java.net label Jan 11, 2021
@neliasso neliasso marked this pull request as ready for review January 11, 2021 22:55
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 11, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 11, 2021

Webrevs

Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

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

That looks good to me!

@openjdk
Copy link

openjdk bot commented Jan 12, 2021

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

8258272: LoadVectorMaskedNode can't be replaced by zero con

Reviewed-by: chagedorn, vlivanov

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

  • 417e1d1: 8259061: C2: assert(found) failed: memory-writing node is not placed in its original loop or an ancestor of it
  • 793017d: 8259601: AArch64: Fix reinterpretX2D match rule issue
  • 15dd8f3: 8259275: JRuby crashes while resolving invokedynamic instruction
  • 1cf2378: 8259353: VectorReinterpretNode is incorrectly optimized out
  • 17b4db3: 8259636: Check for buffer backed by shared segment kicks in in unexpected places
  • 5f9cd72: 8259645: Revert JDK-8245956 JavaCompiler still uses File API instead of Path API in a specific case
  • b03880e: 8259634: MemorySegment::asByteBuffer does not respect spatial bounds
  • 8a81cf1: 8259298: broken link in Stream::toList spec
  • 67e1b63: 8259380: Correct pretouch chunk size to cap with actual page size
  • 28ff2de: 8259237: Demo selection changes with left/right arrow key. No need to press space for selection.
  • ... and 61 more: https://git.openjdk.java.net/jdk16/compare/61390d8e452058efe00ca8ce833baa879fbb9c9e...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 Jan 12, 2021
Copy link
Contributor

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

Copy link
Member

@chhagedorn chhagedorn 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!

Copy link
Contributor

@iwanowww iwanowww left a comment

Choose a reason for hiding this comment

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

Even better!

@neliasso
Copy link
Author

/integrate

@openjdk openjdk bot closed this Jan 13, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 13, 2021
@openjdk
Copy link

openjdk bot commented Jan 13, 2021

@neliasso Since your change was applied there have been 73 commits pushed to the master branch:

  • a99df45: 8259560: Zero m68k: "static assertion failed: align" after JDK-8252049
  • efc36be: 8258985: Parallel WeakProcessor may use too few threads
  • 417e1d1: 8259061: C2: assert(found) failed: memory-writing node is not placed in its original loop or an ancestor of it
  • 793017d: 8259601: AArch64: Fix reinterpretX2D match rule issue
  • 15dd8f3: 8259275: JRuby crashes while resolving invokedynamic instruction
  • 1cf2378: 8259353: VectorReinterpretNode is incorrectly optimized out
  • 17b4db3: 8259636: Check for buffer backed by shared segment kicks in in unexpected places
  • 5f9cd72: 8259645: Revert JDK-8245956 JavaCompiler still uses File API instead of Path API in a specific case
  • b03880e: 8259634: MemorySegment::asByteBuffer does not respect spatial bounds
  • 8a81cf1: 8259298: broken link in Stream::toList spec
  • ... and 63 more: https://git.openjdk.java.net/jdk16/compare/61390d8e452058efe00ca8ce833baa879fbb9c9e...master

Your commit was automatically rebased without conflicts.

Pushed as commit 5567530.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.java.net integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants