[mlir] [VectorOps] Improve lowering of extract_strided_slice (and friends like shape_...
authoraartbik <ajcbik@google.com>
Thu, 6 Aug 2020 22:34:47 +0000 (15:34 -0700)
committeraartbik <ajcbik@google.com>
Fri, 7 Aug 2020 16:21:05 +0000 (09:21 -0700)
commitc3c95b9c808519662afe8b9053aa88b5be451d1d
treed04872b3a9dcbeb55dc2905ecebc6601d35f6445
parent25e38c3f3c2a814797f53d0f08a687b3b4a028e4
[mlir] [VectorOps] Improve lowering of extract_strided_slice (and friends like shape_cast)

Using a shuffle for the last recursive step in progressive lowering not only
results in much more compact IR, but also more efficient code (since the
backend is no longer confused on subvector aliasing for longer vectors).

E.g. the following

  %f = vector.shape_cast %v0: vector<1024xf32> to vector<32x32xf32>

yields much better x86-64 code that runs 3x faster than the original.

Reviewed By: bkramer, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D85482
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir