summaryrefslogtreecommitdiffstats
path: root/mlir/test/IR
diff options
context:
space:
mode:
authorAndy Davis <andydavis@google.com>2019-11-07 10:19:54 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-11-07 10:20:23 -0800
commit8f00b4494d0434eedd8c80917d17d33d395ea65d (patch)
treea530978d2909a8ae8e1d42c51d164be720f917ba /mlir/test/IR
parent6b4e30b7c80782a2e1616c739b8a598ed72b725d (diff)
downloadbcm5719-llvm-8f00b4494d0434eedd8c80917d17d33d395ea65d.tar.gz
bcm5719-llvm-8f00b4494d0434eedd8c80917d17d33d395ea65d.zip
Swap operand order in std.view operation so that offset appears before dynamic sizes in the operand list.
PiperOrigin-RevId: 279114236
Diffstat (limited to 'mlir/test/IR')
-rw-r--r--mlir/test/IR/core-ops.mlir22
-rw-r--r--mlir/test/IR/invalid-ops.mlir10
2 files changed, 16 insertions, 16 deletions
diff --git a/mlir/test/IR/core-ops.mlir b/mlir/test/IR/core-ops.mlir
index bbabe60d12d..252a13df102 100644
--- a/mlir/test/IR/core-ops.mlir
+++ b/mlir/test/IR/core-ops.mlir
@@ -12,7 +12,7 @@
// CHECK-DAG: #[[map_proj_d0d1_d1d0:map[0-9]+]] = (d0, d1) -> (d1, d0)
// CHECK-DAG: #[[VIEW_MAP1:map[0-9]+]] = (d0, d1) -> (d0 * 4 + d1)
-// CHECK-DAG: #[[VIEW_MAP2:map[0-9]+]] = (d0, d1)[s0, s1] -> (d0 * s0 + d1 + s1)
+// CHECK-DAG: #[[VIEW_MAP2:map[0-9]+]] = (d0, d1)[s0, s1] -> (d0 * s1 + d1 + s0)
// CHECK-DAG: #[[VIEW_MAP3:map[0-9]+]] = (d0, d1)[s0] -> (d0 * s0 + d1)
// CHECK-LABEL: func @func_with_ops(%arg0: f32) {
@@ -480,23 +480,23 @@ func @memref_cast(%arg0: memref<4xf32>, %arg1 : memref<?xf32>) {
func @memref_view(%arg0 : index, %arg1 : index, %arg2 : index) {
%0 = alloc() : memref<2048xi8>
// Test two dynamic sizes and dynamic offset.
- // CHECK: %{{.*}} = std.view %0[%arg0, %arg1][%arg2] : memref<2048xi8> to memref<?x?xf32, #[[VIEW_MAP2]]>
- %1 = view %0[%arg0, %arg1][%arg2]
- : memref<2048xi8> to memref<?x?xf32, (d0, d1)[s0, s1] -> (d0 * s0 + d1 + s1)>
+ // CHECK: %{{.*}} = std.view %0[%arg2][%arg0, %arg1] : memref<2048xi8> to memref<?x?xf32, #[[VIEW_MAP2]]>
+ %1 = view %0[%arg2][%arg0, %arg1]
+ : memref<2048xi8> to memref<?x?xf32, (d0, d1)[s0, s1] -> (d0 * s1 + d1 + s0)>
// Test two dynamic sizes and static offset.
- // CHECK: %{{.*}} = std.view %0[%arg0, %arg1][] : memref<2048xi8> to memref<?x?xf32, #[[VIEW_MAP3]]>
- %2 = view %0[%arg0, %arg1][]
+ // CHECK: %{{.*}} = std.view %0[][%arg0, %arg1] : memref<2048xi8> to memref<?x?xf32, #[[VIEW_MAP3]]>
+ %2 = view %0[][%arg0, %arg1]
: memref<2048xi8> to memref<?x?xf32, (d0, d1)[s0] -> (d0 * s0 + d1)>
// Test one dynamic size and dynamic offset.
- // CHECK: %{{.*}} = std.view %0[%arg1][%arg2] : memref<2048xi8> to memref<4x?xf32, #[[VIEW_MAP2]]>
- %3 = view %0[%arg1][%arg2]
- : memref<2048xi8> to memref<4x?xf32, (d0, d1)[s0, s1] -> (d0 * s0 + d1 + s1)>
+ // CHECK: %{{.*}} = std.view %0[%arg2][%arg1] : memref<2048xi8> to memref<4x?xf32, #[[VIEW_MAP2]]>
+ %3 = view %0[%arg2][%arg1]
+ : memref<2048xi8> to memref<4x?xf32, (d0, d1)[s0, s1] -> (d0 * s1 + d1 + s0)>
// Test one dynamic size and static offset.
- // CHECK: %{{.*}} = std.view %0[%arg0][] : memref<2048xi8> to memref<?x4xf32, #[[VIEW_MAP1]]>
- %4 = view %0[%arg0][]
+ // CHECK: %{{.*}} = std.view %0[][%arg0] : memref<2048xi8> to memref<?x4xf32, #[[VIEW_MAP1]]>
+ %4 = view %0[][%arg0]
: memref<2048xi8> to memref<?x4xf32, (d0, d1) -> (d0 * 4 + d1)>
// Test static sizes and static offset.
diff --git a/mlir/test/IR/invalid-ops.mlir b/mlir/test/IR/invalid-ops.mlir
index 4d1d853dadb..ec38ecebb0e 100644
--- a/mlir/test/IR/invalid-ops.mlir
+++ b/mlir/test/IR/invalid-ops.mlir
@@ -907,7 +907,7 @@ func @invalid_splat(%v : f32) { // expected-note {{prior use here}}
func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
%0 = alloc() : memref<2048xi8>
// expected-error@+1 {{incorrect number of operands for type}}
- %1 = view %0[%arg0, %arg1][]
+ %1 = view %0[][%arg0, %arg1]
: memref<2048xi8> to memref<?x?xf32, (d0, d1)[s0] -> (d0 * 4 + d1 + s0)>
return
}
@@ -917,7 +917,7 @@ func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
%0 = alloc() : memref<2048xi8>
// expected-error@+1 {{is not strided}}
- %1 = view %0[%arg0, %arg1][]
+ %1 = view %0[][%arg0, %arg1]
: memref<2048xi8> to memref<?x?xf32, (d0, d1)[s0] -> (d0, d1, s0)>
return
}
@@ -927,7 +927,7 @@ func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
%0 = alloc() : memref<2048xf32>
// expected-error@+1 {{must be 1D memref of 8-bit integer values}}
- %1 = view %0[%arg0, %arg1][]
+ %1 = view %0[][%arg0, %arg1]
: memref<2048xf32> to memref<?x?xf32, (d0, d1)[s0] -> (d0 * 4 + d1 + s0)>
return
}
@@ -937,7 +937,7 @@ func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
%0 = alloc() : memref<2048xi8, (d0) -> (d0 floordiv 8, d0 mod 8)>
// expected-error@+1 {{unsupported map for base memref}}
- %1 = view %0[%arg0, %arg1][]
+ %1 = view %0[][%arg0, %arg1]
: memref<2048xi8, (d0) -> (d0 floordiv 8, d0 mod 8)> to
memref<?x?xf32, (d0, d1)[s0] -> (d0 * 4 + d1 + s0)>
return
@@ -948,7 +948,7 @@ func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
func @invalid_view(%arg0 : index, %arg1 : index, %arg2 : index) {
%0 = alloc() : memref<2048xi8, 2>
// expected-error@+1 {{different memory spaces}}
- %1 = view %0[%arg0, %arg1][]
+ %1 = view %0[][%arg0, %arg1]
: memref<2048xi8, 2> to
memref<?x?xf32, (d0, d1)[s0] -> (d0 * 4 + d1 + s0), 1>
return
OpenPOWER on IntegriCloud