RFR: 8360701: Add bailout when the register allocator interference graph grows unreasonably large [v2]

Daniel Lundén dlunden at openjdk.org
Mon Jul 14 15:14:23 UTC 2025


On Mon, 14 Jul 2025 09:19:20 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

> Thank you for working on this @dlunde! Overall, this change looks good to me. I only have one nit and a question.

Thanks for the review @mhaessig!

> You benchmarked compilation time, but can you elaborate more, why this won't cause regressions in the execution time?

I did run standard benchmarks as well! See the below from the PR description (I should have made it more explicit).

> For example, in standard benchmarks such as DaCapo (see the scatter matrix above), Renaissance, SPECjvm, and SPECjbb, we never go over 1 000 000 edges (I verified this).

That is, the _maximum_ IFG edge count among all compilations in this (hopefully) diverse and representative set of benchmarks is just below 1 000 000 edges. The limit is 10 times that. Stated alternatively, we never bail out in practice with this new limit. So, combined with the fact that compilation time is unaffected, the total execution time is unaffected.

> For instance, what is the difference in execution time of the tests that now hit the limit vs. before your change?

Good question! I checked this now on all Oracle-supported platforms and there is no clear difference in total execution time for the three tests I mentioned in the PR description. I ran them all without any additional flags.

> src/hotspot/share/opto/c2_globals.hpp line 269:
> 
>> 267:                                                                             \
>> 268:   product(uint, IFGEdgesLimit, 10000000, DIAGNOSTIC,                        \
>> 269:           "Maximum allowed edges in interference graphs")                   \
> 
> Suggestion:
> 
>           "Maximum allowed edges in the interference graphs")               \
> 
> Nit: usually, the flag descriptions use "the"

Sure, added!

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

PR Comment: https://git.openjdk.org/jdk/pull/26118#issuecomment-3069963462
PR Review Comment: https://git.openjdk.org/jdk/pull/26118#discussion_r2205183222


More information about the hotspot-compiler-dev mailing list