RFR: 8300258: C2: vectorization fails on simple ByteBuffer loop [v2]
Vladimir Kozlov
kvn at openjdk.org
Thu Feb 23 20:20:25 UTC 2023
On Thu, 9 Feb 2023 17:06:37 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> I agree that we should have such a test if we don't have one already but does it belong to that bug? That bug changes the behavior with mismatched accesses so it feels strange to add an unrelated test.` testByteByte1() `is a mismatched access test that vectorizes and that's unaffected by my change. I could add another one that doesn't vectorize because of a dependency with a similar mismatched access. What do you think?
>
> Well, my idea was this:
> You added a new feature, where we now have a more fine-grained logic. Before, we distinguished by "velt type". Now we distinguish by "memory slice".
> Before, this change, my `arr1` and `arr2` would have had the same "velt type", and if one is rejected from vectorization, so is the other. Now they are handled separately, right?
I agree with Emanuel here. We need negative tests here too - correctly reject vectorizations which may cause cyclic dependency bugs. For example, passing the same array as 2 arguments (as in `testByteByte1()`) but with different offset to create cyclic dependency.
-------------
PR: https://git.openjdk.org/jdk/pull/12440
More information about the hotspot-compiler-dev
mailing list