RFR: JDK-8075816: AliasLevel is broken and should be deprecated [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Tue Apr 12 16:32:43 UTC 2022
On Tue, 12 Apr 2022 10:42:32 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> You are right: the statement in the bug report that `AliasLevel<3` is broken is wrong. The VM crashes for `AliasLevel=0` and `AliasLevel=1` but not for `AliasLevel=2`. So with `-XX:-DoEscapeAnalysis` it is always automatically set to`AliasLevel=2`.
>> But when `-XX:+DoEscapeAnalysis -XX:+EliminateAllocations` there is ONE use-case for `AliasLevel` :
>> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/escape.cpp#L336-L341
>> - for `-XX:AliasLevel=3` `split_unique_types(alloc_worklist, arraycopy_worklist, mergemem_worklist);` is called
>> - for `-XX:AliasLevel=2` `split_unique_types(alloc_worklist, arraycopy_worklist, mergemem_worklist);` is NOT called
>>
>> So does the use case `-XX:+DoEscapeAnalysis -XX:+EliminateAllocations -XX:AliasLevel=2` make sense and is it something that is used?
>>
>> Since `AliasLevel` is not completely broken the question is if we should deprecated instead of making it obsolete?
>
> I don't think there is a real use case for `-XX:AliasLevel=2` given that one can get similar behavior with `-XX:-EliminateAllocations` (or `-XX:-DoEscapeAnalysis`). I would therefore vote for **deprecating** `AliasLevel`.
Yes, I agree with Tobias. Lets treat `-XX:AliasLevel=2` as `-XX:-EliminateAllocations`. There are tests which use this flags.
And yes, we should deprecate `AliasLevel` but correcting bug's and CSR's text with this new information about `-XX:AliasLevel=2`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8140
More information about the hotspot-dev
mailing list