[mlir][Vector] Generalize AVX2 transpose lowering to n-D vectors
authorDiego Caballero <diegocaballero@google.com>
Fri, 25 Feb 2022 18:26:37 +0000 (18:26 +0000)
committerDiego Caballero <diegocaballero@google.com>
Fri, 25 Feb 2022 19:27:32 +0000 (19:27 +0000)
commitd7e0a0846b022ffe5bc142b5b1b7f83ec507cac1
tree79b5215211255a816ca4374ddba55df3148d8c21
parent767e64fc11d7734843ec5bb0bd3f7330541bb1a6
[mlir][Vector] Generalize AVX2 transpose lowering to n-D vectors

The existing AVX2 lowering patterns for the transpose op only triggers if the
input vector is 2-D. This patch extends the patterns to trigger for n-D vectors
which are effectively 2-D vectors (e.g., vector<1x4x1x8x1). The main constraint
for the generalized AVX2 patterns to be applicable to these vectors is that the
dimensions that are greater than one must be transposed. Otherwise, the existing
patterns are not applicable.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D119505
mlir/lib/Dialect/X86Vector/Transforms/AVXTranspose.cpp
mlir/test/Dialect/Vector/vector-transpose-lowering.mlir