[External] : Re: RFC - Improving C2 Escape Analysis
Vladimir Kozlov
vladimir.kozlov at oracle.com
Wed Oct 27 17:26:53 UTC 2021
First. Thank you, Cesar, for collecting data about C2 EA shortcomings.
I agree with cases Tobias pointed as possible starting points to improve EA.
Yes, finding solution for allocation merges (or NULL) is a pain. I spent some time investigating possible solutions for
it but "no cigar". May be we do indead need control flow analysis to resolve this.
I looked through JBS and found few issues which are not required to write new EA:
https://bugs.openjdk.java.net/browse/JDK-7149991
https://bugs.openjdk.java.net/browse/JDK-8059378
https://bugs.openjdk.java.net/browse/JDK-8073358
https://bugs.openjdk.java.net/browse/JDK-8155769
Tobias also has fix prototype for next bug which was not fixed yet:
https://bugs.openjdk.java.net/browse/JDK-8236493
Ther are 2 test files with small methods for different EA cases I used to see how EA works:
test/hotspot/jtreg/compiler/escapeAnalysis/Test6726999.java
test/hotspot/jtreg/compiler/escapeAnalysis/Test6689060.java
You can start looking on above RFE/bug or run these tests and see why scalarization failed for some cases. Except for
known merge issue:
https://bugs.openjdk.java.net/browse/JDK-6853701
I am currently looking on iterative EA. Do more EA rounds if we can eliminate more connected allocations. It was
proposed by Vladimir Ivanov and I have working prototype.
There is also suggestin from Amazon Java group about "C2 Partial Escape Analysis" which needs more discsussion:
https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2021-May/047486.html
Thanks,
Vladimir K
On 10/27/21 3:04 AM, Tobias Hartmann wrote:
> Hi Cesar,
>
> On 27.10.21 08:20, Cesar Soares Lucas wrote:
>> Right. I was suspecting this to be the most critical issue indeed. However, I
>> didn't know there was a case where "... the object does not escape on any paths
>> but control flow is too complicated for EA to prove that." Is this an issue
>> tracked in JBS or perhaps you can show me an example where this happens?
>
> Sure, here are four examples of EA and/or scalarization failing due to complicated control/data
> flow: https://cr.openjdk.java.net/~thartmann/EA_examples
>
> All examples would completely fold with inline types (Valhalla).
>
> I'm not sure if these issues are tracked by JBS issues but there's most likely an overlap with some
> of the issues you already described.
>
> Best regards,
> Tobias
>
More information about the hotspot-dev
mailing list