RFR: 8283307: Vectorize unsigned shift right on signed subword types
Jie Fu
jiefu at openjdk.java.net
Wed Apr 13 13:45:17 UTC 2022
On Wed, 13 Apr 2022 06:41:27 GMT, Fei Gao <fgao at openjdk.org> wrote:
> > Instead of just changing the opcode, can we replace `urshift` with `rshift` during SLP phase?
>
> Sorry, what does "replace `urshift` with `rshift`" mean? Could you please explain it in detail? Thanks @DamonFool .
>
> Actually, we can only replace `urshift` with `rshift` in the stage of generating vector node,
>
> https://github.com/openjdk/jdk/blob/c35590282d54d8388f2f7501a30365e0a912bfda/src/hotspot/share/opto/superword.cpp#L2384
>
> , to guarantee its correctness. SLP may breaks off in any stage before it and, if so, we can't do the replacement because of the same reason as in GVN phase.
Once `SuperWord::compute_vector_element_type()` computes the type of `urshift` is `short/byte`, then it can be transformed to `rshift` iff shift_cnt <= {16/24}.
In that case, it would be still correct even though the SLP analysis may fail, right?
Maybe, we can implement this idea like this: https://github.com/openjdk/jdk/pull/8224 .
What do you think?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7979
More information about the hotspot-compiler-dev
mailing list