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

8331764: C2 SuperWord: refactor _align_to_ref/_mem_ref_for_main_loop_alignment #19115

Closed

Conversation

eme64
Copy link
Contributor

@eme64 eme64 commented May 7, 2024

This PR accomplishes these things:

  • Rename _align_to_ref -> _mem_ref_for_main_loop_alignment.
  • Move the mem_ref finding for alignment out of SuperWord::find_adjacent_refs. This is too early, and we don't even know if the relevant mem_ref is going to be vectorized. It makes more sense to pick a mem_ref directly in SuperWord::adjust_pre_loop_limit_to_align_main_loop_vectors, where we already know what packs are going to be vectorized.
  • For the alignment width (aw), we can use the vector_width of the pack to which the mem_ref belongs, rather than the potentially much larger vector_width_in_bytes. I track this with _aw_for_main_loop_alignment now.

I need this for #18822, and decided to split it out into an independent change.


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-8331764: C2 SuperWord: refactor _align_to_ref/_mem_ref_for_main_loop_alignment (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19115

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 7, 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 May 7, 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:

8331764: C2 SuperWord: refactor _align_to_ref/_mem_ref_for_main_loop_alignment

Reviewed-by: kvn, chagedorn

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

  • d654124: 8331932: Startup regressions in 23-b13
  • 7db6a3f: 8331905: Fix direct includes of g1_globals.hpp
  • f47fc86: 8331908: Simplify log code in vectorintrinsics.cpp
  • b9a142a: 8226990: GTK & Nimbus LAF: Tabbed pane's background color is not expected one when change the opaque checkbox.
  • d2d37c9: 8331942: On Linux aarch64, CDS archives should be using 64K alignment by default
  • a706ca4: 8329418: Replace pointers to tables with offsets in relocation bitmap
  • a643d6c: 8331862: Remove split relocation info implementation
  • d47a4e9: 8332008: Enable issuestitle check
  • 0bf7282: 8331231: containers/docker/TestContainerInfo.java fails
  • ffbdfff: 8331999: BasicDirectoryModel/LoaderThreadCount.java frequently fails on Windows in CI
  • ... and 193 more: https://git.openjdk.org/jdk/compare/ea3909acd117cab97c6c0b496f98f9a4a3a22be4...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 changed the title 8331764 8331764: C2 SuperWord: refactor _align_to_ref/_mem_ref_for_main_loop_alignment May 7, 2024
@openjdk
Copy link

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

mlbridge bot commented May 7, 2024

Webrevs

MemNode* first = pack->at(0)->isa_Mem();
if (first == nullptr) { continue; }

int vw = first->memory_size() * pack->size();
Copy link
Contributor

@vnkozlov vnkozlov May 7, 2024

Choose a reason for hiding this comment

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

I assume first is verified already and first->memory_size() is reasonable (size of primitive type).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is. All of this code is run in SuperWord::output, and at this point we are committed to vectorization - everything is verified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is what I tried to say in the PR description:

It makes more sense to pick a mem_ref directly in SuperWord::adjust_pre_loop_limit_to_align_main_loop_vectors, where we already know what packs are going to be vectorized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, first->memory_size() knows the size in bytes of the load/store. It is used many places in SuperWord.

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.

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

@eme64
Copy link
Contributor Author

eme64 commented May 13, 2024

Thanks @vnkozlov @chhagedorn for the reviews!
/integrate

@openjdk
Copy link

openjdk bot commented May 13, 2024

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

  • 5053b70: 8278255: Add more warning text in ReentrantLock and ReentrantReadWriteLock
  • 32c7681: 8332029: Provide access to initial value of stderr via JavaLangAccess
  • f9a1d33: 8332020: jwebserver tool prints invalid URL in case of IPv6 address binding
  • b87a7e9: 8144100: Incorrect case-sensitive equality in com.sun.net.httpserver.BasicAuthenticator
  • 1dac34f: 8331098: [Aarch64] Fix crash in Arrays.equals() intrinsic with -CCP
  • 5e8e8ef: 8315431: ArchiveHeapWriter::get_filler_size_at() cannot handle buffer expansion
  • 1b476f5: 8293345: SunPKCS11 provider checks on PKCS11 Mechanism are problematic
  • 1c5f150: 8331734: Atomic MemorySegment VarHandle operations fails for element layouts
  • 65abf24: 8331866: Add warnings for locale data dependence
  • d215bc4: 8332066: AArch64: Math test failures since JDK-8331558
  • ... and 213 more: https://git.openjdk.org/jdk/compare/ea3909acd117cab97c6c0b496f98f9a4a3a22be4...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 13, 2024

@eme64 Pushed as commit d517d2d.

💡 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