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

Quan Anh Mai qamai at openjdk.org
Thu Mar 30 14:44:36 UTC 2023


On Thu, 23 Mar 2023 02:23:20 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> 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.

I agree, I am thinking of (ab)using template to have a common query function like this

    template <VectorQuery N, class T, class... U>
    T vectorQuery(U... args) {
        return T();
    }

then each platform can have a specialisation that looks like this:

    template <>
    bool vectorQuery<VectorQuery::NEEDS_LOAD_SHUFFLE>(BasicType bt, int vlen) {
    }

Unimplemented platform will return `false` for this, what do you think?

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

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


More information about the hotspot-compiler-dev mailing list