RFR: 8276455: C2: iterative EA

Vladimir Kozlov kvn at openjdk.java.net
Mon Dec 13 18:39:37 UTC 2021


Resolve C2 issue with nested initialization when Escape Analysis can not scalarize allocations: `new A(new B( new C)))`
Implemented iterative EA when C2 invokes it again if there are progress and candidates.

I added JMH microbenchmark with cases which show improvements. Improvements are due to removed allocation code.

Before: 

Benchmark          Mode  Cnt     Score     Error  Units
IterativeEA.test1  avgt    5    11.489 ±   3.037  ns/op
IterativeEA.test2  avgt    5    16.103 ±   3.686  ns/op
IterativeEA.test3  avgt    5  1988.827 ± 217.831  ns/op

With these changes: 

IterativeEA.test1  avgt    5    2.182 ± 0.022  ns/op
IterativeEA.test2  avgt    5    2.375 ± 0.001  ns/op
IterativeEA.test3  avgt    5  821.011 ± 8.268  ns/op


An other JMH test:

PointerBenchmarkFlat.test      avgt   30  23.232 ± 6.507  ms/op

vs

PointerBenchmarkFlat.test      avgt   30  0.299 ±  0.001  ms/op

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

Commit messages:
 - Remove trailing spaces
 - Added IR framework test and new JMH test
 - Added JMH test
 - Merge branch 'master' into JDK-8276455
 - missed change
 - Merge branch 'master' into JDK-8276455
 - 8276455: C2: iterative EA

Changes: https://git.openjdk.java.net/jdk/pull/6222/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6222&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8276455
  Stats: 571 lines in 10 files changed: 541 ins; 14 del; 16 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6222.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6222/head:pull/6222

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


More information about the hotspot-compiler-dev mailing list