RFR: 8262465: Very long compilation times and high memory consumption in C2
Nils Eliasson
neliasso at openjdk.java.net
Mon Mar 22 14:01:55 UTC 2021
I tracked down the cause of the compilation times to a assert guarded block in reg_split.cpp.
The method that causes is 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.
-------------
Commit messages:
- Guard expensive assert with VerifyRegisterAllocation flag
Changes: https://git.openjdk.java.net/jdk/pull/3119/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3119&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8262465
Stats: 11 lines in 1 file changed: 2 ins; 0 del; 9 mod
Patch: https://git.openjdk.java.net/jdk/pull/3119.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3119/head:pull/3119
PR: https://git.openjdk.java.net/jdk/pull/3119
More information about the hotspot-compiler-dev
mailing list