RFR: 8223923: C2: Missing interference with mismatched unsafe accesses

Vladimir Ivanov vlivanov at openjdk.java.net
Fri Aug 20 12:44:27 UTC 2021


On Tue, 17 Aug 2021 15:38:48 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> Memory effects of mixed or mismatched unsafe accesses aren't properly tracked, so every problematic access is wrapped into a pair of `MemBarCPUOrder` nodes to isolate it from the rest of the memory graph. But `MemNode::can_see_stored_value()` unconditionally steps over `MemBarCPUOrder` and exposes problematic `MergeMem` nodes.  
> 
> Proposed fix forbids stepping over `MemBarCPUOrder` nodes when looking for an earlier store into the same location.
> 
> Alternatively, a new kind of barrier could be introduced specifically for isolation purposes, but I didn't spot any issues during performance testing with the current patch to justify more complex solution. 
> 
> Testing: hs-tier1 - hs-tier6, performance testing.

Thanks for the review, Tobias.

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

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


More information about the hotspot-compiler-dev mailing list