RFR: 8304450: [vectorapi] Refactor VectorShuffle implementation [v4]

Xiaohong Gong xgong at openjdk.org
Thu Mar 23 02:25:44 UTC 2023


On Wed, 22 Mar 2023 12:42:15 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> src/hotspot/share/opto/vectorIntrinsics.cpp line 2059:
>> 
>>> 2057:   if (need_load_shuffle) {
>>> 2058:     shuffle = gvn().transform(new VectorLoadShuffleNode(shuffle, vt));
>>> 2059:   }
>> 
>> How about generating `VectorLoadShuffleNode` for all platforms that support Vector API, and remove the helper method `vector_needs_load_shuffle()` ? For those platforms that do not need this shuffle preparation, we can emit nothing  in codegen.
>
> I think not emitting `VectorLoadShuffleNode` is more common so it is better to emit them only when needed, as it will simplify the graph and may allow better inspections of the indices in the future. Additionally, a do-nothing node does not alias with its input and therefore kills the input, which leads to an additional spill if they both need to live.

Yeah, I agree that saving a node have some benefits like what you said. My concern is there are more and more methods added into `Matcher::` and each platform has to do the different implementation. There is not too much meaning for those platforms that do not implement Vector API like` arm/ppc/...` for me. This makes code not so easy to maintain.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13093#discussion_r1145598639


More information about the hotspot-compiler-dev mailing list