[CodeGen][SelectionDAG]Add new intrinsic experimental.vector.reverse

Authored by CarolineConcatto on Jan 15 2021, 8:46 AM.


[CodeGen][SelectionDAG]Add new intrinsic experimental.vector.reverse

This patch adds a new intrinsic experimental.vector.reduce that takes a single
vector and returns a vector of matching type but with the original lane order
reversed. For example:

vector.reverse(<A,B,C,D>) ==> <D,C,B,A>

The new intrinsic supports fixed and scalable vectors types.
The fixed-width vector relies on shufflevector to maintain existing behaviour.
Scalable vector uses the new ISD node - VECTOR_REVERSE.

This new intrinsic is one of the named shufflevector intrinsics proposed on the
mailing-list in the RFC at [1].

Patch by Paul Walker (@paulwalker-arm).

[1] https://lists.llvm.org/pipermail/llvm-dev/2020-November/146864.html

Differential Revision: https://reviews.llvm.org/D94883

Event Timeline

shawnl added a subscriber: shawnl.Feb 23 2021, 4:56 AM

There were a bunch of cases where PowerPC load/stores were not well optimized when combined with little-Endian/big-Endian requirements/swaps, and in libGcrypt we had to do the assembly manually. This should make fixing those much easier.