RFR: 8300258: C2: vectorization fails on simple ByteBuffer loop
Emanuel Peter
epeter at openjdk.org
Thu Feb 9 17:03:43 UTC 2023
On Thu, 9 Feb 2023 16:04:29 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> > @rwestrel is there a reason why you only replaced these two instances of `same_velt_type`? The logic of "same type" is also used later on in the code of `SuperWord::find_adjacent_refs()`. For example when we have `create_pack == false`, we remove all memops and packs of the "same type". Do you not want to change that too?
>
> They don't have the same purpose AFAIU. The remaining uses in `SuperWord::find_adjacent_refs()` are related to the heuristic to find the best alignment. There it makes sense that the actual size of the operation is what matters, I think. While the one I change deal with correctness in the face of possibly overlapping arrays. So, yes, It's on purpose.
@rwestrel Is the idea not this: for one "velt type" / "memory slice" we have detected a misalignment, and may have cyclic dependency. So vectorization on that "velt type" / "memory slice" should be reverted, for all packs that we already have.
And then, we check if we just rejected the "velt type" / "memory slice" of the current best alignment. If so, we must find a new one.
I am very new to this code, so I might be getting this wrong.
-------------
PR: https://git.openjdk.org/jdk/pull/12440
More information about the hotspot-compiler-dev
mailing list