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

Nick Gasson ngasson at openjdk.java.net
Fri Oct 29 07:44:47 UTC 2021


> 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

Nick Gasson has updated the pull request incrementally with one additional commit since the last revision:

  Remove dead uses of is_concrete

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6131/files
  - new: https://git.openjdk.java.net/jdk/pull/6131/files/dfa783f1..d9875679

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6131&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6131&range=00-01

  Stats: 15 lines in 2 files changed: 0 ins; 10 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6131.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6131/head:pull/6131

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


More information about the hotspot-compiler-dev mailing list