[vectorIntrinsics] RFR: 8283413: Add C2 mid-end and x86 back-end implementation for bit REVERSE and REVERSE_BYTES operation [v6]
Jatin Bhateja
jbhateja at openjdk.org
Wed Jul 20 04:48:40 UTC 2022
On Wed, 20 Jul 2022 01:59:40 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>>> Hi @jatin-bhateja ,currently I'm looking at https://bugs.openjdk.org/browse/JDK-8290485, and noticed that you said the transformations for Reverse[bytes] are special that we cannot do the transformations when it is used by a VectorBlend. Could you please explain why? Per my understanding, the masked Reverse[bytes] with VectorBlend should also work, no matter what changes are applied to the Reverse[bytes], since we only need to make sure the non-masked lanes come from the first input, and the masked lanes from the second (Reverse[bytes]). Please correct me if I misunderstood. Thanks a lot!
>>
>> Hi @XiaohongGong , I re-implemented this before JEP integration by introducing a new [Node flag: Flag_is_predicated_using_blend](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/node.hpp#L788), this allowed us to move these transforms back to Idealization routines. Idea here was to prevent removing cascaded ReverseBytes if they are predicated, unless both the predicates comply. Thanks!
>
> Do you mean the `Flag_is_predicated_using_blend` used in the Idea is used to prevent optimizations like `ReverseBytesV (ReverseBytesV X , MASK) , MASK => X` when `ReverseBytesV` is predicated but implemented with `VectorBlend` ? So if it is, then I think the input of ReverseBytesV should be `VectorBlend X (ReverseBytesV X) MASK` while not `ReverseBytesV X`, right? Thanks!
Hi @XiaohongGong , May be I was not explicit, currently we are skipping any ideal transformation for operations on predicated operations implemented using blend and flag is set prior to a GVN transform, thus it can be safely used in ReverseBytes ideal routine. Since earlier these was no such flag and Blend node was created after GVN transform so it was not possible to skip transform for ReverseBytes[2] node.
![image](https://user-images.githubusercontent.com/59989778/179898611-1f3f061a-f9c5-49e1-8469-8e802c4ce245.png)
-------------
PR: https://git.openjdk.org/panama-vector/pull/182
More information about the panama-dev
mailing list