Integrated: 8240281: Remove failing assertion code when selecting first memory state in SuperWord::co_locate_pack
Christian Hagedorn
chagedorn at openjdk.java.net
Thu Feb 11 13:03:41 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
This pull request has now been integrated.
Changeset: 0a89987a
Author: Christian Hagedorn <chagedorn at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/0a89987a
Stats: 146 lines in 2 files changed: 134 ins; 5 del; 7 mod
8240281: Remove failing assertion code when selecting first memory state in SuperWord::co_locate_pack
Reviewed-by: roland, kvn, thartmann
-------------
PR: https://git.openjdk.java.net/jdk/pull/2495
More information about the hotspot-compiler-dev
mailing list