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

Nils Eliasson neliasso at openjdk.java.net
Tue Mar 23 07:49:39 UTC 2021


On Mon, 22 Mar 2021 13:55:04 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.

This pull request has now been integrated.

Changeset: 2da882c0
Author:    Nils Eliasson <neliasso at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/2da882c0
Stats:     12 lines in 1 file changed: 2 ins; 0 del; 10 mod

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

Reviewed-by: kvn, thartmann

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

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


More information about the hotspot-compiler-dev mailing list