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

8253734: C2: Optimize Move nodes #826

Closed
wants to merge 2 commits into from

Conversation

iwanowww
Copy link
Contributor

@iwanowww iwanowww commented Oct 23, 2020

Introduce the following transformations for Move nodes:

  1. MoveI2F (MoveF2I x) => x

  2. MoveI2F (LoadI mem) => LoadF mem

  3. StoreI mem (MoveF2I x) => StoreF mem x

(The same applies to MoveL2D/MoveD2L.)

№1 eliminates redundant operations and №2/№3 avoid reg-to-reg moves in generated code:

0x000000010d09964c:   vmovss 0x20(%rsi),%xmm1
0x000000010d099651:   vmovd  %xmm1,%eax                   ;*invokestatic floatToRawIntBits

vs

0x0000000110c5a6cc:   mov    0x20(%rsi),%eax              ;*invokestatic floatToRawIntBits

(№2 and №3 are performed late (after loop opts are over) to avoid high-level optimizations passes to handle newly introduced mismatched accesses.)

Testing: tier1-5.


Progress

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

Testing

Linux x32 Linux x64 Windows x64 macOS x64
Build ✔️ (1/1 passed) ✔️ (5/5 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ❌ (1/9 failed) ✔️ (9/9 passed)

Failed test task

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/826/head:pull/826
$ git checkout pull/826

@iwanowww iwanowww marked this pull request as draft October 23, 2020 08:27
@iwanowww
Copy link
Contributor Author

/label add hotspot-compiler

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 23, 2020

👋 Welcome back vlivanov! 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 openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Oct 23, 2020
@openjdk
Copy link

openjdk bot commented Oct 23, 2020

@iwanowww
The hotspot-compiler label was successfully added.

@iwanowww iwanowww marked this pull request as ready for review October 23, 2020 08:33
@iwanowww iwanowww marked this pull request as draft October 23, 2020 08:34
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 23, 2020
@iwanowww iwanowww changed the title 8253734: Optimize Move nodes 8253734: C2: Optimize Move nodes Oct 23, 2020
@iwanowww iwanowww marked this pull request as ready for review October 23, 2020 08:34
@mlbridge
Copy link

mlbridge bot commented Oct 23, 2020

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.

Maybe add some comments with examples to the reinterpret methods.

public:
MoveL2DNode( Node *value ) : Node(0,value) {}
MoveL2DNode(Node* value) : MoveNode(value) {
init_class_id(Class_Move);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't init_class_id be moved to the MoveNode constructor?

public:
virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
virtual Node* Identity(PhaseGVN* phase);
// virtual const Type* Value(PhaseGVN* phase) const;
Copy link
Member

Choose a reason for hiding this comment

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

Can be removed.

@iwanowww
Copy link
Contributor Author

Thanks for the quick feedback, Tobias!

Please, take a look at the updated version.

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.

Looks good to me. Thanks for making these changes!

@openjdk
Copy link

openjdk bot commented Oct 23, 2020

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

8253734: C2: Optimize Move nodes

Reviewed-by: thartmann, neliasso, 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 53 new commits pushed to 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 added the ready Pull request is ready to be integrated label Oct 23, 2020
Copy link

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

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

Proposed optimization looks fine. In what cases you see the issues?

@mlbridge
Copy link

mlbridge bot commented Oct 23, 2020

Mailing list message from Vladimir Ivanov on hotspot-compiler-dev:

Thanks for the reviews, Vladimir and Tobias.

Proposed optimization looks fine. In what cases you see the issues?

It was motivated by some microbenchmarks targeting Memory Access API:

https://mail.openjdk.java.net/pipermail/panama-dev/2020-September/010873.html

Best regards,
Vladimir Ivanov

@mlbridge
Copy link

mlbridge bot commented Oct 23, 2020

Mailing list message from Vladimir Kozlov on hotspot-compiler-dev:

On 10/23/20 11:17 AM, Vladimir Ivanov wrote:

Thanks for the reviews, Vladimir and Tobias.

Proposed optimization looks fine. In what cases you see the issues?

It was motivated by some microbenchmarks targeting Memory Access API:

https://mail.openjdk.java.net/pipermail/panama-dev/2020-September/010873.html

Okay.

Thanks,
Vladimir K

Best regards,
Vladimir Ivanov

@iwanowww
Copy link
Contributor Author

/integrate

@iwanowww
Copy link
Contributor Author

Thanks for the reviews, Vladimir, Tobias, and Nils.

@openjdk openjdk bot closed this Oct 26, 2020
@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 Oct 26, 2020
@openjdk
Copy link

openjdk bot commented Oct 26, 2020

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

  • 6666dcb: 8237363: Remove automatic is in heap verification in OopIterateClosure
  • fa64477: 8255301: Common and strengthen the code in ciMemberName and ciMethodHandle
  • 9b5a2a6: 8255349: Vector API issues on Big Endian
  • e8b75b1: 8255393: sun/security/util/DerValue/Indefinite.java fails with ---illegal-access=deny
  • 7cafe35: 8255352: Archive important test outputs in submit workflow
  • 888086f: 8255373: Submit workflow artifact name is always "test-results_.zip"
  • 6918818: 8255265: IdealLoopTree::iteration_split_impl does not use should_align
  • c28b011: 8255343: java/util/stream/SpliteratorTest.java fails on 32-bit platforms with "Misaligned access at address: 12"
  • b71b5b4: 8199062: Test javax/swing/text/Utilities/8134721/bug8134721.java is unstable
  • ee34fa5: 8199060: Test javax/swing/text/html/parser/Parser/6990651/bug6990651.java is unstable
  • ... and 59 more: https://git.openjdk.java.net/jdk/compare/7e2640432bf4fb5115c2ff694c09937234e6d1c5...master

Your commit was automatically rebased without conflicts.

Pushed as commit 83a91bf.

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

4 participants