RFR: 8262465: Very long compilation times and high memory consumption in C2 debug builds [v2]

Tobias Hartmann thartmann at openjdk.java.net
Tue Mar 23 06:50:44 UTC 2021


On Mon, 22 Mar 2021 16:49:58 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:

>> 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.
>
> Nils Eliasson has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Updated copyright year

Looks good to me.

-------------

Marked as reviewed by thartmann (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3119


More information about the hotspot-compiler-dev mailing list