[MLIR] Create memref dialect and move dialect-specific ops from std.
Create the memref dialect and move dialect-specific ops
from std dialect to this dialect.
Moved ops:
AllocOp -> MemRef_AllocOp
AllocaOp -> MemRef_AllocaOp
AssumeAlignmentOp -> MemRef_AssumeAlignmentOp
DeallocOp -> MemRef_DeallocOp
DimOp -> MemRef_DimOp
MemRefCastOp -> MemRef_CastOp
MemRefReinterpretCastOp -> MemRef_ReinterpretCastOp
GetGlobalMemRefOp -> MemRef_GetGlobalOp
GlobalMemRefOp -> MemRef_GlobalOp
LoadOp -> MemRef_LoadOp
PrefetchOp -> MemRef_PrefetchOp
ReshapeOp -> MemRef_ReshapeOp
StoreOp -> MemRef_StoreOp
SubViewOp -> MemRef_SubViewOp
TransposeOp -> MemRef_TransposeOp
TensorLoadOp -> MemRef_TensorLoadOp
TensorStoreOp -> MemRef_TensorStoreOp
TensorToMemRefOp -> MemRef_BufferCastOp
ViewOp -> MemRef_ViewOp
The roadmap to split the memref dialect from std is discussed here:
https://llvm.discourse.group/t/rfc-split-the-memref-dialect-from-std/2667
Differential Revision: https://reviews.llvm.org/D98041
diff --git a/mlir/test/Dialect/Affine/dma.mlir b/mlir/test/Dialect/Affine/dma.mlir
index 6feb267..3ac1d03 100644
--- a/mlir/test/Dialect/Affine/dma.mlir
+++ b/mlir/test/Dialect/Affine/dma.mlir
@@ -4,9 +4,9 @@
// Test with loop IVs.
func @test0(%arg0 : index, %arg1 : index) {
- %0 = alloc() : memref<100x100xf32>
- %1 = alloc() : memref<100x100xf32, affine_map<(d0, d1) -> (d0, d1)>, 2>
- %2 = alloc() : memref<1xi32>
+ %0 = memref.alloc() : memref<100x100xf32>
+ %1 = memref.alloc() : memref<100x100xf32, affine_map<(d0, d1) -> (d0, d1)>, 2>
+ %2 = memref.alloc() : memref<1xi32>
%c0 = constant 0 : index
%c64 = constant 64 : index
affine.for %i0 = 0 to 10 {
@@ -25,9 +25,9 @@
// Test with loop IVs and optional stride arguments.
func @test1(%arg0 : index, %arg1 : index) {
- %0 = alloc() : memref<100x100xf32>
- %1 = alloc() : memref<100x100xf32, affine_map<(d0, d1) -> (d0, d1)>, 2>
- %2 = alloc() : memref<1xi32>
+ %0 = memref.alloc() : memref<100x100xf32>
+ %1 = memref.alloc() : memref<100x100xf32, affine_map<(d0, d1) -> (d0, d1)>, 2>
+ %2 = memref.alloc() : memref<1xi32>
%c0 = constant 0 : index
%c64 = constant 64 : index
%c128 = constant 128 : index
@@ -48,9 +48,9 @@
// Test with loop IVs and symbols (without symbol keyword).
func @test2(%arg0 : index, %arg1 : index) {
- %0 = alloc() : memref<100x100xf32>
- %1 = alloc() : memref<100x100xf32, affine_map<(d0, d1) -> (d0, d1)>, 2>
- %2 = alloc() : memref<1xi32>
+ %0 = memref.alloc() : memref<100x100xf32>
+ %1 = memref.alloc() : memref<100x100xf32, affine_map<(d0, d1) -> (d0, d1)>, 2>
+ %2 = memref.alloc() : memref<1xi32>
%c0 = constant 0 : index
%c64 = constant 64 : index
affine.for %i0 = 0 to 10 {
@@ -70,9 +70,9 @@
// Test with loop IVs and symbols (with symbol keyword).
func @test3(%arg0 : index, %arg1 : index) {
- %0 = alloc() : memref<100x100xf32>
- %1 = alloc() : memref<100x100xf32, affine_map<(d0, d1) -> (d0, d1)>, 2>
- %2 = alloc() : memref<1xi32>
+ %0 = memref.alloc() : memref<100x100xf32>
+ %1 = memref.alloc() : memref<100x100xf32, affine_map<(d0, d1) -> (d0, d1)>, 2>
+ %2 = memref.alloc() : memref<1xi32>
%c0 = constant 0 : index
%c64 = constant 64 : index
affine.for %i0 = 0 to 10 {
@@ -93,9 +93,9 @@
// Test with loop IVs, symbols and constants in nested affine expressions.
func @test4(%arg0 : index, %arg1 : index) {
- %0 = alloc() : memref<100x100xf32>
- %1 = alloc() : memref<100x100xf32, 2>
- %2 = alloc() : memref<1xi32>
+ %0 = memref.alloc() : memref<100x100xf32>
+ %1 = memref.alloc() : memref<100x100xf32, 2>
+ %2 = memref.alloc() : memref<1xi32>
%c64 = constant 64 : index
affine.for %i0 = 0 to 10 {
affine.for %i1 = 0 to 10 {