RFR: 8275847: Scheduling fails with "too many D-U pinch points" on small method

Tobias Hartmann thartmann at openjdk.java.net
Thu Oct 28 08:24:13 UTC 2021


On Wed, 27 Oct 2021 06:25:22 GMT, Nick Gasson <ngasson at openjdk.org> wrote:

> Since around JDK 16 the following method cannot be compiled by C2 on AArch64:
> 
> 
>   public double mergeSync() { return Math.log(Math.sin(value)); }
> 
> 
> (Reduced from a slightly larger benchmark.)
> 
> 
>   811 416 ! 3 Test::mergeSync (61 bytes)
>   813 417 ! 4 Test::mergeSync (61 bytes)
>   816 417 ! 4 Test::mergeSync (61 bytes) COMPILE SKIPPED: too many D-U pinch points (retry at different tier)
>   816 418 ! 1 Test::mergeSync (61 bytes)
> 
> 
> Scheduling::anti_do_def() will create temporary Nodes for each OptoReg killed by the MachProjs from the two runtime leaf calls.  After SVE support was added these runtime calls kill more registers, and the number of new Nodes added by anti_do_def exceeds an internal limit (which is based on the LRG map size and roughly proportional to the method size).
> 
> X86 has the same problem if OptoScheduling is enabled because of the wide AVX registers.
> 
> The fix here is to ignore OptoRegs which correspond to the high slots of wide vectors (i.e. slots above 64 bits).  The scheduler doesn't run on methods where C->max_vector_size() > 8, so we know these kills can't affect the scheduling result.
> 
> The added test fails on the current JDK with:
> 
> 
>   compiler.lib.ir_framework.shared.TestRunException: Could not compile public double
>   compiler.c2.irTests.TestScheduleSmallMethod.testSmallMethodTwoRuntimeCalls(double) at level C2
>   after 10s. Last compilation level: 3

While looking at the usages of `is_concrete`, I found that all current usages outside of asserts are dead:

https://github.com/openjdk/jdk/blob/1750a6e2c06960b734f646018fc99b336bd966a5/src/hotspot/share/opto/buildOopMap.cpp#L234

https://github.com/openjdk/jdk/blob/1750a6e2c06960b734f646018fc99b336bd966a5/src/hotspot/share/opto/buildOopMap.cpp#L315

https://github.com/openjdk/jdk/blob/1750a6e2c06960b734f646018fc99b336bd966a5/src/hotspot/share/opto/buildOopMap.cpp#L320

https://github.com/openjdk/jdk/blob/1750a6e2c06960b734f646018fc99b336bd966a5/src/hotspot/share/opto/buildOopMap.cpp#L350

I think we should clean that up.

src/hotspot/cpu/x86/vmreg_x86.hpp line 93:

> 91:   if (is_Register()) return true;
> 92: #endif // AMD64
> 93:   // Do not use is_XMMRegister() here as it depends on the UseAVX settting.

Typo `settting` -> `setting`

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

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


More information about the hotspot-compiler-dev mailing list