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

8345609: [C1] LIR Operations with one input should be implemented as LIR_Op1 #22582

Closed

Conversation

TheRealMDoerr
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr commented Dec 5, 2024

Change lir_sqrt, lir_abs, lir_neg, lir_f2hf, lir_hf2f to use LIR_Op1. Extend LIR_Op1 to support one temp register operand. Also see JBS issue.

Remove lir_tan and lir_log10 which are unused (dead and incomplete code). They should have been removed with or after ad79a5a and the corresponding changes on other platforms.

The removal of the unnecessary float constant loads improves performance:
make run-test TEST="micro:Fp16ConversionBenchmark" MICRO="VM_OPTIONS=-XX:TieredStopAtLevel=1"

Power 10 without patch:

Benchmark                                     (size)   Mode  Cnt      Score    Error   Units
Fp16ConversionBenchmark.floatToFloat16          2048  thrpt   15    247.064 ±  0.189  ops/ms

Power 10 with patch:

Benchmark                                     (size)   Mode  Cnt      Score    Error   Units
Fp16ConversionBenchmark.floatToFloat16          2048  thrpt   15    308.372 ±  0.432  ops/ms

x64 machine without patch:

Benchmark                                     (size)   Mode  Cnt      Score    Error   Units
Fp16ConversionBenchmark.floatToFloat16          2048  thrpt   15     384.565 ±    3.758  ops/ms

x64 machine with patch:

Benchmark                                     (size)   Mode  Cnt      Score    Error   Units
Fp16ConversionBenchmark.floatToFloat16          2048  thrpt   15     406.121 ±    3.228  ops/ms

Testing: tier1-4 on x64 (Windows, linux, MacOS), aarch64 (linux, MacOS), ppc64 (linux, AIX)


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-8345609: [C1] LIR Operations with one input should be implemented as LIR_Op1 (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22582

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 5, 2024

👋 Welcome back mdoerr! 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 Dec 5, 2024

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

8345609: [C1] LIR Operations with one input should be implemented as LIR_Op1

Reviewed-by: rrich, goetz

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

  • 2382a2d: 8345661: Simplify page size alignment in code heap reservation
  • 076bfa6: 8345656: Move os alignment functions out of ReservedSpace
  • 2826838: 8345658: WB_NMTCommitMemory redundantly records an NMT tag
  • c9ec271: 8345800: Update copyright year to 2024 for serviceability in files where it was missed
  • 8e0f929: 8345805: Update copyright year to 2024 for other files where it was missed
  • f88c1c6: 8345773: Class-File API debug printing capability
  • e88e793: 8343148: C2: Refactor uses of "PhaseValue::con() + PhaseIdealLoop::set_ctrl()" into separate method
  • 1e9204f: 8345273: Fix -Wzero-as-null-pointer-constant warnings in s390 code
  • c40140e: 8334581: Remove no-arg constructor BasicSliderUI()
  • 8de0622: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04
  • ... and 72 more: https://git.openjdk.org/jdk/compare/b42d79eb6a6d497dc63718c2854609bebca4498c...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 Dec 5, 2024
@openjdk
Copy link

openjdk bot commented Dec 5, 2024

@TheRealMDoerr 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 Dec 5, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 5, 2024

Webrevs

@@ -483,6 +489,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) {

assert(op1->_info != nullptr, ""); do_info(op1->_info);
if (op1->_opr->is_valid()) do_temp(op1->_opr); // safepoints on SPARC need temporary register
assert(op1->_tmp->is_illegal(), "not used");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think safepoints should ideally be implemented as LIR_Op0. SPARC support is removed. We could file a new RFE for that.

Copy link
Member

Choose a reason for hiding this comment

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

Well, a grep showed there are more leftovers of sparc and solaris in hotspot, but not a matter of this change.

Copy link
Member

@reinrich reinrich left a comment

Choose a reason for hiding this comment

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

Nice cleanup 👍
A few files need copyright update // especially c1_LinearScan_x86.hpp ;)
Cheers, Richard.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 5, 2024
@TheRealMDoerr
Copy link
Contributor Author

Thanks for the review! Copyright headers are updated.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 5, 2024
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 5, 2024
@reinrich
Copy link
Member

reinrich commented Dec 6, 2024

You might even see an effect in the Fp16ConversionBenchmark if you stop compilation at tier 1.

@TheRealMDoerr
Copy link
Contributor Author

You might even see an effect in the Fp16ConversionBenchmark if you stop compilation at tier 1.

Yes. Added benchmark results to the description.

Copy link
Member

@GoeLin GoeLin left a comment

Choose a reason for hiding this comment

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

LGTM

@TheRealMDoerr
Copy link
Contributor Author

Thanks for the review!
/integrate

@openjdk
Copy link

openjdk bot commented Dec 11, 2024

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

  • 2382a2d: 8345661: Simplify page size alignment in code heap reservation
  • 076bfa6: 8345656: Move os alignment functions out of ReservedSpace
  • 2826838: 8345658: WB_NMTCommitMemory redundantly records an NMT tag
  • c9ec271: 8345800: Update copyright year to 2024 for serviceability in files where it was missed
  • 8e0f929: 8345805: Update copyright year to 2024 for other files where it was missed
  • f88c1c6: 8345773: Class-File API debug printing capability
  • e88e793: 8343148: C2: Refactor uses of "PhaseValue::con() + PhaseIdealLoop::set_ctrl()" into separate method
  • 1e9204f: 8345273: Fix -Wzero-as-null-pointer-constant warnings in s390 code
  • c40140e: 8334581: Remove no-arg constructor BasicSliderUI()
  • 8de0622: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04
  • ... and 72 more: https://git.openjdk.org/jdk/compare/b42d79eb6a6d497dc63718c2854609bebca4498c...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 11, 2024

@TheRealMDoerr Pushed as commit a21d21f.

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

@TheRealMDoerr TheRealMDoerr deleted the 8345609_C1_LIR_Op1 branch December 11, 2024 12:58
@dholmes-ora
Copy link
Member

dholmes-ora commented Dec 11, 2024

We have a large number of failures in our tier 2 (so far) CI after this was integrated, all with issues in the JIT.

There is a crash in LIR_Assembler::negate

# assert(regs[i] != regs[j]) failed: regs[0] and regs[1] are both: xmm2

There are FP failures of different kinds

assertEquals expected: 1.401298464324817E-45 but was: 1.727233711018889E-77

RuntimeException: pow(+Infinity, 0.5), expected: Infinity, actual: Infinity

Sorry but this change will be backed out.

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