aboutsummaryrefslogtreecommitdiff
path: root/mlir/test/Examples
diff options
context:
space:
mode:
authorJulian Gross <julian.gross@dfki.de>2021-02-10 13:53:11 +0100
committerJulian Gross <julian.gross@dfki.de>2021-02-18 11:29:39 +0100
commit8aa6c3765b924d86f623d452777eb76b83bf2787 (patch)
tree4fdb7b792a6f5ec1d3277dfbd36980509f6d63b9 /mlir/test/Examples
parentd876214990303e07310fb9f7a13b37715f051006 (diff)
downloadllvm-8aa6c3765b924d86f623d452777eb76b83bf2787.zip
llvm-8aa6c3765b924d86f623d452777eb76b83bf2787.tar.gz
llvm-8aa6c3765b924d86f623d452777eb76b83bf2787.tar.bz2
[MLIR] Create memref dialect and move several dialect-specific ops from std.
Create the memref dialect and move several dialect-specific ops without dependencies to other ops from std dialect to this dialect. Moved ops: AllocOp -> MemRef_AllocOp AllocaOp -> MemRef_AllocaOp DeallocOp -> MemRef_DeallocOp MemRefCastOp -> MemRef_CastOp GetGlobalMemRefOp -> MemRef_GetGlobalOp GlobalMemRefOp -> MemRef_GlobalOp PrefetchOp -> MemRef_PrefetchOp ReshapeOp -> MemRef_ReshapeOp StoreOp -> MemRef_StoreOp TransposeOp -> MemRef_TransposeOp 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/D96425
Diffstat (limited to 'mlir/test/Examples')
-rw-r--r--mlir/test/Examples/Toy/Ch5/affine-lowering.mlir20
-rw-r--r--mlir/test/Examples/Toy/Ch6/affine-lowering.mlir20
-rw-r--r--mlir/test/Examples/Toy/Ch7/affine-lowering.mlir20
3 files changed, 30 insertions, 30 deletions
diff --git a/mlir/test/Examples/Toy/Ch5/affine-lowering.mlir b/mlir/test/Examples/Toy/Ch5/affine-lowering.mlir
index 62fcc88..a51d497 100644
--- a/mlir/test/Examples/Toy/Ch5/affine-lowering.mlir
+++ b/mlir/test/Examples/Toy/Ch5/affine-lowering.mlir
@@ -16,9 +16,9 @@ func @main() {
// CHECK: [[VAL_3:%.*]] = constant 4.000000e+00 : f64
// CHECK: [[VAL_4:%.*]] = constant 5.000000e+00 : f64
// CHECK: [[VAL_5:%.*]] = constant 6.000000e+00 : f64
-// CHECK: [[VAL_6:%.*]] = alloc() : memref<3x2xf64>
-// CHECK: [[VAL_7:%.*]] = alloc() : memref<3x2xf64>
-// CHECK: [[VAL_8:%.*]] = alloc() : memref<2x3xf64>
+// CHECK: [[VAL_6:%.*]] = memref.alloc() : memref<3x2xf64>
+// CHECK: [[VAL_7:%.*]] = memref.alloc() : memref<3x2xf64>
+// CHECK: [[VAL_8:%.*]] = memref.alloc() : memref<2x3xf64>
// CHECK: affine.store [[VAL_0]], [[VAL_8]][0, 0] : memref<2x3xf64>
// CHECK: affine.store [[VAL_1]], [[VAL_8]][0, 1] : memref<2x3xf64>
// CHECK: affine.store [[VAL_2]], [[VAL_8]][0, 2] : memref<2x3xf64>
@@ -36,9 +36,9 @@ func @main() {
// CHECK: [[VAL_16:%.*]] = mulf [[VAL_14]], [[VAL_15]] : f64
// CHECK: affine.store [[VAL_16]], [[VAL_6]]{{\[}}[[VAL_12]], [[VAL_13]]] : memref<3x2xf64>
// CHECK: toy.print [[VAL_6]] : memref<3x2xf64>
-// CHECK: dealloc [[VAL_8]] : memref<2x3xf64>
-// CHECK: dealloc [[VAL_7]] : memref<3x2xf64>
-// CHECK: dealloc [[VAL_6]] : memref<3x2xf64>
+// CHECK: memref.dealloc [[VAL_8]] : memref<2x3xf64>
+// CHECK: memref.dealloc [[VAL_7]] : memref<3x2xf64>
+// CHECK: memref.dealloc [[VAL_6]] : memref<3x2xf64>
// OPT-LABEL: func @main()
// OPT: [[VAL_0:%.*]] = constant 1.000000e+00 : f64
@@ -47,8 +47,8 @@ func @main() {
// OPT: [[VAL_3:%.*]] = constant 4.000000e+00 : f64
// OPT: [[VAL_4:%.*]] = constant 5.000000e+00 : f64
// OPT: [[VAL_5:%.*]] = constant 6.000000e+00 : f64
-// OPT: [[VAL_6:%.*]] = alloc() : memref<3x2xf64>
-// OPT: [[VAL_7:%.*]] = alloc() : memref<2x3xf64>
+// OPT: [[VAL_6:%.*]] = memref.alloc() : memref<3x2xf64>
+// OPT: [[VAL_7:%.*]] = memref.alloc() : memref<2x3xf64>
// OPT: affine.store [[VAL_0]], [[VAL_7]][0, 0] : memref<2x3xf64>
// OPT: affine.store [[VAL_1]], [[VAL_7]][0, 1] : memref<2x3xf64>
// OPT: affine.store [[VAL_2]], [[VAL_7]][0, 2] : memref<2x3xf64>
@@ -61,5 +61,5 @@ func @main() {
// OPT: [[VAL_11:%.*]] = mulf [[VAL_10]], [[VAL_10]] : f64
// OPT: affine.store [[VAL_11]], [[VAL_6]]{{\[}}[[VAL_8]], [[VAL_9]]] : memref<3x2xf64>
// OPT: toy.print [[VAL_6]] : memref<3x2xf64>
-// OPT: dealloc [[VAL_7]] : memref<2x3xf64>
-// OPT: dealloc [[VAL_6]] : memref<3x2xf64>
+// OPT: memref.dealloc [[VAL_7]] : memref<2x3xf64>
+// OPT: memref.dealloc [[VAL_6]] : memref<3x2xf64>
diff --git a/mlir/test/Examples/Toy/Ch6/affine-lowering.mlir b/mlir/test/Examples/Toy/Ch6/affine-lowering.mlir
index 79bdd38..7e0e5ea 100644
--- a/mlir/test/Examples/Toy/Ch6/affine-lowering.mlir
+++ b/mlir/test/Examples/Toy/Ch6/affine-lowering.mlir
@@ -16,9 +16,9 @@ func @main() {
// CHECK: [[VAL_3:%.*]] = constant 4.000000e+00 : f64
// CHECK: [[VAL_4:%.*]] = constant 5.000000e+00 : f64
// CHECK: [[VAL_5:%.*]] = constant 6.000000e+00 : f64
-// CHECK: [[VAL_6:%.*]] = alloc() : memref<3x2xf64>
-// CHECK: [[VAL_7:%.*]] = alloc() : memref<3x2xf64>
-// CHECK: [[VAL_8:%.*]] = alloc() : memref<2x3xf64>
+// CHECK: [[VAL_6:%.*]] = memref.alloc() : memref<3x2xf64>
+// CHECK: [[VAL_7:%.*]] = memref.alloc() : memref<3x2xf64>
+// CHECK: [[VAL_8:%.*]] = memref.alloc() : memref<2x3xf64>
// CHECK: affine.store [[VAL_0]], [[VAL_8]][0, 0] : memref<2x3xf64>
// CHECK: affine.store [[VAL_1]], [[VAL_8]][0, 1] : memref<2x3xf64>
// CHECK: affine.store [[VAL_2]], [[VAL_8]][0, 2] : memref<2x3xf64>
@@ -36,9 +36,9 @@ func @main() {
// CHECK: [[VAL_16:%.*]] = mulf [[VAL_14]], [[VAL_15]] : f64
// CHECK: affine.store [[VAL_16]], [[VAL_6]]{{\[}}[[VAL_12]], [[VAL_13]]] : memref<3x2xf64>
// CHECK: toy.print [[VAL_6]] : memref<3x2xf64>
-// CHECK: dealloc [[VAL_8]] : memref<2x3xf64>
-// CHECK: dealloc [[VAL_7]] : memref<3x2xf64>
-// CHECK: dealloc [[VAL_6]] : memref<3x2xf64>
+// CHECK: memref.dealloc [[VAL_8]] : memref<2x3xf64>
+// CHECK: memref.dealloc [[VAL_7]] : memref<3x2xf64>
+// CHECK: memref.dealloc [[VAL_6]] : memref<3x2xf64>
// OPT-LABEL: func @main()
// OPT: [[VAL_0:%.*]] = constant 1.000000e+00 : f64
@@ -47,8 +47,8 @@ func @main() {
// OPT: [[VAL_3:%.*]] = constant 4.000000e+00 : f64
// OPT: [[VAL_4:%.*]] = constant 5.000000e+00 : f64
// OPT: [[VAL_5:%.*]] = constant 6.000000e+00 : f64
-// OPT: [[VAL_6:%.*]] = alloc() : memref<3x2xf64>
-// OPT: [[VAL_7:%.*]] = alloc() : memref<2x3xf64>
+// OPT: [[VAL_6:%.*]] = memref.alloc() : memref<3x2xf64>
+// OPT: [[VAL_7:%.*]] = memref.alloc() : memref<2x3xf64>
// OPT: affine.store [[VAL_0]], [[VAL_7]][0, 0] : memref<2x3xf64>
// OPT: affine.store [[VAL_1]], [[VAL_7]][0, 1] : memref<2x3xf64>
// OPT: affine.store [[VAL_2]], [[VAL_7]][0, 2] : memref<2x3xf64>
@@ -61,5 +61,5 @@ func @main() {
// OPT: [[VAL_11:%.*]] = mulf [[VAL_10]], [[VAL_10]] : f64
// OPT: affine.store [[VAL_11]], [[VAL_6]]{{\[}}[[VAL_8]], [[VAL_9]]] : memref<3x2xf64>
// OPT: toy.print [[VAL_6]] : memref<3x2xf64>
-// OPT: dealloc [[VAL_7]] : memref<2x3xf64>
-// OPT: dealloc [[VAL_6]] : memref<3x2xf64>
+// OPT: memref.dealloc [[VAL_7]] : memref<2x3xf64>
+// OPT: memref.dealloc [[VAL_6]] : memref<3x2xf64>
diff --git a/mlir/test/Examples/Toy/Ch7/affine-lowering.mlir b/mlir/test/Examples/Toy/Ch7/affine-lowering.mlir
index 4054eb0..e19d8f8 100644
--- a/mlir/test/Examples/Toy/Ch7/affine-lowering.mlir
+++ b/mlir/test/Examples/Toy/Ch7/affine-lowering.mlir
@@ -16,9 +16,9 @@ func @main() {
// CHECK: [[VAL_3:%.*]] = constant 4.000000e+00 : f64
// CHECK: [[VAL_4:%.*]] = constant 5.000000e+00 : f64
// CHECK: [[VAL_5:%.*]] = constant 6.000000e+00 : f64
-// CHECK: [[VAL_6:%.*]] = alloc() : memref<3x2xf64>
-// CHECK: [[VAL_7:%.*]] = alloc() : memref<3x2xf64>
-// CHECK: [[VAL_8:%.*]] = alloc() : memref<2x3xf64>
+// CHECK: [[VAL_6:%.*]] = memref.alloc() : memref<3x2xf64>
+// CHECK: [[VAL_7:%.*]] = memref.alloc() : memref<3x2xf64>
+// CHECK: [[VAL_8:%.*]] = memref.alloc() : memref<2x3xf64>
// CHECK: affine.store [[VAL_0]], [[VAL_8]][0, 0] : memref<2x3xf64>
// CHECK: affine.store [[VAL_1]], [[VAL_8]][0, 1] : memref<2x3xf64>
// CHECK: affine.store [[VAL_2]], [[VAL_8]][0, 2] : memref<2x3xf64>
@@ -36,9 +36,9 @@ func @main() {
// CHECK: [[VAL_16:%.*]] = mulf [[VAL_14]], [[VAL_15]] : f64
// CHECK: affine.store [[VAL_16]], [[VAL_6]]{{\[}}[[VAL_12]], [[VAL_13]]] : memref<3x2xf64>
// CHECK: toy.print [[VAL_6]] : memref<3x2xf64>
-// CHECK: dealloc [[VAL_8]] : memref<2x3xf64>
-// CHECK: dealloc [[VAL_7]] : memref<3x2xf64>
-// CHECK: dealloc [[VAL_6]] : memref<3x2xf64>
+// CHECK: memref.dealloc [[VAL_8]] : memref<2x3xf64>
+// CHECK: memref.dealloc [[VAL_7]] : memref<3x2xf64>
+// CHECK: memref.dealloc [[VAL_6]] : memref<3x2xf64>
// OPT-LABEL: func @main()
// OPT: [[VAL_0:%.*]] = constant 1.000000e+00 : f64
@@ -47,8 +47,8 @@ func @main() {
// OPT: [[VAL_3:%.*]] = constant 4.000000e+00 : f64
// OPT: [[VAL_4:%.*]] = constant 5.000000e+00 : f64
// OPT: [[VAL_5:%.*]] = constant 6.000000e+00 : f64
-// OPT: [[VAL_6:%.*]] = alloc() : memref<3x2xf64>
-// OPT: [[VAL_7:%.*]] = alloc() : memref<2x3xf64>
+// OPT: [[VAL_6:%.*]] = memref.alloc() : memref<3x2xf64>
+// OPT: [[VAL_7:%.*]] = memref.alloc() : memref<2x3xf64>
// OPT: affine.store [[VAL_0]], [[VAL_7]][0, 0] : memref<2x3xf64>
// OPT: affine.store [[VAL_1]], [[VAL_7]][0, 1] : memref<2x3xf64>
// OPT: affine.store [[VAL_2]], [[VAL_7]][0, 2] : memref<2x3xf64>
@@ -61,5 +61,5 @@ func @main() {
// OPT: [[VAL_11:%.*]] = mulf [[VAL_10]], [[VAL_10]] : f64
// OPT: affine.store [[VAL_11]], [[VAL_6]]{{\[}}[[VAL_8]], [[VAL_9]]] : memref<3x2xf64>
// OPT: toy.print [[VAL_6]] : memref<3x2xf64>
-// OPT: dealloc [[VAL_7]] : memref<2x3xf64>
-// OPT: dealloc [[VAL_6]] : memref<3x2xf64>
+// OPT: memref.dealloc [[VAL_7]] : memref<2x3xf64>
+// OPT: memref.dealloc [[VAL_6]] : memref<3x2xf64>