RFR: 8240281: Remove failing assertion code when selecting first memory state in SuperWord::co_locate_pack
Roland Westrelin
roland at openjdk.java.net
Wed Feb 10 09:40:38 UTC 2021
On Wed, 10 Feb 2021 08:49:10 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> While working on [JDK-8238438](https://bugs.openjdk.java.net/browse/JDK-8238438), it was not clear if there is a case where `SuperWord::co_locate_pack()` should pick the memory state of the first load of a pack. We could not find an example and therefore added an `assert(false)` and left the code there to clean it up at some point if the assert was never hit.
>
> Now, a newly found fuzzer test showed that are cases where we need to pick the first memory state, triggering the `assert(false)`. In the test case `test()`, a store and a load pack are created but the store pack is filtered in `SuperWord::filter_packs()`. The load `x += iArrFld[j]` must read the old value before the store `iArrFld[j] = j` overrides it. Therefore, the load vector must be executed before any of the stores to `iArrFld[j]`. This, however, is not the case if we pick the memory state of the last load which results in wrong values for `iArrFld`: The stores and the loads are dependent and some of the stores are already executed before the load vector.
>
> The fix is to remove the assertion code added by JDK-8238438 and keep the code for selecting the first memory state of a load pack.
>
> Thanks,
> Christian
Looks good to me.
-------------
Marked as reviewed by roland (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2495
More information about the hotspot-compiler-dev
mailing list