diff options
author | Nicolas Vasilache <ntv@google.com> | 2019-11-14 08:10:36 -0800 |
---|---|---|
committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-11-14 08:15:23 -0800 |
commit | f2b6ae99913d0049c7929160aed5f213b1081abb (patch) | |
tree | 41ccb1f9a181eaada07f21cbc7da75ef2d229575 /mlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp | |
parent | 7c28de4aef6da3ab2f53118ecf717e56c68352e7 (diff) | |
download | bcm5719-llvm-f2b6ae99913d0049c7929160aed5f213b1081abb.tar.gz bcm5719-llvm-f2b6ae99913d0049c7929160aed5f213b1081abb.zip |
Move VectorOps to Tablegen - (almost) NFC
This CL moves VectorOps to Tablegen and cleans up the implementation.
This is almost NFC but 2 changes occur:
1. an interface change occurs in the padding value specification in vector_transfer_read:
the value becomes non-optional. As a shortcut we currently use %f0 for all paddings.
This should become an OpInterface for vectorization in the future.
2. the return type of vector.type_cast is trivial and simplified to `memref<vector<...>>`
Relevant roundtrip and invalid tests that used to sit in core are moved to the vector dialect.
The op documentation is moved to the .td file.
PiperOrigin-RevId: 280430869
Diffstat (limited to 'mlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp')
-rw-r--r-- | mlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp index 5ccf740f2fb..21bcdc9a6db 100644 --- a/mlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp +++ b/mlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp @@ -196,10 +196,10 @@ public: int64_t offset; SmallVector<int64_t, 4> strides; auto successStrides = - getStridesAndOffset(targetMemRefType, strides, offset); + getStridesAndOffset(sourceMemRefType, strides, offset); bool isContiguous = (strides.back() == 1); if (isContiguous) { - auto sizes = targetMemRefType.getShape(); + auto sizes = sourceMemRefType.getShape(); for (int index = 0, e = strides.size() - 2; index < e; ++index) { if (strides[index] != strides[index + 1] * sizes[index + 1]) { isContiguous = false; @@ -207,7 +207,7 @@ public: } } } - // Only contiguous tensors supported atm. + // Only contiguous source tensors supported atm. if (failed(successStrides) || !isContiguous) return matchFailure(); |