RFR(S): 8252292: 8240795 may cause anti-dependence to be missed
Vladimir Kozlov
vladimir.kozlov at oracle.com
Wed Aug 26 17:10:42 UTC 2020
On 8/25/20 6:49 AM, Tobias Hartmann wrote:
> Hi Roland,
>
> Good catch, the fix looks reasonable to me.
+1
Thanks,
Vladimir K
>
> I think the test needs a @requires vm.gc == "Parallel" | vm.gc == "null" to not fail due to
> conflicting GC options if another GC is set.
>
> Best regards,
> Tobias
>
> On 25.08.20 10:23, Roland Westrelin wrote:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8252292
>> http://cr.openjdk.java.net/~roland/8252292/webrev.00/
>>
>> In 8240795, I modified alias analysis so non escaping allocations don't
>> alias with bottom memory. While browsing that code last week, I noticed
>> that that change didn't seem quite right and may cause some
>> anti-dependences to be missed. I could indeed write a test case that
>> fails with an incorrect execution.
>>
>> In the test case: the dst[9] load after the ArrayCopy is transformed
>> into a src[9] load before the ArrayCopy. Anti dependence analysis find
>> src[9] shares the memory of the ArrayCopy but because of the way I
>> tweaked the code with 8240795, anti-dependence analysis finds the src[9]
>> and ArrayCopy don't alias so src[9] can sink out of the loop which is
>> wrong because of the src[9] store. Anti-dependence analysis in that case
>> would need to look at the memory uses of ArrayCopy too.
>>
>> Roland.
>>
More information about the hotspot-compiler-dev
mailing list