RFR: JDK-8075816: AliasLevel is broken and should be deprecated [v2]
Tobias Holenstein
duke at openjdk.java.net
Tue Apr 12 09:31:39 UTC 2022
On Mon, 11 Apr 2022 16:10:38 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Obsolete AliasLevel flag
>
> src/hotspot/share/opto/compile.cpp line 1051:
>
>> 1049: aliaslevel = 2; // No unique types without escape analysis
>> 1050: }
>> 1051: _AliasLevel = aliaslevel;
>
> Please, test with EA switched off `-XX:-DoEscapeAnalysis`
> There are tests which switch it off. Also it is off in tier7 and tier8 for compiler tests. So I am puzzled that bug say that it crash with `aliasLevel=2`.
> Also update subject of PR to match new bug's subject.
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?
-------------
PR: https://git.openjdk.java.net/jdk/pull/8140
More information about the hotspot-dev
mailing list