RFR: JDK-8075816: AliasLevel is broken and should be deprecated [v2]

Tobias Hartmann thartmann at openjdk.java.net
Tue Apr 12 10:45:33 UTC 2022


On Tue, 12 Apr 2022 09:28:00 GMT, Tobias Holenstein <duke at openjdk.java.net> wrote:

>> 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?

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`.

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

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


More information about the hotspot-dev mailing list