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

8328181: C2: assert(MaxVectorSize >= 32) failed: vector length should be >= 32 #18464

Closed
wants to merge 4 commits into from

Conversation

jatin-bhateja
Copy link
Member

@jatin-bhateja jatin-bhateja commented Mar 24, 2024

This bug fix patch tightens the predication check for small constant length clear array pattern and relaxes associated feature checks. Modified few comments for clarity.

Kindly review and approve.

Best Regards,
Jatin


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-8328181: C2: assert(MaxVectorSize >= 32) failed: vector length should be >= 32 (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18464

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 24, 2024

👋 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.

@openjdk
Copy link

openjdk bot commented Mar 24, 2024

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

8328181: C2: assert(MaxVectorSize >= 32) failed: vector length should be >= 32

Reviewed-by: kvn, 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 182 new commits pushed to the master branch:

  • e702646: 8200566: DistributionPointFetcher fails to fetch CRLs if the DistributionPoints field contains more than one DistributionPoint and the first one fails
  • 7e5ef79: 8323116: [REDO] Computational test more than 2x slower when AVX instructions are used
  • 9467720: 8329875: Serial: Move preservedMarks.inline.hpp to serialFullGC.cpp
  • a4dd2e9: 8329766: Serial: Refactor SerialBlockOffsetTable API
  • 212a253: 8329623: NegativeArraySizeException encoding large String to UTF-8
  • dd930c5: 8329787: Fix typo in CLDRConverter
  • 115f419: 8329659: Serial: Extract allowed_dead_ratio from ContiguousSpace
  • 9ac3b77: 8329775: Serial: Remove unused declarations in serialFullGC.hpp
  • 7475824: 8329510: Update ProblemList for JFileChooser/8194044/FileSystemRootTest.java
  • 6439375: 8329533: TestCDSVMCrash fails on libgraal
  • ... and 172 more: https://git.openjdk.org/jdk/compare/bc73963974a824d77d54b8b0edbf8f05262b721c...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 rfr Pull request is ready for review label Mar 24, 2024
@openjdk
Copy link

openjdk bot commented Mar 24, 2024

@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 openjdk bot added the hotspot hotspot-dev@openjdk.org label Mar 24, 2024
@jatin-bhateja
Copy link
Member Author

/label add hotspot-compiler-dev

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Mar 24, 2024
@openjdk
Copy link

openjdk bot commented Mar 24, 2024

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

@mlbridge
Copy link

mlbridge bot commented Mar 24, 2024

Webrevs

Comment on lines 1754 to 1755
if ((size_in_bits != 512) && !VM_Version::supports_avx512vl()) {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add comment to clarify condition. I am reading it as ClearArray will not be supported for NOT avx512 because we can have vector length 512 bits for not avx512.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is only pertinent to known sized clear arrays which are optimized for AVX-512 targets, we already have such a check as part of matcher predicate, so removing it.

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.

This looks good. You need second review.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 8, 2024
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.

@jatin-bhateja
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Apr 9, 2024

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

  • a887fd2: 8316991: Reduce nullable allocation merges
  • e702646: 8200566: DistributionPointFetcher fails to fetch CRLs if the DistributionPoints field contains more than one DistributionPoint and the first one fails
  • 7e5ef79: 8323116: [REDO] Computational test more than 2x slower when AVX instructions are used
  • 9467720: 8329875: Serial: Move preservedMarks.inline.hpp to serialFullGC.cpp
  • a4dd2e9: 8329766: Serial: Refactor SerialBlockOffsetTable API
  • 212a253: 8329623: NegativeArraySizeException encoding large String to UTF-8
  • dd930c5: 8329787: Fix typo in CLDRConverter
  • 115f419: 8329659: Serial: Extract allowed_dead_ratio from ContiguousSpace
  • 9ac3b77: 8329775: Serial: Remove unused declarations in serialFullGC.hpp
  • 7475824: 8329510: Update ProblemList for JFileChooser/8194044/FileSystemRootTest.java
  • ... and 173 more: https://git.openjdk.org/jdk/compare/bc73963974a824d77d54b8b0edbf8f05262b721c...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 9, 2024

@jatin-bhateja Pushed as commit fbc1e66.

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

@TobiHartmann
Copy link
Member

This introduced a performance regression, see JDK-8332487. @jatin-bhateja, could you please have a look? Thanks.

@@ -1750,7 +1750,6 @@ bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType bt) {
return false;
}
break;
case Op_ClearArray:
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems problematic, and may lead to the regression in https://bugs.openjdk.org/browse/JDK-8332487

On non-AVX512 platforms, this is now always true instead of always false. Probably this was not intended, and you thought this way going to be default false?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what you are implying. Are you saying this is not the reason for the regression?

Copy link
Member Author

@jatin-bhateja jatin-bhateja May 28, 2024

Choose a reason for hiding this comment

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

Yes, this can cause regression since now on non-AVX512 targets compiler may not emit StoreL based instruction sequence and select one of the clear array pattern based on target feature checks, but on the hind side may bloat the JIT code size for know size clear array operations if InitArrayShortSize is set to a larger value.

@jatin-bhateja jatin-bhateja deleted the JDK-8328181 branch August 1, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants