llvm-project/mlir/test/Conversion
Diego Caballero ee66e43a96 [mlir][Vector] Introduce 'vector.load' and 'vector.store' ops
This patch adds the 'vector.load' and 'vector.store' ops to the Vector
dialect [1]. These operations model *contiguous* vector loads and stores
from/to memory. Their semantics are similar to the 'affine.vector_load' and
'affine.vector_store' counterparts but without the affine constraints. The
most relevant feature is that these new vector operations may perform a vector
load/store on memrefs with a non-vector element type, unlike 'std.load' and
'std.store' ops. This opens the representation to model more generic vector
load/store scenarios: unaligned vector loads/stores, perform scalar and vector
memory access on the same memref, decouple memory allocation constraints from
memory accesses, etc [1]. These operations will also facilitate the progressive
lowering of both Affine vector loads/stores and Vector transfer reads/writes
for those that read/write contiguous slices from/to memory.

In particular, this patch adds the 'vector.load' and 'vector.store' ops to the
Vector dialect, implements their lowering to the LLVM dialect, and changes the
lowering of 'affine.vector_load' and 'affine.vector_store' ops to the new vector
ops. The lowering of Vector transfer reads/writes will be implemented in the
future, probably as an independent pass. The API of 'vector.maskedload' and
'vector.maskedstore' has also been changed slightly to align it with the
transfer read/write ops and the vector new ops. This will improve reusability
among all these operations. For example, the lowering of 'vector.load',
'vector.store', 'vector.maskedload' and 'vector.maskedstore' to the LLVM dialect
is implemented with a single template conversion pattern.

[1] https://llvm.discourse.group/t/memref-type-and-data-layout/

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D96185
2021-02-12 20:48:37 +02:00
..
AVX512ToLLVM [mlir][AVX512] Fix result type of vp2intersect 2021-01-31 12:03:46 +09:00
AffineToStandard [mlir][Vector] Introduce 'vector.load' and 'vector.store' ops 2021-02-12 20:48:37 +02:00
ArmNeonToLLVM [mlir] use built-in vector types instead of LLVM dialect types when possible 2021-01-12 10:04:28 +01:00
ArmSVEToLLVM [mlir] make vector to llvm conversion truly partial 2021-02-04 11:33:24 +01:00
AsyncToLLVM [mlir] Async: add a separate pass to lower from async to async.coro and async.runtime 2021-01-26 03:33:20 -08:00
ComplexToLLVM [mlir] turn complex-to-llvm into a partial conversion 2021-01-28 19:14:01 +01:00
GPUCommon [mlir] Fix gpu-to-llvm lowering for gpu.alloc with dynamic sizes. 2021-01-11 15:55:48 +01:00
GPUToCUDA [mlir] replace LLVM dialect float types with built-ins 2021-01-08 17:38:12 +01:00
GPUToNVVM [mlir] Use target-specific GPU kernel attributes in lowering pipelines 2021-02-12 14:09:24 +01:00
GPUToROCDL [mlir] Use target-specific GPU kernel attributes in lowering pipelines 2021-02-12 14:09:24 +01:00
GPUToROCm [mlir] replace LLVM dialect float types with built-ins 2021-01-08 17:38:12 +01:00
GPUToSPIRV [mlir][spirv] Create a pass for testing SCFToSPIRV patterns 2020-12-23 14:31:55 -05:00
GPUToVulkan [mlir] replace LLVM dialect float types with built-ins 2021-01-08 17:38:12 +01:00
LinalgToSPIRV [mlir][OpFormatGen] Format enum attribute cases as keywords when possible 2021-01-14 11:35:49 -08:00
LinalgToVector [mlir][Linalg] Generalize the definition of a Linalg contraction. 2021-02-04 07:50:44 +00:00
OpenMPToLLVM [mlir][OpFormatGen] Format enum attribute cases as keywords when possible 2021-01-14 11:35:49 -08:00
PDLToPDLInterp [mlir] Add a conversion pass between PDL and the PDL Interpreter Dialect 2020-10-26 18:01:06 -07:00
SCFToGPU [mlir][OpFormatGen] Format enum attribute cases as keywords when possible 2021-01-14 11:35:49 -08:00
SCFToOpenMP [mlir] Add conversion from SCF parallel loops to OpenMP 2020-11-24 21:12:56 +01:00
SCFToSPIRV [mlir][spirv] Create a pass for testing SCFToSPIRV patterns 2020-12-23 14:31:55 -05:00
SCFToStandard [mlir][OpFormatGen] Format enum attribute cases as keywords when possible 2021-01-14 11:35:49 -08:00
SPIRVToLLVM [mlir] use built-in vector types instead of LLVM dialect types when possible 2021-01-12 10:04:28 +01:00
ShapeToStandard [mlir][shape] Generalize broadcast to a variadic number of shapes 2021-02-10 08:31:28 +01:00
StandardToLLVM [mlir][math] Split off the math dialect. 2021-02-12 10:55:12 +01:00
StandardToSPIRV [mlir][spirv] Lower sexti -> SConvert 2021-02-12 15:04:12 +01:00
TosaToLinalg [MLIR][TOSA] Tosa elementwise broadcasting 2021-02-10 15:28:18 -08:00
VectorToLLVM [mlir][Vector] Introduce 'vector.load' and 'vector.store' ops 2021-02-12 20:48:37 +02:00
VectorToROCDL [mlir] use built-in vector types instead of LLVM dialect types when possible 2021-01-12 10:04:28 +01:00
VectorToSCF [mlir][OpFormatGen] Format enum attribute cases as keywords when possible 2021-01-14 11:35:49 -08:00
VectorToSPIRV [mlir][spirv] Add more vector conversion patterns 2021-02-05 09:11:16 -05:00