RFR: 8272573: Redundant unique_concrete_method_4 dependencies [v2]

Vladimir Ivanov vlivanov at openjdk.java.net
Tue Aug 17 21:34:47 UTC 2021


On Tue, 17 Aug 2021 21:16:56 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> src/hotspot/share/code/dependencies.cpp line 242:
>> 
>>> 240:     }
>>> 241:   } else {
>>> 242:     if (note_dep_seen(dept, x0)) {
>> 
>> Why `x0` is special in all these cases?
>> Should we do `||` instead?
>> 
>>   if (note_dep_seen(dept, x0) || note_dep_seen(dept, x1)) {
>
> It's just a fast path approximate check which guards linear search over recorded dependencies. 
> `note_dep_seen(dept, x0) == false` says that such a dependency argument hasn't been seen before, but `note_dep_seen(dept, x0) == true` requires a search over recorded dependencies to prove the argument is in the right position.
> 
> Another way to fix it is to perform all the queries beforehand:
> 
> bool dep_seen_x0 = note_dep_seen(dept, x0);
> bool dep_seen_x1 = note_dep_seen(dept, x1);
> if (dep_seen_x0 && dep_seen_x1) {
>   ...
> }
> 
> It should dramatically reduce the rate of false positives.

Pushed the implementation which checks all the arguments. Let me know what you prefer.

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

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


More information about the hotspot-compiler-dev mailing list