RFR: 8275847: Scheduling fails with "too many D-U pinch points" on small method
Nick Gasson
ngasson at openjdk.java.net
Wed Oct 27 06:33:30 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
-------------
Commit messages:
- 8275847: Scheduling fails with "too many D-U pinch points" on small method
Changes: https://git.openjdk.java.net/jdk/pull/6131/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6131&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8275847
Stats: 75 lines in 3 files changed: 74 ins; 0 del; 1 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