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

8262465: Very long compilation times and high memory consumption in C2 debug builds #3119

Closed
wants to merge 2 commits into from

Conversation

@neliasso
Copy link
Contributor

@neliasso neliasso commented Mar 22, 2021

I tracked down the cause of the compilation times to a assert guarded block in reg_split.cpp.

The test method that causes this behaviour is a main method with an outer iteration loop, and inner loops that iterates over a value array. The inner loops is filled with about 40 calls to a verify() method but with different tests of rotate. Every call to verify is also accompanied by a string concatenation that expands with indy-string-concat.

The result IR has a huge number of live ranges and the index set are very large.

In reg_split there is some code that validate that any liveout isn't compressible to defidx. For all spills - all liveouts a searched for the def. But the lrgs are not compressed yet - so they will scan a chain of renames. To add insult to injury the indexset is huge. Fortunately this is only in debug builds.

I have posted some compile time numbers and IndexSet statistics in the bug.

I propose to guard the assert code with VerifyRegisterAllocation. This isn't optimal since we don't test with that flag regularly, but I think it might be an ok trade off. Bugs in split would still be caught - but later, and then VerifyRegisterAllocation can be turned on.


Progress

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

Issue

  • JDK-8262465: Very long compilation times and high memory consumption in C2 debug builds

Reviewers

Download

To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3119/head:pull/3119
$ git checkout pull/3119

To update a local copy of the PR:
$ git checkout pull/3119
$ git pull https://git.openjdk.java.net/jdk pull/3119/head

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 22, 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 openjdk bot commented Mar 22, 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.

@neliasso neliasso marked this pull request as ready for review Mar 22, 2021
@openjdk openjdk bot added the rfr label Mar 22, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 22, 2021

Webrevs

@neliasso neliasso changed the title 8262465: Very long compilation times and high memory consumption in C2 8262465: Very long compilation times and high memory consumption in C2 debug builds Mar 22, 2021
Copy link
Contributor

@vnkozlov vnkozlov left a comment

Good.
Update file's Copyright year.

@openjdk
Copy link

@openjdk openjdk bot commented Mar 22, 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:

8262465: Very long compilation times and high memory consumption in C2 debug builds

Reviewed-by: kvn, thartmann

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

  • 036ae0e: 8225438: javax/net/ssl/TLSCommon/TestSessionLocalPrincipal.java failed with Read timed out
  • 5a51d70: 8247895: SHA1PRNGReseed.java is calling setSeed(0)
  • b2a52ea: 8263342: Add --connect option to jhsdb hsdb/clhsdb
  • 6b4c654: 8263776: [JVMCI] add helper to perform Java upcalls
  • b23228d: 8263914: CDS fails to find the default shared archive on x86_32
  • a5e7a89: 8263904: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails on x86_32
  • f62b100: 8263895: Test nsk/jvmti/GetThreadGroupChildren/getthrdgrpchld001/getthrdgrpchld001.cpp uses incorrect indices
  • f84b52b: 8263897: compiler/c2/aarch64/TestVolatilesSerial.java failed with "java.lang.RuntimeException: Wrong method"
  • f08bf4b: 8263891: Changes for 8076985 missed the fix.
  • b2df513: 8261785: Calling "main" method in anonymous nested class crashes the JVM
  • ... and 66 more: https://git.openjdk.java.net/jdk/compare/7674da437975d261894a9f471bbb737e0b630f82...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 label Mar 22, 2021
@neliasso
Copy link
Contributor Author

@neliasso neliasso commented Mar 22, 2021

Good.
Update file's Copyright year.

Thank you Vladimir!

File updated.

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Looks good to me.

@neliasso
Copy link
Contributor Author

@neliasso neliasso commented Mar 23, 2021

/integrate

@openjdk openjdk bot closed this Mar 23, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Mar 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 23, 2021

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

  • 0b03d04: 8167015: compiler/codecache/jmx/PoolsIndependenceTest.java timeout
  • df01b15: 8263977: GTK L&F: Cleanup duplicate checks in GTKStyle and GTKLookAndFeel
  • 57d8f1d: 8263985: BCEscapeAnalyzer::invoke checks target->is_loaded() twice
  • 4ef7c67: 8263979: Cleanup duplicate check in Unicode.contains
  • 289d48a: 8261673: Move javadoc for the lookup mechanism to module-info
  • 7b6efd3: 8263904: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails on x86_32
  • 036ae0e: 8225438: javax/net/ssl/TLSCommon/TestSessionLocalPrincipal.java failed with Read timed out
  • 5a51d70: 8247895: SHA1PRNGReseed.java is calling setSeed(0)
  • b2a52ea: 8263342: Add --connect option to jhsdb hsdb/clhsdb
  • 6b4c654: 8263776: [JVMCI] add helper to perform Java upcalls
  • ... and 72 more: https://git.openjdk.java.net/jdk/compare/7674da437975d261894a9f471bbb737e0b630f82...master

Your commit was automatically rebased without conflicts.

Pushed as commit 2da882c.

💡 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
3 participants