RFR: 8316594: C2 SuperWord: wrong result with hand unrolled loops [v3]
Emanuel Peter
epeter at openjdk.org
Wed Oct 4 16:48:19 UTC 2023
On Wed, 4 Oct 2023 13:07:18 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Please read description in https://github.com/openjdk/jdk/pull/15864.
>>
>> Currently, we only compare the first element of the load-pack with the StoreVector. This is not correct, we need to compare all elements of the load-pack with the StoreVector. Otherwise it may be that the first element lays below/before the memory region of the StoreVector (Less), but the last element of the load-pack for example could have overlap with the StoreVector (Equal).
>>
>> Tier1-6 + stress-testing.
>> Performance testing.
>
> Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision:
>
> - rm whitespaces
> - patched test
I had to add an `avx2` requirement to the test, because of `test3`. The unaligned example crashed otherwise, see `Test21.java` [here](https://bugs.openjdk.org/browse/JDK-8310190?focusedCommentId=14615859&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14615859).
It creates this assert, because the unsafe int memory access is at offset 6, which is not aligned. And somehow, on `-XX:UseAVX=0 -XX:UseSSE=3` we require alignment.
`assert((ABS(iv_adjustment_in_bytes) % elt_size) == 0 || !vectors_should_be_aligned()) failed: (6) should be divisible by (4)`
Once I fix the alignment bug [JDK-8310190](https://bugs.openjdk.org/browse/JDK-8310190), then I will remove that avx2 requirement.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15866#issuecomment-1747129337
More information about the hotspot-compiler-dev
mailing list