[mlir][NFC] Update textual references of func to func.func in IR/Interface tests

The special case parsing of `func` operations is being removed.
This commit is contained in:
River Riddle
2022-04-20 16:20:54 -07:00
parent 87db8e4439
commit 6a99d29022
47 changed files with 712 additions and 712 deletions

View File

@@ -3,7 +3,7 @@
// Verify that ops with broadcastable trait verifies operand and result type
// combinations and emits an error for invalid combinations.
func @broadcast_scalar_scalar_scalar(tensor<i32>, tensor<i32>) -> tensor<i32> {
func.func @broadcast_scalar_scalar_scalar(tensor<i32>, tensor<i32>) -> tensor<i32> {
^bb0(%arg0: tensor<i32>, %arg1: tensor<i32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<i32>, tensor<i32>) -> tensor<i32>
return %0 : tensor<i32>
@@ -11,7 +11,7 @@ func @broadcast_scalar_scalar_scalar(tensor<i32>, tensor<i32>) -> tensor<i32> {
// -----
func @broadcast_tensor_scalar_tensor(tensor<4xi32>, tensor<i32>) -> tensor<4xi32> {
func.func @broadcast_tensor_scalar_tensor(tensor<4xi32>, tensor<i32>) -> tensor<4xi32> {
^bb0(%arg0: tensor<4xi32>, %arg1: tensor<i32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<4xi32>, tensor<i32>) -> tensor<4xi32>
return %0 : tensor<4xi32>
@@ -20,7 +20,7 @@ func @broadcast_tensor_scalar_tensor(tensor<4xi32>, tensor<i32>) -> tensor<4xi32
// -----
// Check only one dimension has size 1
func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x1xi32>) -> tensor<4x3x2xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x1xi32>) -> tensor<4x3x2xi32> {
^bb0(%arg0: tensor<4x3x2xi32>, %arg1: tensor<3x1xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<4x3x2xi32>, tensor<3x1xi32>) -> tensor<4x3x2xi32>
return %0 : tensor<4x3x2xi32>
@@ -29,7 +29,7 @@ func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x1xi32>) -> tens
// -----
// Check multiple dimensions have size 1
func @broadcast_tensor_tensor_tensor(tensor<8x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x5xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<8x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x5xi32> {
^bb0(%arg0: tensor<8x1x6x1xi32>, %arg1: tensor<7x1x5xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<8x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x5xi32>
return %0 : tensor<8x7x6x5xi32>
@@ -38,7 +38,7 @@ func @broadcast_tensor_tensor_tensor(tensor<8x1x6x1xi32>, tensor<7x1x5xi32>) ->
// -----
// Check leading unknown dimension
func @broadcast_tensor_tensor_tensor(tensor<?x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<?x7x6x5xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<?x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<?x7x6x5xi32> {
^bb0(%arg0: tensor<?x1x6x1xi32>, %arg1: tensor<7x1x5xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<?x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<?x7x6x5xi32>
return %0 : tensor<?x7x6x5xi32>
@@ -47,7 +47,7 @@ func @broadcast_tensor_tensor_tensor(tensor<?x1x6x1xi32>, tensor<7x1x5xi32>) ->
// -----
// Check unknown dimension in the middle
func @broadcast_tensor_tensor_tensor(tensor<8x1x?x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x?x5xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<8x1x?x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x?x5xi32> {
^bb0(%arg0: tensor<8x1x?x1xi32>, %arg1: tensor<7x1x5xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<8x1x?x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x?x5xi32>
return %0 : tensor<8x7x?x5xi32>
@@ -56,7 +56,7 @@ func @broadcast_tensor_tensor_tensor(tensor<8x1x?x1xi32>, tensor<7x1x5xi32>) ->
// -----
// Check incompatible vector and tensor result type
func @broadcast_scalar_vector_vector(tensor<4xf32>, tensor<4xf32>) -> vector<4xf32> {
func.func @broadcast_scalar_vector_vector(tensor<4xf32>, tensor<4xf32>) -> vector<4xf32> {
^bb0(%arg0: tensor<4xf32>, %arg1: tensor<4xf32>):
// expected-error @+1 {{op result #0 must be tensor of any type values, but got 'vector<4xf32>'}}
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<4xf32>, tensor<4xf32>) -> vector<4xf32>
@@ -66,7 +66,7 @@ func @broadcast_scalar_vector_vector(tensor<4xf32>, tensor<4xf32>) -> vector<4xf
// -----
// Check incompatible operand types with known dimension
func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x3xi32>) -> tensor<4x3x2xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x3xi32>) -> tensor<4x3x2xi32> {
^bb0(%arg0: tensor<4x3x2xi32>, %arg1: tensor<3x3xi32>):
// expected-error @+1 {{operands don't have broadcast-compatible shapes}}
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<4x3x2xi32>, tensor<3x3xi32>) -> tensor<4x3x2xi32>
@@ -76,7 +76,7 @@ func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x3xi32>) -> tens
// -----
// Check incompatible result type with known dimension
func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x1xi32>) -> tensor<4x3x3xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x1xi32>) -> tensor<4x3x3xi32> {
^bb0(%arg0: tensor<4x3x2xi32>, %arg1: tensor<3x1xi32>):
// expected-error @+1 {{op result type '4x3x3' not broadcast compatible with broadcasted operands's shapes '4x3x2'}}
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<4x3x2xi32>, tensor<3x1xi32>) -> tensor<4x3x3xi32>
@@ -86,7 +86,7 @@ func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x1xi32>) -> tens
// -----
// Check incompatible result type with known dimension
func @broadcast_tensor_tensor_tensor(tensor<8x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x1xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<8x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x1xi32> {
^bb0(%arg0: tensor<8x1x6x1xi32>, %arg1: tensor<7x1x5xi32>):
// expected-error @+1 {{op result type '8x7x6x1' not broadcast compatible with broadcasted operands's shapes '8x7x6x5'}}
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<8x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x1xi32>
@@ -95,7 +95,7 @@ func @broadcast_tensor_tensor_tensor(tensor<8x1x6x1xi32>, tensor<7x1x5xi32>) ->
// -----
func @broadcast_tensor_tensor_tensor(tensor<2xi32>, tensor<2xi32>) -> tensor<*xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<2xi32>, tensor<2xi32>) -> tensor<*xi32> {
^bb0(%arg0: tensor<2xi32>, %arg1: tensor<2xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<2xi32>, tensor<2xi32>) -> tensor<*xi32>
return %0 : tensor<*xi32>
@@ -103,7 +103,7 @@ func @broadcast_tensor_tensor_tensor(tensor<2xi32>, tensor<2xi32>) -> tensor<*xi
// -----
func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<?xi32>) -> tensor<4x3x2xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<?xi32>) -> tensor<4x3x2xi32> {
^bb0(%arg0: tensor<4x3x2xi32>, %arg1: tensor<?xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<4x3x2xi32>, tensor<?xi32>) -> tensor<4x3x2xi32>
return %0 : tensor<4x3x2xi32>
@@ -111,7 +111,7 @@ func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<?xi32>) -> tensor
// -----
func @broadcast_tensor_tensor_tensor(%arg0: tensor<?x6x1xi32>, %arg1: tensor<*xi32>) -> tensor<?x6x6xi32> {
func.func @broadcast_tensor_tensor_tensor(%arg0: tensor<?x6x1xi32>, %arg1: tensor<*xi32>) -> tensor<?x6x6xi32> {
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<?x6x1xi32>, tensor<*xi32>) -> tensor<?x6x6xi32>
return %0 : tensor<?x6x6xi32>
}
@@ -119,7 +119,7 @@ func @broadcast_tensor_tensor_tensor(%arg0: tensor<?x6x1xi32>, %arg1: tensor<*xi
// -----
// Unranked operands but ranked result
func @broadcast_tensor_tensor_tensor(tensor<*xi32>, tensor<*xi32>) -> tensor<2xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<*xi32>, tensor<*xi32>) -> tensor<2xi32> {
^bb0(%arg0: tensor<*xi32>, %arg1: tensor<*xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<*xi32>, tensor<*xi32>) -> tensor<2xi32>
return %0 : tensor<2xi32>
@@ -128,7 +128,7 @@ func @broadcast_tensor_tensor_tensor(tensor<*xi32>, tensor<*xi32>) -> tensor<2xi
// -----
// Unranked operand and compatible ranked result
func @broadcast_tensor_tensor_tensor(tensor<3x2xi32>, tensor<*xi32>) -> tensor<4x3x2xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<3x2xi32>, tensor<*xi32>) -> tensor<4x3x2xi32> {
^bb0(%arg0: tensor<3x2xi32>, %arg1: tensor<*xi32>):
%0 = "test.broadcastable"(%arg0, %arg0, %arg1) : (tensor<3x2xi32>, tensor<3x2xi32>, tensor<*xi32>) -> tensor<4x3x2xi32>
return %0 : tensor<4x3x2xi32>
@@ -136,7 +136,7 @@ func @broadcast_tensor_tensor_tensor(tensor<3x2xi32>, tensor<*xi32>) -> tensor<4
// -----
func @broadcast_tensor_tensor_tensor(tensor<3x2xi32>, tensor<*xi32>) -> tensor<2xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<3x2xi32>, tensor<*xi32>) -> tensor<2xi32> {
^bb0(%arg0: tensor<3x2xi32>, %arg1: tensor<*xi32>):
// expected-error @+1 {{op result type '2' not broadcast compatible with broadcasted operands's shapes '3x2'}}
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<3x2xi32>, tensor<*xi32>) -> tensor<2xi32>
@@ -145,7 +145,7 @@ func @broadcast_tensor_tensor_tensor(tensor<3x2xi32>, tensor<*xi32>) -> tensor<2
// -----
func @broadcast_tensor_tensor_tensor(tensor<?x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x5xi32> {
func.func @broadcast_tensor_tensor_tensor(tensor<?x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x5xi32> {
^bb0(%arg0: tensor<?x1x6x1xi32>, %arg1: tensor<7x1x5xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<?x1x6x1xi32>, tensor<7x1x5xi32>) -> tensor<8x7x6x5xi32>
return %0 : tensor<8x7x6x5xi32>
@@ -153,7 +153,7 @@ func @broadcast_tensor_tensor_tensor(tensor<?x1x6x1xi32>, tensor<7x1x5xi32>) ->
// -----
func @broadcastDifferentResultType(tensor<4xi32>, tensor<4xi32>) -> tensor<4xi1> {
func.func @broadcastDifferentResultType(tensor<4xi32>, tensor<4xi32>) -> tensor<4xi1> {
^bb0(%arg0: tensor<4xi32>, %arg1: tensor<4xi32>):
%0 = "test.broadcastable"(%arg0, %arg1) : (tensor<4xi32>, tensor<4xi32>) -> tensor<4xi1>
return %0 : tensor<4xi1>

View File

@@ -194,182 +194,182 @@
// Single identity maps are removed.
// CHECK: @f0(memref<2x4xi8, 1>)
func private @f0(memref<2x4xi8, #map0, 1>)
func.func private @f0(memref<2x4xi8, #map0, 1>)
// Single identity maps are removed.
// CHECK: @f1(memref<2x4xi8, 1>)
func private @f1(memref<2x4xi8, #map1, 1>)
func.func private @f1(memref<2x4xi8, #map1, 1>)
// CHECK: @f2(memref<i8, #map{{[0-9]+}}, 1>)
func private @f2(memref<i8, #map2, 1>)
func.func private @f2(memref<i8, #map2, 1>)
// CHECK: @f3(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3(memref<2x4xi8, #map3, 1>)
func.func private @f3(memref<2x4xi8, #map3, 1>)
// CHECK: @f3a(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3a(memref<2x4xi8, #map3a, 1>)
func.func private @f3a(memref<2x4xi8, #map3a, 1>)
// CHECK: @f3b(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3b(memref<2x4xi8, #map3b, 1>)
func.func private @f3b(memref<2x4xi8, #map3b, 1>)
// CHECK: @f3c(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3c(memref<2x4xi8, #map3c, 1>)
func.func private @f3c(memref<2x4xi8, #map3c, 1>)
// CHECK: @f3d(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3d(memref<2x4xi8, #map3d, 1>)
func.func private @f3d(memref<2x4xi8, #map3d, 1>)
// CHECK: @f3e(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3e(memref<2x4xi8, #map3e, 1>)
func.func private @f3e(memref<2x4xi8, #map3e, 1>)
// CHECK: @f3f(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3f(memref<2x4xi8, #map3f, 1>)
func.func private @f3f(memref<2x4xi8, #map3f, 1>)
// CHECK: @f3g(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3g(memref<2x4xi8, #map3g, 1>)
func.func private @f3g(memref<2x4xi8, #map3g, 1>)
// CHECK: @f3h(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3h(memref<2x4xi8, #map3h, 1>)
func.func private @f3h(memref<2x4xi8, #map3h, 1>)
// CHECK: @f3i(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3i(memref<2x4xi8, #map3i, 1>)
func.func private @f3i(memref<2x4xi8, #map3i, 1>)
// CHECK: @f3j(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3j(memref<2x4xi8, #map3j, 1>)
func.func private @f3j(memref<2x4xi8, #map3j, 1>)
// CHECK: @f3k(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3k(memref<2x4xi8, #map3k, 1>)
func.func private @f3k(memref<2x4xi8, #map3k, 1>)
// CHECK: @f3l(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f3l(memref<2x4xi8, #map3l, 1>)
func.func private @f3l(memref<2x4xi8, #map3l, 1>)
// CHECK: @f4(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f4(memref<2x4xi8, #map4, 1>)
func.func private @f4(memref<2x4xi8, #map4, 1>)
// CHECK: @f5(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f5(memref<2x4xi8, #map5, 1>)
func.func private @f5(memref<2x4xi8, #map5, 1>)
// CHECK: @f6(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f6(memref<2x4xi8, #map6, 1>)
func.func private @f6(memref<2x4xi8, #map6, 1>)
// CHECK: @f7(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f7(memref<2x4xi8, #map7, 1>)
func.func private @f7(memref<2x4xi8, #map7, 1>)
// CHECK: @f8(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f8(memref<2x4xi8, #map8, 1>)
func.func private @f8(memref<2x4xi8, #map8, 1>)
// CHECK: @f9(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f9(memref<2x4xi8, #map9, 1>)
func.func private @f9(memref<2x4xi8, #map9, 1>)
// CHECK: @f10(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f10(memref<2x4xi8, #map10, 1>)
func.func private @f10(memref<2x4xi8, #map10, 1>)
// CHECK: @f11(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f11(memref<2x4xi8, #map11, 1>)
func.func private @f11(memref<2x4xi8, #map11, 1>)
// CHECK: @f12(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f12(memref<2x4xi8, #map12, 1>)
func.func private @f12(memref<2x4xi8, #map12, 1>)
// CHECK: @f13(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f13(memref<2x4xi8, #map13, 1>)
func.func private @f13(memref<2x4xi8, #map13, 1>)
// CHECK: @f14(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f14(memref<2x4xi8, #map14, 1>)
func.func private @f14(memref<2x4xi8, #map14, 1>)
// CHECK: @f15(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f15(memref<2x4xi8, #map15, 1>)
func.func private @f15(memref<2x4xi8, #map15, 1>)
// CHECK: @f16(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f16(memref<2x4xi8, #map16, 1>)
func.func private @f16(memref<2x4xi8, #map16, 1>)
// CHECK: @f17(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f17(memref<2x4xi8, #map17, 1>)
func.func private @f17(memref<2x4xi8, #map17, 1>)
// CHECK: @f19(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f19(memref<2x4xi8, #map19, 1>)
func.func private @f19(memref<2x4xi8, #map19, 1>)
// CHECK: @f20(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f20(memref<2x4xi8, #map20, 1>)
func.func private @f20(memref<2x4xi8, #map20, 1>)
// CHECK: @f18(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f18(memref<2x4xi8, #map18, 1>)
func.func private @f18(memref<2x4xi8, #map18, 1>)
// CHECK: @f21(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f21(memref<2x4xi8, #map21, 1>)
func.func private @f21(memref<2x4xi8, #map21, 1>)
// CHECK: @f22(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f22(memref<2x4xi8, #map22, 1>)
func.func private @f22(memref<2x4xi8, #map22, 1>)
// CHECK: @f23(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f23(memref<2x4xi8, #map23, 1>)
func.func private @f23(memref<2x4xi8, #map23, 1>)
// CHECK: @f24(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f24(memref<2x4xi8, #map24, 1>)
func.func private @f24(memref<2x4xi8, #map24, 1>)
// CHECK: @f25(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f25(memref<2x4xi8, #map25, 1>)
func.func private @f25(memref<2x4xi8, #map25, 1>)
// CHECK: @f26(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f26(memref<2x4xi8, #map26, 1>)
func.func private @f26(memref<2x4xi8, #map26, 1>)
// CHECK: @f29(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f29(memref<2x4xi8, #map29, 1>)
func.func private @f29(memref<2x4xi8, #map29, 1>)
// CHECK: @f30(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f30(memref<2x4xi8, #map30, 1>)
func.func private @f30(memref<2x4xi8, #map30, 1>)
// CHECK: @f32(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f32(memref<2x4xi8, #map32, 1>)
func.func private @f32(memref<2x4xi8, #map32, 1>)
// CHECK: @f33(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f33(memref<2x4xi8, #map33, 1>)
func.func private @f33(memref<2x4xi8, #map33, 1>)
// CHECK: @f34(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f34(memref<2x4xi8, #map34, 1>)
func.func private @f34(memref<2x4xi8, #map34, 1>)
// CHECK: @f35(memref<2x4x4xi8, #map{{[0-9]+}}, 1>)
func private @f35(memref<2x4x4xi8, #map35, 1>)
func.func private @f35(memref<2x4x4xi8, #map35, 1>)
// CHECK: @f36(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f36(memref<2x4xi8, #map36, 1>)
func.func private @f36(memref<2x4xi8, #map36, 1>)
// CHECK: @f37(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f37(memref<2x4xi8, #map37, 1>)
func.func private @f37(memref<2x4xi8, #map37, 1>)
// CHECK: @f38(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f38(memref<2x4xi8, #map38, 1>)
func.func private @f38(memref<2x4xi8, #map38, 1>)
// CHECK: @f39(memref<2x4xi8, #map{{[0-9]+}}, 1>)
func private @f39(memref<2x4xi8, #map39, 1>)
func.func private @f39(memref<2x4xi8, #map39, 1>)
// CHECK: @f43(memref<2x4xi8, #map{{[0-9]+}}>)
func private @f43(memref<2x4xi8, #map43>)
func.func private @f43(memref<2x4xi8, #map43>)
// CHECK: @f44(memref<2x4xi8, #map{{[0-9]+}}>)
func private @f44(memref<2x4xi8, #map44>)
func.func private @f44(memref<2x4xi8, #map44>)
// CHECK: @f45(memref<100x100x100xi8, #map{{[0-9]+}}>)
func private @f45(memref<100x100x100xi8, #map45>)
func.func private @f45(memref<100x100x100xi8, #map45>)
// CHECK: @f46(memref<100x100x100xi8, #map{{[0-9]+}}>)
func private @f46(memref<100x100x100xi8, #map46>)
func.func private @f46(memref<100x100x100xi8, #map46>)
// CHECK: @f47(memref<100x100x100xi8, #map{{[0-9]+}}>)
func private @f47(memref<100x100x100xi8, #map47>)
func.func private @f47(memref<100x100x100xi8, #map47>)
// CHECK: @f48(memref<100x100x100xi8, #map{{[0-9]+}}>)
func private @f48(memref<100x100x100xi8, #map48>)
func.func private @f48(memref<100x100x100xi8, #map48>)
// CHECK: @f49(memref<100x100xi8, #map{{[0-9]+}}>)
func private @f49(memref<100x100xi8, #map49>)
func.func private @f49(memref<100x100xi8, #map49>)
// CHECK: @f50(memref<100x100xi8, #map{{[0-9]+}}>)
func private @f50(memref<100x100xi8, #map50>)
func.func private @f50(memref<100x100xi8, #map50>)
// CHECK: @f51(memref<1xi8, #map{{[0-9]+}}>)
func private @f51(memref<1xi8, #map51>)
func.func private @f51(memref<1xi8, #map51>)
// CHECK: @f52(memref<1xi8, #map{{[0-9]+}}>)
func private @f52(memref<1xi8, #map52>)
func.func private @f52(memref<1xi8, #map52>)
// CHECK: @f53(memref<1xi8, #map{{[0-9]+}}>)
func private @f53(memref<1xi8, #map53>)
func.func private @f53(memref<1xi8, #map53>)
// CHECK: @f54(memref<10xi32, #map{{[0-9]+}}>)
func private @f54(memref<10xi32, #map54>)
func.func private @f54(memref<10xi32, #map54>)
// CHECK: "foo.op"() {map = #map{{[0-9]+}}} : () -> ()
"foo.op"() {map = #map55} : () -> ()
// CHECK: @f56(memref<1x1xi8, #map{{[0-9]+}}>)
func private @f56(memref<1x1xi8, #map56>)
func.func private @f56(memref<1x1xi8, #map56>)
// CHECK: "f57"() {map = #map{{[0-9]+}}} : () -> ()
"f57"() {map = #map57} : () -> ()

View File

@@ -4,7 +4,7 @@
// Test AnyAttrOf attributes
//===----------------------------------------------------------------------===//
func @any_attr_of_pass() {
func.func @any_attr_of_pass() {
"test.any_attr_of_i32_str"() {
// CHECK: attr = 3 : i32
attr = 3 : i32
@@ -20,7 +20,7 @@ func @any_attr_of_pass() {
// -----
func @any_attr_of_fail() {
func.func @any_attr_of_fail() {
// expected-error @+1 {{'test.any_attr_of_i32_str' op attribute 'attr' failed to satisfy constraint: 32-bit signless integer attribute or string attribute}}
"test.any_attr_of_i32_str"() {
attr = 3 : i64
@@ -35,7 +35,7 @@ func @any_attr_of_fail() {
// Test integer attributes
//===----------------------------------------------------------------------===//
func @int_attrs_pass() {
func.func @int_attrs_pass() {
"test.int_attrs"() {
// CHECK: any_i32_attr = 5 : ui32
any_i32_attr = 5 : ui32,
@@ -73,7 +73,7 @@ func @int_attrs_pass() {
// representable and preserved during a round-trip.
//===----------------------------------------------------------------------===//
func @int_attrs_pass() {
func.func @int_attrs_pass() {
"test.in_range_attrs"() {
// CHECK: attr_00 = -128 : i8
attr_00 = -128 : i8,
@@ -137,7 +137,7 @@ func @int_attrs_pass() {
// parser currently does.
//===----------------------------------------------------------------------===//
func @int_attrs_pass() {
func.func @int_attrs_pass() {
"test.i8_attr"() {
// CHECK: attr_00 = -1 : i8
attr_00 = 255 : i8,
@@ -159,7 +159,7 @@ func @int_attrs_pass() {
// are good to verify.
//===----------------------------------------------------------------------===//
func @int0_attrs_pass() {
func.func @int0_attrs_pass() {
"test.i0_attr"() {
// CHECK: attr_00 = 0 : i0
attr_00 = 0 : i0,
@@ -179,7 +179,7 @@ func @int0_attrs_pass() {
// -----
func @int0_attrs_negative_fail() {
func.func @int0_attrs_negative_fail() {
"test.i0_attr"() {
// expected-error @+1 {{integer constant out of range for attribute}}
attr_00 = -1 : i0
@@ -189,7 +189,7 @@ func @int0_attrs_negative_fail() {
// -----
func @int0_attrs_positive_fail() {
func.func @int0_attrs_positive_fail() {
"test.i0_attr"() {
// expected-error @+1 {{integer constant out of range for attribute}}
attr_00 = 1 : i0
@@ -199,7 +199,7 @@ func @int0_attrs_positive_fail() {
// -----
func @wrong_int_attrs_signedness_fail() {
func.func @wrong_int_attrs_signedness_fail() {
// expected-error @+1 {{'si32_attr' failed to satisfy constraint: 32-bit signed integer attribute}}
"test.int_attrs"() {
any_i32_attr = 5 : i32,
@@ -212,7 +212,7 @@ func @wrong_int_attrs_signedness_fail() {
// -----
func @wrong_int_attrs_signedness_fail() {
func.func @wrong_int_attrs_signedness_fail() {
// expected-error @+1 {{'ui32_attr' failed to satisfy constraint: 32-bit unsigned integer attribute}}
"test.int_attrs"() {
any_i32_attr = 5 : i32,
@@ -225,7 +225,7 @@ func @wrong_int_attrs_signedness_fail() {
// -----
func @wrong_int_attrs_type_fail() {
func.func @wrong_int_attrs_type_fail() {
// expected-error @+1 {{'any_i32_attr' failed to satisfy constraint: 32-bit integer attribute}}
"test.int_attrs"() {
any_i32_attr = 5.0 : f32,
@@ -242,7 +242,7 @@ func @wrong_int_attrs_type_fail() {
// Test Non-negative Int Attr
//===----------------------------------------------------------------------===//
func @non_negative_int_attr_pass() {
func.func @non_negative_int_attr_pass() {
// CHECK: test.non_negative_int_attr
"test.non_negative_int_attr"() {i32attr = 5 : i32, i64attr = 10 : i64} : () -> ()
// CHECK: test.non_negative_int_attr
@@ -252,7 +252,7 @@ func @non_negative_int_attr_pass() {
// -----
func @negative_int_attr_fail() {
func.func @negative_int_attr_fail() {
// expected-error @+1 {{'i32attr' failed to satisfy constraint: 32-bit signless integer attribute whose value is non-negative}}
"test.non_negative_int_attr"() {i32attr = -5 : i32, i64attr = 10 : i64} : () -> ()
return
@@ -260,7 +260,7 @@ func @negative_int_attr_fail() {
// -----
func @negative_int_attr_fail() {
func.func @negative_int_attr_fail() {
// expected-error @+1 {{'i64attr' failed to satisfy constraint: 64-bit signless integer attribute whose value is non-negative}}
"test.non_negative_int_attr"() {i32attr = 5 : i32, i64attr = -10 : i64} : () -> ()
return
@@ -272,7 +272,7 @@ func @negative_int_attr_fail() {
// Test Positive Int Attr
//===----------------------------------------------------------------------===//
func @positive_int_attr_pass() {
func.func @positive_int_attr_pass() {
// CHECK: test.positive_int_attr
"test.positive_int_attr"() {i32attr = 5 : i32, i64attr = 10 : i64} : () -> ()
return
@@ -280,7 +280,7 @@ func @positive_int_attr_pass() {
// -----
func @positive_int_attr_fail() {
func.func @positive_int_attr_fail() {
// expected-error @+1 {{'i32attr' failed to satisfy constraint: 32-bit signless integer attribute whose value is positive}}
"test.positive_int_attr"() {i32attr = 0 : i32, i64attr = 5: i64} : () -> ()
return
@@ -288,7 +288,7 @@ func @positive_int_attr_fail() {
// -----
func @positive_int_attr_fail() {
func.func @positive_int_attr_fail() {
// expected-error @+1 {{'i64attr' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive}}
"test.positive_int_attr"() {i32attr = 5 : i32, i64attr = 0: i64} : () -> ()
return
@@ -296,7 +296,7 @@ func @positive_int_attr_fail() {
// -----
func @positive_int_attr_fail() {
func.func @positive_int_attr_fail() {
// expected-error @+1 {{'i32attr' failed to satisfy constraint: 32-bit signless integer attribute whose value is positive}}
"test.positive_int_attr"() {i32attr = -10 : i32, i64attr = 5 : i64} : () -> ()
return
@@ -304,7 +304,7 @@ func @positive_int_attr_fail() {
// -----
func @positive_int_attr_fail() {
func.func @positive_int_attr_fail() {
// expected-error @+1 {{'i64attr' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive}}
"test.positive_int_attr"() {i32attr = 5 : i32, i64attr = -10 : i64} : () -> ()
return
@@ -316,7 +316,7 @@ func @positive_int_attr_fail() {
// Test TypeArrayAttr
//===----------------------------------------------------------------------===//
func @correct_type_array_attr_pass() {
func.func @correct_type_array_attr_pass() {
// CHECK: test.type_array_attr
"test.type_array_attr"() {attr = [i32, f32]} : () -> ()
return
@@ -324,7 +324,7 @@ func @correct_type_array_attr_pass() {
// -----
func @non_type_in_type_array_attr_fail() {
func.func @non_type_in_type_array_attr_fail() {
// expected-error @+1 {{'attr' failed to satisfy constraint: type array attribute}}
"test.type_array_attr"() {attr = [i32, 5 : i64]} : () -> ()
return
@@ -337,7 +337,7 @@ func @non_type_in_type_array_attr_fail() {
//===----------------------------------------------------------------------===//
// CHECK-LABEL: func @string_attr_custom_type
func @string_attr_custom_type() {
func.func @string_attr_custom_type() {
// CHECK: "string_data" : !foo.string
test.string_attr_with_type "string_data" : !foo.string
return
@@ -350,7 +350,7 @@ func @string_attr_custom_type() {
//===----------------------------------------------------------------------===//
// CHECK-LABEL: func @allowed_cases_pass
func @allowed_cases_pass() {
func.func @allowed_cases_pass() {
// CHECK: test.i32_enum_attr
%0 = "test.i32_enum_attr"() {attr = 5: i32} : () -> i32
// CHECK: test.i32_enum_attr
@@ -360,7 +360,7 @@ func @allowed_cases_pass() {
// -----
func @disallowed_case7_fail() {
func.func @disallowed_case7_fail() {
// expected-error @+1 {{allowed 32-bit signless integer cases: 5, 10}}
%0 = "test.i32_enum_attr"() {attr = 7: i32} : () -> i32
return
@@ -368,7 +368,7 @@ func @disallowed_case7_fail() {
// -----
func @disallowed_case7_fail() {
func.func @disallowed_case7_fail() {
// expected-error @+1 {{allowed 32-bit signless integer cases: 5, 10}}
%0 = "test.i32_enum_attr"() {attr = 5: i64} : () -> i32
return
@@ -381,7 +381,7 @@ func @disallowed_case7_fail() {
//===----------------------------------------------------------------------===//
// CHECK-LABEL: func @allowed_cases_pass
func @allowed_cases_pass() {
func.func @allowed_cases_pass() {
// CHECK: test.i64_enum_attr
%0 = "test.i64_enum_attr"() {attr = 5: i64} : () -> i32
// CHECK: test.i64_enum_attr
@@ -391,7 +391,7 @@ func @allowed_cases_pass() {
// -----
func @disallowed_case7_fail() {
func.func @disallowed_case7_fail() {
// expected-error @+1 {{allowed 64-bit signless integer cases: 5, 10}}
%0 = "test.i64_enum_attr"() {attr = 7: i64} : () -> i32
return
@@ -399,7 +399,7 @@ func @disallowed_case7_fail() {
// -----
func @disallowed_case7_fail() {
func.func @disallowed_case7_fail() {
// expected-error @+1 {{allowed 64-bit signless integer cases: 5, 10}}
%0 = "test.i64_enum_attr"() {attr = 5: i32} : () -> i32
return
@@ -411,7 +411,7 @@ func @disallowed_case7_fail() {
// Test FloatElementsAttr
//===----------------------------------------------------------------------===//
func @correct_type_pass() {
func.func @correct_type_pass() {
"test.float_elements_attr"() {
// CHECK: scalar_f32_attr = dense<5.000000e+00> : tensor<2xf32>
// CHECK: tensor_f64_attr = dense<6.000000e+00> : tensor<4x8xf64>
@@ -423,7 +423,7 @@ func @correct_type_pass() {
// -----
func @wrong_element_type_pass() {
func.func @wrong_element_type_pass() {
// expected-error @+1 {{failed to satisfy constraint: 32-bit float elements attribute of shape [2]}}
"test.float_elements_attr"() {
scalar_f32_attr = dense<5.0> : tensor<2xf64>,
@@ -434,7 +434,7 @@ func @wrong_element_type_pass() {
// -----
func @correct_type_pass() {
func.func @correct_type_pass() {
// expected-error @+1 {{failed to satisfy constraint: 64-bit float elements attribute of shape [4, 8]}}
"test.float_elements_attr"() {
scalar_f32_attr = dense<5.0> : tensor<2xf32>,
@@ -449,7 +449,7 @@ func @correct_type_pass() {
// Test StringElementsAttr
//===----------------------------------------------------------------------===//
func @simple_scalar_example() {
func.func @simple_scalar_example() {
"test.string_elements_attr"() {
// CHECK: dense<"example">
scalar_string_attr = dense<"example"> : tensor<2x!unknown<"">>
@@ -459,7 +459,7 @@ func @simple_scalar_example() {
// -----
func @escape_string_example() {
func.func @escape_string_example() {
"test.string_elements_attr"() {
// CHECK: dense<"new\0Aline">
scalar_string_attr = dense<"new\nline"> : tensor<2x!unknown<"">>
@@ -469,7 +469,7 @@ func @escape_string_example() {
// -----
func @simple_scalar_example() {
func.func @simple_scalar_example() {
"test.string_elements_attr"() {
// CHECK: dense<["example1", "example2"]>
scalar_string_attr = dense<["example1", "example2"]> : tensor<2x!unknown<"">>
@@ -483,7 +483,7 @@ func @simple_scalar_example() {
// Test SymbolRefAttr
//===----------------------------------------------------------------------===//
func @fn() { return }
func.func @fn() { return }
// CHECK: test.symbol_ref_attr
"test.symbol_ref_attr"() {symbol = @fn} : () -> ()
@@ -499,7 +499,7 @@ func @fn() { return }
// Test IntElementsAttr
//===----------------------------------------------------------------------===//
func @correct_int_elements_attr_pass() {
func.func @correct_int_elements_attr_pass() {
"test.int_elements_attr"() {
// CHECK: any_i32_attr = dense<5> : tensor<1x2x3x4xui32>,
any_i32_attr = dense<5> : tensor<1x2x3x4xui32>,
@@ -534,7 +534,7 @@ func @correct_int_elements_attr_pass() {
// -----
func @wrong_int_elements_attr_type_fail() {
func.func @wrong_int_elements_attr_type_fail() {
// expected-error @+1 {{'any_i32_attr' failed to satisfy constraint: 32-bit integer elements attribute}}
"test.int_elements_attr"() {
any_i32_attr = dense<5.0> : tensor<1x2x3x4xf32>,
@@ -545,7 +545,7 @@ func @wrong_int_elements_attr_type_fail() {
// -----
func @wrong_int_elements_attr_signedness_fail() {
func.func @wrong_int_elements_attr_signedness_fail() {
// expected-error @+1 {{'i32_attr' failed to satisfy constraint: 32-bit signless integer elements attribute}}
"test.int_elements_attr"() {
any_i32_attr = dense<5> : tensor<1x2x3x4xi32>,
@@ -560,7 +560,7 @@ func @wrong_int_elements_attr_signedness_fail() {
// Test Ranked IntElementsAttr
//===----------------------------------------------------------------------===//
func @correct_type_pass() {
func.func @correct_type_pass() {
"test.ranked_int_elements_attr"() {
// CHECK: matrix_i64_attr = dense<6> : tensor<4x8xi64>
// CHECK: vector_i32_attr = dense<5> : tensor<2xi32>
@@ -572,7 +572,7 @@ func @correct_type_pass() {
// -----
func @wrong_element_type_fail() {
func.func @wrong_element_type_fail() {
// expected-error @+1 {{failed to satisfy constraint: 32-bit signless int elements attribute of shape [2]}}
"test.ranked_int_elements_attr"() {
matrix_i64_attr = dense<6> : tensor<4x8xi64>,
@@ -583,7 +583,7 @@ func @wrong_element_type_fail() {
// -----
func @wrong_shape_fail() {
func.func @wrong_shape_fail() {
// expected-error @+1 {{failed to satisfy constraint: 64-bit signless int elements attribute of shape [4, 8]}}
"test.ranked_int_elements_attr"() {
matrix_i64_attr = dense<6> : tensor<4xi64>,
@@ -594,7 +594,7 @@ func @wrong_shape_fail() {
// -----
func @wrong_shape_fail() {
func.func @wrong_shape_fail() {
// expected-error @+1 {{failed to satisfy constraint: 32-bit signless int elements attribute of shape [2]}}
"test.ranked_int_elements_attr"() {
matrix_i64_attr = dense<6> : tensor<4x8xi64>,
@@ -609,7 +609,7 @@ func @wrong_shape_fail() {
// -----
func @missing_fields() {
func.func @missing_fields() {
// expected-error @+1 {{failed to satisfy constraint: DictionaryAttr with field(s): 'some_field', 'some_other_field' (each field having its own constraints)}}
"test.struct_attr"() {the_struct_attr = {}} : () -> ()
return
@@ -617,7 +617,7 @@ func @missing_fields() {
// -----
func @erroneous_fields() {
func.func @erroneous_fields() {
// expected-error @+1 {{failed to satisfy constraint: DictionaryAttr with field(s): 'some_field', 'some_other_field' (each field having its own constraints)}}
"test.struct_attr"() {the_struct_attr = {some_field = 1 : i8, some_other_field = 1}} : () -> ()
return

View File

@@ -13,7 +13,7 @@
// CHECK-LABEL: func @func_with_ops
// CHECK-SAME: %[[ARG:.*]]: f32
func @func_with_ops(f32) {
func.func @func_with_ops(f32) {
^bb0(%a : f32):
// CHECK: %[[T:.*]] = "getTensor"() : () -> tensor<4x4x?xf32>
%t = "getTensor"() : () -> tensor<4x4x?xf32>
@@ -31,7 +31,7 @@ func @func_with_ops(f32) {
}
// CHECK-LABEL: func @standard_instrs(%arg0: tensor<4x4x?xf32>, %arg1: f32, %arg2: i32, %arg3: index, %arg4: i64, %arg5: f16) {
func @standard_instrs(tensor<4x4x?xf32>, f32, i32, index, i64, f16) {
func.func @standard_instrs(tensor<4x4x?xf32>, f32, i32, index, i64, f16) {
^bb42(%t: tensor<4x4x?xf32>, %f: f32, %i: i32, %idx : index, %j: i64, %half: f16):
// CHECK: %[[C2:.*]] = arith.constant 2 : index
// CHECK: %[[A2:.*]] = tensor.dim %arg0, %[[C2]] : tensor<4x4x?xf32>
@@ -160,7 +160,7 @@ func @standard_instrs(tensor<4x4x?xf32>, f32, i32, index, i64, f16) {
}
// CHECK-LABEL: func @affine_apply() {
func @affine_apply() {
func.func @affine_apply() {
%i = "arith.constant"() {value = 0: index} : () -> index
%j = "arith.constant"() {value = 1: index} : () -> index
@@ -175,7 +175,7 @@ func @affine_apply() {
}
// CHECK-LABEL: func @load_store_prefetch
func @load_store_prefetch(memref<4x4xi32>, index) {
func.func @load_store_prefetch(memref<4x4xi32>, index) {
^bb0(%0: memref<4x4xi32>, %1: index):
// CHECK: %0 = memref.load %arg0[%arg1, %arg1] : memref<4x4xi32>
%2 = "memref.load"(%0, %1, %1) : (memref<4x4xi32>, index, index)->i32
@@ -194,7 +194,7 @@ func @load_store_prefetch(memref<4x4xi32>, index) {
// Test with zero-dimensional operands using no index in load/store.
// CHECK-LABEL: func @zero_dim_no_idx
func @zero_dim_no_idx(%arg0 : memref<i32>, %arg1 : memref<i32>, %arg2 : memref<i32>) {
func.func @zero_dim_no_idx(%arg0 : memref<i32>, %arg1 : memref<i32>, %arg2 : memref<i32>) {
%0 = memref.load %arg0[] : memref<i32>
memref.store %0, %arg1[] : memref<i32>
return
@@ -203,13 +203,13 @@ func @zero_dim_no_idx(%arg0 : memref<i32>, %arg1 : memref<i32>, %arg2 : memref<i
}
// CHECK-LABEL: func @return_op(%arg0: i32) -> i32 {
func @return_op(%a : i32) -> i32 {
func.func @return_op(%a : i32) -> i32 {
// CHECK: return %arg0 : i32
"func.return" (%a) : (i32)->()
}
// CHECK-LABEL: func @calls(%arg0: i32) {
func @calls(%arg0: i32) {
func.func @calls(%arg0: i32) {
// CHECK: %0 = call @return_op(%arg0) : (i32) -> i32
%x = call @return_op(%arg0) : (i32) -> i32
// CHECK: %1 = call @return_op(%0) : (i32) -> i32
@@ -236,7 +236,7 @@ func @calls(%arg0: i32) {
}
// CHECK-LABEL: func @memref_cast(%arg0
func @memref_cast(%arg0: memref<4xf32>, %arg1 : memref<?xf32>, %arg2 : memref<64x16x4xf32, offset: 0, strides: [64, 4, 1]>) {
func.func @memref_cast(%arg0: memref<4xf32>, %arg1 : memref<?xf32>, %arg2 : memref<64x16x4xf32, offset: 0, strides: [64, 4, 1]>) {
// CHECK: %0 = memref.cast %arg0 : memref<4xf32> to memref<?xf32>
%0 = memref.cast %arg0 : memref<4xf32> to memref<?xf32>
@@ -260,10 +260,10 @@ func @memref_cast(%arg0: memref<4xf32>, %arg1 : memref<?xf32>, %arg2 : memref<64
// Check that unranked memrefs with non-default memory space roundtrip
// properly.
// CHECK-LABEL: @unranked_memref_roundtrip(memref<*xf32, 4>)
func private @unranked_memref_roundtrip(memref<*xf32, 4>)
func.func private @unranked_memref_roundtrip(memref<*xf32, 4>)
// CHECK-LABEL: func @memref_view(%arg0
func @memref_view(%arg0 : index, %arg1 : index, %arg2 : index) {
func.func @memref_view(%arg0 : index, %arg1 : index, %arg2 : index) {
%0 = memref.alloc() : memref<2048xi8>
// Test two dynamic sizes and dynamic offset.
// CHECK: %{{.*}} = memref.view %0[%arg2][%arg0, %arg1] : memref<2048xi8> to memref<?x?xf32>
@@ -282,7 +282,7 @@ func @memref_view(%arg0 : index, %arg1 : index, %arg2 : index) {
// CHECK-LABEL: func @test_dimop
// CHECK-SAME: %[[ARG:.*]]: tensor<4x4x?xf32>
func @test_dimop(%arg0: tensor<4x4x?xf32>) {
func.func @test_dimop(%arg0: tensor<4x4x?xf32>) {
// CHECK: %[[C2:.*]] = arith.constant 2 : index
// CHECK: %{{.*}} = tensor.dim %[[ARG]], %[[C2]] : tensor<4x4x?xf32>
%c2 = arith.constant 2 : index
@@ -293,7 +293,7 @@ func @test_dimop(%arg0: tensor<4x4x?xf32>) {
}
// CHECK-LABEL: func @tensor_load_store
func @tensor_load_store(%0 : memref<4x4xi32>, %1 : tensor<4x4xi32>) {
func.func @tensor_load_store(%0 : memref<4x4xi32>, %1 : tensor<4x4xi32>) {
// CHECK-SAME: (%[[MEMREF:.*]]: memref<4x4xi32>,
// CHECK-SAME: %[[TENSOR:.*]]: tensor<4x4xi32>)
// CHECK: memref.tensor_store %[[TENSOR]], %[[MEMREF]] : memref<4x4xi32>
@@ -302,7 +302,7 @@ func @tensor_load_store(%0 : memref<4x4xi32>, %1 : tensor<4x4xi32>) {
}
// CHECK-LABEL: func @unranked_tensor_load_store
func @unranked_tensor_load_store(%0 : memref<*xi32>, %1 : tensor<*xi32>) {
func.func @unranked_tensor_load_store(%0 : memref<*xi32>, %1 : tensor<*xi32>) {
// CHECK-SAME: (%[[MEMREF:.*]]: memref<*xi32>,
// CHECK-SAME: %[[TENSOR:.*]]: tensor<*xi32>)
// CHECK: memref.tensor_store %[[TENSOR]], %[[MEMREF]] : memref<*xi32>
@@ -312,7 +312,7 @@ func @unranked_tensor_load_store(%0 : memref<*xi32>, %1 : tensor<*xi32>) {
// CHECK-LABEL: func @assume_alignment
// CHECK-SAME: %[[MEMREF:.*]]: memref<4x4xf16>
func @assume_alignment(%0: memref<4x4xf16>) {
func.func @assume_alignment(%0: memref<4x4xf16>) {
// CHECK: memref.assume_alignment %[[MEMREF]], 16 : memref<4x4xf16>
memref.assume_alignment %0, 16 : memref<4x4xf16>
return

View File

@@ -4,7 +4,7 @@
// CHECK-LABEL: Test 'test1'
// CHECK-NEXT: mysource2:1:0: error: test diagnostic
// CHECK-NEXT: mysource3:2:0: note: called from
func private @test1() attributes {
func.func private @test1() attributes {
test.loc = loc(callsite("foo"("mysource1":0:0) at callsite("mysource2":1:0 at "mysource3":2:0)))
}
@@ -12,6 +12,6 @@ func private @test1() attributes {
// CHECK-LABEL: Test 'test2'
// CHECK-NEXT: mysource1:0:0: error: test diagnostic
func private @test2() attributes {
func.func private @test2() attributes {
test.loc = loc("mysource1":0:0)
}

View File

@@ -4,7 +4,7 @@
// -----
// Emit the first available call stack in the fused location.
func @constant_out_of_range() {
func.func @constant_out_of_range() {
// CHECK: mysource1:0:0: error: 'arith.constant' op failed to verify that result and attribute have the same type
// CHECK-NEXT: mysource2:1:0: note: called from
// CHECK-NEXT: mysource3:2:0: note: called from

View File

@@ -1,6 +1,6 @@
// RUN: mlir-opt -verify-diagnostics -split-input-file %s
func @test_invalid_enum_case() -> () {
func.func @test_invalid_enum_case() -> () {
// expected-error@+2 {{expected test::TestEnum to be one of: first, second, third}}
// expected-error@+1 {{failed to parse TestEnumAttr}}
test.op_with_enum #test<"enum fourth">
@@ -8,7 +8,7 @@ func @test_invalid_enum_case() -> () {
// -----
func @test_invalid_enum_case() -> () {
func.func @test_invalid_enum_case() -> () {
// expected-error@+1 {{expected test::TestEnum to be one of: first, second, third}}
test.op_with_enum fourth
// expected-error@+1 {{failed to parse TestEnumAttr}}
@@ -16,14 +16,14 @@ func @test_invalid_enum_case() -> () {
// -----
func @test_invalid_attr() -> () {
func.func @test_invalid_attr() -> () {
// expected-error@+1 {{op attribute 'value' failed to satisfy constraint: a test enum}}
"test.op_with_enum"() {value = 1 : index} : () -> ()
}
// -----
func @test_parse_invalid_attr() -> () {
func.func @test_parse_invalid_attr() -> () {
// expected-error@+2 {{expected valid keyword}}
// expected-error@+1 {{failed to parse TestEnumAttr parameter 'value'}}
test.op_with_enum 1 : index

View File

@@ -1,7 +1,7 @@
// RUN: mlir-opt %s | mlir-opt -test-patterns | FileCheck %s
// CHECK-LABEL: @test_enum_attr_roundtrip
func @test_enum_attr_roundtrip() -> () {
func.func @test_enum_attr_roundtrip() -> () {
// CHECK: value = #test<"enum first">
"test.op"() {value = #test<"enum first">} : () -> ()
// CHECK: value = #test<"enum second">
@@ -12,14 +12,14 @@ func @test_enum_attr_roundtrip() -> () {
}
// CHECK-LABEL: @test_op_with_enum
func @test_op_with_enum() -> () {
func.func @test_op_with_enum() -> () {
// CHECK: test.op_with_enum third
test.op_with_enum third
return
}
// CHECK-LABEL: @test_match_op_with_enum
func @test_match_op_with_enum() -> () {
func.func @test_match_op_with_enum() -> () {
// CHECK: test.op_with_enum third tag 0 : i32
test.op_with_enum third tag 0 : i32
// CHECK: test.op_with_enum second tag 1 : i32

View File

@@ -1,7 +1,7 @@
// RUN: mlir-opt -test-generic-ir-visitors-interrupt -allow-unregistered-dialect -split-input-file %s | FileCheck %s
// Walk is interrupted before visiting "foo"
func @main(%arg0: f32) -> f32 {
func.func @main(%arg0: f32) -> f32 {
%v1 = "foo"() {interrupt_before_all = true} : () -> f32
%v2 = arith.addf %v1, %arg0 : f32
return %v2 : f32
@@ -14,7 +14,7 @@ func @main(%arg0: f32) -> f32 {
// -----
// Walk is interrupted after visiting "foo" (which has a single empty region)
func @main(%arg0: f32) -> f32 {
func.func @main(%arg0: f32) -> f32 {
%v1 = "foo"() ({ "bar"() : ()-> () }) {interrupt_after_all = true} : () -> f32
%v2 = arith.addf %v1, %arg0 : f32
return %v2 : f32
@@ -29,7 +29,7 @@ func @main(%arg0: f32) -> f32 {
// -----
// Walk is interrupted after visiting "foo"'s 1st region.
func @main(%arg0: f32) -> f32 {
func.func @main(%arg0: f32) -> f32 {
%v1 = "foo"() ({
"bar0"() : () -> ()
}, {
@@ -49,7 +49,7 @@ func @main(%arg0: f32) -> f32 {
// -----
// Test static filtering.
func @main() {
func.func @main() {
"foo"() : () -> ()
"test.two_region_op"()(
{"work"() : () -> ()},
@@ -73,7 +73,7 @@ func @main() {
// -----
// Test static filtering.
func @main() {
func.func @main() {
"foo"() : () -> ()
"test.two_region_op"()(
{"work"() : () -> ()},
@@ -95,7 +95,7 @@ func @main() {
// Test skipping.
// Walk is skipped before visiting "foo".
func @main(%arg0: f32) -> f32 {
func.func @main(%arg0: f32) -> f32 {
%v1 = "foo"() ({
"bar0"() : () -> ()
}, {
@@ -114,7 +114,7 @@ func @main(%arg0: f32) -> f32 {
// -----
// Walk is skipped after visiting all regions of "foo".
func @main(%arg0: f32) -> f32 {
func.func @main(%arg0: f32) -> f32 {
%v1 = "foo"() ({
"bar0"() : () -> ()
}, {
@@ -137,7 +137,7 @@ func @main(%arg0: f32) -> f32 {
// -----
// Walk is skipped after visiting first region of "foo".
func @main(%arg0: f32) -> f32 {
func.func @main(%arg0: f32) -> f32 {
%v1 = "foo"() ({
"bar0"() : () -> ()
}, {

View File

@@ -3,7 +3,7 @@
// Verify the different configurations of generic IR visitors.
func @structured_cfg() {
func.func @structured_cfg() {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c10 = arith.constant 10 : index
@@ -43,7 +43,7 @@ func @structured_cfg() {
// -----
// Test the specific operation type visitor.
func @correct_number_of_regions() {
func.func @correct_number_of_regions() {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c10 = arith.constant 10 : index

View File

@@ -2,7 +2,7 @@
// -----
func @func_op() {
func.func @func_op() {
// expected-error@+1 {{expected valid '@'-identifier for symbol name}}
func.func missingsigil() -> (i1, index, f32)
return
@@ -10,7 +10,7 @@ func @func_op() {
// -----
func @func_op() {
func.func @func_op() {
// expected-error@+1 {{expected type instead of SSA identifier}}
func.func @mixed_named_arguments(f32, %a : i32) {
return
@@ -20,7 +20,7 @@ func @func_op() {
// -----
func @func_op() {
func.func @func_op() {
// expected-error@+1 {{expected SSA identifier}}
func.func @mixed_named_arguments(%a : i32, f32) -> () {
return
@@ -30,7 +30,7 @@ func @func_op() {
// -----
func @func_op() {
func.func @func_op() {
// expected-error@+1 {{entry block must have 1 arguments to match function signature}}
func.func @mixed_named_arguments(f32) {
^entry:
@@ -41,7 +41,7 @@ func @func_op() {
// -----
func @func_op() {
func.func @func_op() {
// expected-error@+1 {{type of entry block argument #0('i32') must match the type of the corresponding argument in function signature('f32')}}
func.func @mixed_named_arguments(f32) {
^entry(%arg : i32):
@@ -53,63 +53,63 @@ func @func_op() {
// -----
// expected-error@+1 {{expected non-function type}}
func @f() -> (foo
func.func @f() -> (foo
// -----
// expected-error@+1 {{expected attribute name}}
func @f() -> (i1 {)
func.func @f() -> (i1 {)
// -----
// expected-error@+1 {{invalid to use 'test.invalid_attr'}}
func @f(%arg0: i64 {test.invalid_attr}) {
func.func @f(%arg0: i64 {test.invalid_attr}) {
return
}
// -----
// expected-error@+1 {{invalid to use 'test.invalid_attr'}}
func @f(%arg0: i64) -> (i64 {test.invalid_attr}) {
func.func @f(%arg0: i64) -> (i64 {test.invalid_attr}) {
return %arg0 : i64
}
// -----
// expected-error@+1 {{symbol declaration cannot have public visibility}}
func @invalid_public_declaration()
func.func @invalid_public_declaration()
// -----
// expected-error@+1 {{'sym_visibility' is an inferred attribute and should not be specified in the explicit attribute dictionary}}
func @legacy_visibility_syntax() attributes { sym_visibility = "private" }
func.func @legacy_visibility_syntax() attributes { sym_visibility = "private" }
// -----
// expected-error@+1 {{'sym_name' is an inferred attribute and should not be specified in the explicit attribute dictionary}}
func private @invalid_symbol_name_attr() attributes { sym_name = "x" }
func.func private @invalid_symbol_name_attr() attributes { sym_name = "x" }
// -----
// expected-error@+1 {{'function_type' is an inferred attribute and should not be specified in the explicit attribute dictionary}}
func private @invalid_symbol_type_attr() attributes { function_type = "x" }
func.func private @invalid_symbol_type_attr() attributes { function_type = "x" }
// -----
// expected-error@+1 {{argument attribute array `arg_attrs` to have the same number of elements as the number of function arguments}}
func private @invalid_arg_attrs() attributes { arg_attrs = [{}] }
func.func private @invalid_arg_attrs() attributes { arg_attrs = [{}] }
// -----
// expected-error@+1 {{expects argument attribute dictionary to be a DictionaryAttr, but got `10 : i64`}}
func private @invalid_arg_attrs(i32) attributes { arg_attrs = [10] }
func.func private @invalid_arg_attrs(i32) attributes { arg_attrs = [10] }
// -----
// expected-error@+1 {{result attribute array `res_attrs` to have the same number of elements as the number of function results}}
func private @invalid_res_attrs() attributes { res_attrs = [{}] }
func.func private @invalid_res_attrs() attributes { res_attrs = [{}] }
// -----
// expected-error@+1 {{expects result attribute dictionary to be a DictionaryAttr, but got `10 : i64`}}
func private @invalid_res_attrs() -> i32 attributes { res_attrs = [10] }
func.func private @invalid_res_attrs() -> i32 attributes { res_attrs = [10] }

View File

@@ -2,77 +2,77 @@
// -----
func @location_missing_l_paren() {
func.func @location_missing_l_paren() {
^bb:
return loc) // expected-error {{expected '(' in location}}
}
// -----
func @location_missing_r_paren() {
func.func @location_missing_r_paren() {
^bb:
return loc(unknown // expected-error@+1 {{expected ')' in location}}
}
// -----
func @location_invalid_instance() {
func.func @location_invalid_instance() {
^bb:
return loc() // expected-error {{expected location instance}}
}
// -----
func @location_name_missing_r_paren() {
func.func @location_name_missing_r_paren() {
^bb:
return loc("foo"(unknown]) // expected-error {{expected ')' after child location of NameLoc}}
}
// -----
func @location_callsite_missing_l_paren() {
func.func @location_callsite_missing_l_paren() {
^bb:
return loc(callsite unknown // expected-error {{expected '(' in callsite location}}
}
// -----
func @location_callsite_missing_callee() {
func.func @location_callsite_missing_callee() {
^bb:
return loc(callsite( at ) // expected-error {{expected location instance}}
}
// -----
func @location_callsite_missing_at() {
func.func @location_callsite_missing_at() {
^bb:
return loc(callsite(unknown unknown) // expected-error {{expected 'at' in callsite location}}
}
// -----
func @location_callsite_missing_caller() {
func.func @location_callsite_missing_caller() {
^bb:
return loc(callsite(unknown at ) // expected-error {{expected location instance}}
}
// -----
func @location_callsite_missing_r_paren() {
func.func @location_callsite_missing_r_paren() {
^bb:
return loc(callsite( unknown at unknown // expected-error@+1 {{expected ')' in callsite location}}
}
// -----
func @location_fused_missing_greater() {
func.func @location_fused_missing_greater() {
^bb:
return loc(fused<true [unknown]) // expected-error {{expected '>' after fused location metadata}}
}
// -----
func @location_fused_missing_metadata() {
func.func @location_fused_missing_metadata() {
^bb:
// expected-error@+1 {{expected non-function type}}
return loc(fused<) // expected-error {{expected valid attribute metadata}}
@@ -80,35 +80,35 @@ func @location_fused_missing_metadata() {
// -----
func @location_fused_missing_l_square() {
func.func @location_fused_missing_l_square() {
^bb:
return loc(fused<true>unknown]) // expected-error {{expected '[' in fused location}}
}
// -----
func @location_fused_missing_r_square() {
func.func @location_fused_missing_r_square() {
^bb:
return loc(fused[unknown) // expected-error {{expected ']' in fused location}}
}
// -----
func @location_invalid_alias() {
func.func @location_invalid_alias() {
// expected-error@+1 {{expected location, but found dialect attribute: '#foo.loc'}}
return loc(#foo.loc)
}
// -----
func @location_invalid_alias() {
func.func @location_invalid_alias() {
// expected-error@+1 {{operation location alias was never defined}}
return loc(#invalid_alias)
}
// -----
func @location_invalid_alias() {
func.func @location_invalid_alias() {
// expected-error@+1 {{expected location, but found 'true'}}
return loc(#non_loc)
}

View File

@@ -2,7 +2,7 @@
// -----
func @module_op() {
func.func @module_op() {
// expected-error@+1 {{'builtin.module' op expects region #0 to have 0 or 1 blocks}}
builtin.module {
^bb1:
@@ -15,7 +15,7 @@ func @module_op() {
// -----
func @module_op() {
func.func @module_op() {
// expected-error@+1 {{region should have no arguments}}
builtin.module {
^bb1(%arg: i32):

View File

@@ -1,6 +1,6 @@
// RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file -verify-diagnostics
func @affine_apply_no_map() {
func.func @affine_apply_no_map() {
^bb0:
%i = arith.constant 0 : index
%x = "affine.apply" (%i) { } : (index) -> (index) // expected-error {{requires attribute 'map'}}
@@ -9,7 +9,7 @@ func @affine_apply_no_map() {
// -----
func @affine_apply_wrong_operand_count() {
func.func @affine_apply_wrong_operand_count() {
^bb0:
%i = arith.constant 0 : index
%x = "affine.apply" (%i) {map = affine_map<(d0, d1) -> ((d0 + 1), (d1 + 2))>} : (index) -> (index) // expected-error {{'affine.apply' op operand count and affine map dimension and symbol count must match}}
@@ -18,7 +18,7 @@ func @affine_apply_wrong_operand_count() {
// -----
func @affine_apply_wrong_result_count() {
func.func @affine_apply_wrong_result_count() {
^bb0:
%i = arith.constant 0 : index
%j = arith.constant 1 : index
@@ -28,7 +28,7 @@ func @affine_apply_wrong_result_count() {
// -----
func @unknown_custom_op() {
func.func @unknown_custom_op() {
^bb0:
%i = test.crazyThing() {value = 0} : () -> index // expected-error {{custom op 'test.crazyThing' is unknown}}
return
@@ -36,7 +36,7 @@ func @unknown_custom_op() {
// -----
func @unknown_std_op() {
func.func @unknown_std_op() {
// expected-error@+1 {{unregistered operation 'func.foo_bar_op' found in dialect ('func') that does not allow unknown operations}}
%0 = "func.foo_bar_op"() : () -> index
return
@@ -44,14 +44,14 @@ func @unknown_std_op() {
// -----
func @calls(%arg0: i32) {
func.func @calls(%arg0: i32) {
%x = call @calls() : () -> i32 // expected-error {{incorrect number of operands for callee}}
return
}
// -----
func @func_with_ops(i32, i32, i32) {
func.func @func_with_ops(i32, i32, i32) {
^bb0(%cond : i32, %t : i32, %f : i32):
// expected-error@+2 {{different type than prior uses}}
// expected-note@-2 {{prior use here}}
@@ -60,7 +60,7 @@ func @func_with_ops(i32, i32, i32) {
// -----
func @func_with_ops(i32, i32, i32) {
func.func @func_with_ops(i32, i32, i32) {
^bb0(%cond : i32, %t : i32, %f : i32):
// expected-error@+1 {{op operand #0 must be bool-like}}
%r = "arith.select"(%cond, %t, %f) : (i32, i32, i32) -> i32
@@ -68,7 +68,7 @@ func @func_with_ops(i32, i32, i32) {
// -----
func @func_with_ops(i1, i32, i64) {
func.func @func_with_ops(i1, i32, i64) {
^bb0(%cond : i1, %t : i32, %f : i64):
// TODO: expand post change in verification order. This is currently only
// verifying that the type verification is failing but not the specific error
@@ -80,7 +80,7 @@ func @func_with_ops(i1, i32, i64) {
// -----
func @func_with_ops(vector<12xi1>, vector<42xi32>, vector<42xi32>) {
func.func @func_with_ops(vector<12xi1>, vector<42xi32>, vector<42xi32>) {
^bb0(%cond : vector<12xi1>, %t : vector<42xi32>, %f : vector<42xi32>):
// expected-error@+1 {{all non-scalar operands/results must have the same shape and base type}}
%r = "arith.select"(%cond, %t, %f) : (vector<12xi1>, vector<42xi32>, vector<42xi32>) -> vector<42xi32>
@@ -88,7 +88,7 @@ func @func_with_ops(vector<12xi1>, vector<42xi32>, vector<42xi32>) {
// -----
func @func_with_ops(tensor<12xi1>, tensor<42xi32>, tensor<42xi32>) {
func.func @func_with_ops(tensor<12xi1>, tensor<42xi32>, tensor<42xi32>) {
^bb0(%cond : tensor<12xi1>, %t : tensor<42xi32>, %f : tensor<42xi32>):
// expected-error@+1 {{all non-scalar operands/results must have the same shape and base type}}
%r = "arith.select"(%cond, %t, %f) : (tensor<12xi1>, tensor<42xi32>, tensor<42xi32>) -> tensor<42xi32>
@@ -96,7 +96,7 @@ func @func_with_ops(tensor<12xi1>, tensor<42xi32>, tensor<42xi32>) {
// -----
func @return_not_in_function() {
func.func @return_not_in_function() {
"foo.region"() ({
// expected-error@+1 {{'func.return' op expects parent op 'func.func'}}
return
@@ -106,7 +106,7 @@ func @return_not_in_function() {
// -----
func @invalid_splat(%v : f32) { // expected-note {{prior use here}}
func.func @invalid_splat(%v : f32) { // expected-note {{prior use here}}
vector.splat %v : vector<8xf64>
// expected-error@-1 {{expects different type than prior uses}}
return

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
#set0 = affine_set<(d0) : (1 == 0)>
// CHECK-LABEL: func @inline_notation
func @inline_notation() -> i32 {
func.func @inline_notation() -> i32 {
// CHECK: -> i32 loc("foo")
%1 = "foo"() : () -> i32 loc("foo")
@@ -30,11 +30,11 @@ func @inline_notation() -> i32 {
}
// CHECK-LABEL: func private @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))})
func private @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))})
func.func private @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))})
// Check that locations get properly escaped.
// CHECK-LABEL: func @escape_strings()
func @escape_strings() {
func.func @escape_strings() {
// CHECK: loc("escaped\0A")
"foo"() : () -> () loc("escaped\n")
@@ -50,8 +50,8 @@ func @escape_strings() {
"foo.op"() : () -> () loc(#loc)
// CHECK-LABEL: func @argLocs(
// CHECK-SAME: %arg0: i32 loc({{.*}}locations.mlir":[[# @LINE+1]]:15),
func @argLocs(%x: i32,
// CHECK-SAME: %arg0: i32 loc({{.*}}locations.mlir":[[# @LINE+1]]:20),
func.func @argLocs(%x: i32,
// CHECK-SAME: %arg1: i64 loc("hotdog")
%y: i64 loc("hotdog")) {
return
@@ -74,7 +74,7 @@ func @argLocs(%x: i32,
}) : () -> ()
// CHECK-LABEL: func @location_name_child_is_name
func @location_name_child_is_name() {
func.func @location_name_child_is_name() {
// CHECK: "foo"("foo")
return loc("foo"("foo"))
}

View File

@@ -3,7 +3,7 @@
// CHECK: #map = affine_map<(d0, d1)[s0] -> (d0 + s0, d1)>
// CHECK-LABEL: func @alloc() {
func @alloc() {
func.func @alloc() {
^bb0:
// Test simple alloc.
// CHECK: %0 = memref.alloc() : memref<1024x64xf32, 1>
@@ -34,7 +34,7 @@ func @alloc() {
}
// CHECK-LABEL: func @alloca() {
func @alloca() {
func.func @alloca() {
^bb0:
// Test simple alloc.
// CHECK: %0 = memref.alloca() : memref<1024x64xf32, 1>
@@ -63,7 +63,7 @@ func @alloca() {
}
// CHECK-LABEL: func @dealloc() {
func @dealloc() {
func.func @dealloc() {
^bb0:
// CHECK: %0 = memref.alloc() : memref<1024x64xf32>
%0 = memref.alloc() : memref<1024x64xf32, affine_map<(d0, d1) -> (d0, d1)>, 0>
@@ -74,7 +74,7 @@ func @dealloc() {
}
// CHECK-LABEL: func @load_store
func @load_store() {
func.func @load_store() {
^bb0:
// CHECK: %0 = memref.alloc() : memref<1024x64xf32, 1>
%0 = memref.alloc() : memref<1024x64xf32, affine_map<(d0, d1) -> (d0, d1)>, 1>
@@ -92,7 +92,7 @@ func @load_store() {
}
// CHECK-LABEL: func @dma_ops()
func @dma_ops() {
func.func @dma_ops() {
%c0 = arith.constant 0 : index
%stride = arith.constant 32 : index
%elt_per_stride = arith.constant 16 : index

View File

@@ -1,6 +1,6 @@
// RUN: mlir-opt -allow-unregistered-dialect -print-op-stats %s -o=/dev/null 2>&1 | FileCheck %s
func @main(tensor<4xf32>, tensor<4xf32>) -> tensor<4xf32> {
func.func @main(tensor<4xf32>, tensor<4xf32>) -> tensor<4xf32> {
^bb0(%arg0: tensor<4xf32>, %arg1: tensor<4xf32>):
%0 = arith.addf %arg0, %arg1 : tensor<4xf32>
%1 = arith.addf %arg0, %arg1 : tensor<4xf32>

View File

@@ -11,7 +11,7 @@
// CHECK: MyLocation: 1: 'arith.constant' op
// CHECK-LABEL: func @inline_notation
func @inline_notation() -> i32 {
func.func @inline_notation() -> i32 {
// CHECK: -> i32 loc("foo")
// CHECK: -> i32 loc("foo")
// CHECK: -> i32 loc(unknown)

View File

@@ -4,7 +4,7 @@
// Test mixed normal and variadic operands
//===----------------------------------------------------------------------===//
func @correct_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
func.func @correct_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
// CHECK: mixed_normal_variadic_operand
"test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg0, %arg0, %arg0) : (tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>) -> ()
return
@@ -12,7 +12,7 @@ func @correct_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
// -----
func @error_in_first_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
func.func @error_in_first_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
// expected-error @+1 {{operand #1 must be tensor of any type}}
"test.mixed_normal_variadic_operand"(%arg0, %arg1, %arg0, %arg0, %arg0) : (tensor<f32>, f32, tensor<f32>, tensor<f32>, tensor<f32>) -> ()
return
@@ -20,7 +20,7 @@ func @error_in_first_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
// -----
func @error_in_normal_operand(%arg0: tensor<f32>, %arg1: f32) {
func.func @error_in_normal_operand(%arg0: tensor<f32>, %arg1: f32) {
// expected-error @+1 {{operand #2 must be tensor of any type}}
"test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg1, %arg0, %arg0) : (tensor<f32>, tensor<f32>, f32, tensor<f32>, tensor<f32>) -> ()
return
@@ -28,7 +28,7 @@ func @error_in_normal_operand(%arg0: tensor<f32>, %arg1: f32) {
// -----
func @error_in_second_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
func.func @error_in_second_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
// expected-error @+1 {{operand #3 must be tensor of any type}}
"test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg0, %arg1, %arg0) : (tensor<f32>, tensor<f32>, tensor<f32>, f32, tensor<f32>) -> ()
return
@@ -36,10 +36,10 @@ func @error_in_second_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
// -----
func @testfunc(%arg0: i32) {
func.func @testfunc(%arg0: i32) {
return
}
func @invalid_call_operandtype() {
func.func @invalid_call_operandtype() {
%0 = arith.constant 0.0 : f32
// expected-error @+1 {{operand type mismatch: expected operand type 'i32', but provided 'f32' for operand number 0}}
call @testfunc(%0) : (f32) -> ()

View File

@@ -44,124 +44,124 @@
// CHECK-DAG: #set{{[0-9]+}} = affine_set<(d0)[s0] : (d0 - 2 >= 0, -d0 + 4 >= 0)>
// CHECK: func private @foo(i32, i64) -> f32
func private @foo(i32, i64) -> f32
func.func private @foo(i32, i64) -> f32
// CHECK: func private @bar()
func private @bar() -> ()
func.func private @bar() -> ()
// CHECK: func private @baz() -> (i1, index, f32)
func private @baz() -> (i1, index, f32)
func.func private @baz() -> (i1, index, f32)
// CHECK: func private @missingReturn()
func private @missingReturn()
func.func private @missingReturn()
// CHECK: func private @int_types(i0, i1, i2, i4, i7, i87) -> (i1, index, i19)
func private @int_types(i0, i1, i2, i4, i7, i87) -> (i1, index, i19)
func.func private @int_types(i0, i1, i2, i4, i7, i87) -> (i1, index, i19)
// CHECK: func private @sint_types(si2, si4) -> (si7, si1023)
func private @sint_types(si2, si4) -> (si7, si1023)
func.func private @sint_types(si2, si4) -> (si7, si1023)
// CHECK: func private @uint_types(ui2, ui4) -> (ui7, ui1023)
func private @uint_types(ui2, ui4) -> (ui7, ui1023)
func.func private @uint_types(ui2, ui4) -> (ui7, ui1023)
// CHECK: func private @float_types(f80, f128)
func private @float_types(f80, f128)
func.func private @float_types(f80, f128)
// CHECK: func private @vectors(vector<f32>, vector<1xf32>, vector<2x4xf32>)
func private @vectors(vector<f32>, vector<1 x f32>, vector<2x4xf32>)
func.func private @vectors(vector<f32>, vector<1 x f32>, vector<2x4xf32>)
// CHECK: func private @tensors(tensor<*xf32>, tensor<*xvector<2x4xf32>>, tensor<1x?x4x?x?xi32>, tensor<i8>)
func private @tensors(tensor<* x f32>, tensor<* x vector<2x4xf32>>,
func.func private @tensors(tensor<* x f32>, tensor<* x vector<2x4xf32>>,
tensor<1x?x4x?x?xi32>, tensor<i8>)
// CHECK: func private @tensor_encoding(tensor<16x32xf64, "sparse">)
func private @tensor_encoding(tensor<16x32xf64, "sparse">)
func.func private @tensor_encoding(tensor<16x32xf64, "sparse">)
// CHECK: func private @large_shape_dimension(tensor<9223372036854775807xf32>)
func private @large_shape_dimension(tensor<9223372036854775807xf32>)
func.func private @large_shape_dimension(tensor<9223372036854775807xf32>)
// CHECK: func private @functions((memref<1x?x4x?x?xi32, #map0>, memref<8xi8>) -> (), () -> ())
func private @functions((memref<1x?x4x?x?xi32, #map0, 0>, memref<8xi8, #map1, 0>) -> (), ()->())
func.func private @functions((memref<1x?x4x?x?xi32, #map0, 0>, memref<8xi8, #map1, 0>) -> (), ()->())
// CHECK: func private @memrefs2(memref<2x4x8xi8, 1>)
func private @memrefs2(memref<2x4x8xi8, #map2, 1>)
func.func private @memrefs2(memref<2x4x8xi8, #map2, 1>)
// CHECK: func private @memrefs3(memref<2x4x8xi8>)
func private @memrefs3(memref<2x4x8xi8, affine_map<(d0, d1, d2) -> (d0, d1, d2)>>)
func.func private @memrefs3(memref<2x4x8xi8, affine_map<(d0, d1, d2) -> (d0, d1, d2)>>)
// CHECK: func private @memrefs_drop_triv_id_inline(memref<2xi8>)
func private @memrefs_drop_triv_id_inline(memref<2xi8, affine_map<(d0) -> (d0)>>)
func.func private @memrefs_drop_triv_id_inline(memref<2xi8, affine_map<(d0) -> (d0)>>)
// CHECK: func private @memrefs_drop_triv_id_inline0(memref<2xi8>)
func private @memrefs_drop_triv_id_inline0(memref<2xi8, affine_map<(d0) -> (d0)>, 0>)
func.func private @memrefs_drop_triv_id_inline0(memref<2xi8, affine_map<(d0) -> (d0)>, 0>)
// CHECK: func private @memrefs_drop_triv_id_inline1(memref<2xi8, 1>)
func private @memrefs_drop_triv_id_inline1(memref<2xi8, affine_map<(d0) -> (d0)>, 1>)
func.func private @memrefs_drop_triv_id_inline1(memref<2xi8, affine_map<(d0) -> (d0)>, 1>)
// Test memref with custom memory space
// CHECK: func private @memrefs_nomap_nospace(memref<5x6x7xf32>)
func private @memrefs_nomap_nospace(memref<5x6x7xf32>)
func.func private @memrefs_nomap_nospace(memref<5x6x7xf32>)
// CHECK: func private @memrefs_map_nospace(memref<5x6x7xf32, #map{{[0-9]+}}>)
func private @memrefs_map_nospace(memref<5x6x7xf32, #map3>)
func.func private @memrefs_map_nospace(memref<5x6x7xf32, #map3>)
// CHECK: func private @memrefs_nomap_intspace(memref<5x6x7xf32, 3>)
func private @memrefs_nomap_intspace(memref<5x6x7xf32, 3>)
func.func private @memrefs_nomap_intspace(memref<5x6x7xf32, 3>)
// CHECK: func private @memrefs_map_intspace(memref<5x6x7xf32, #map{{[0-9]+}}, 5>)
func private @memrefs_map_intspace(memref<5x6x7xf32, #map3, 5>)
func.func private @memrefs_map_intspace(memref<5x6x7xf32, #map3, 5>)
// CHECK: func private @memrefs_nomap_strspace(memref<5x6x7xf32, "local">)
func private @memrefs_nomap_strspace(memref<5x6x7xf32, "local">)
func.func private @memrefs_nomap_strspace(memref<5x6x7xf32, "local">)
// CHECK: func private @memrefs_map_strspace(memref<5x6x7xf32, #map{{[0-9]+}}, "private">)
func private @memrefs_map_strspace(memref<5x6x7xf32, #map3, "private">)
func.func private @memrefs_map_strspace(memref<5x6x7xf32, #map3, "private">)
// CHECK: func private @memrefs_nomap_dictspace(memref<5x6x7xf32, {memSpace = "special", subIndex = 1 : i64}>)
func private @memrefs_nomap_dictspace(memref<5x6x7xf32, {memSpace = "special", subIndex = 1}>)
func.func private @memrefs_nomap_dictspace(memref<5x6x7xf32, {memSpace = "special", subIndex = 1}>)
// CHECK: func private @memrefs_map_dictspace(memref<5x6x7xf32, #map{{[0-9]+}}, {memSpace = "special", subIndex = 3 : i64}>)
func private @memrefs_map_dictspace(memref<5x6x7xf32, #map3, {memSpace = "special", subIndex = 3}>)
func.func private @memrefs_map_dictspace(memref<5x6x7xf32, #map3, {memSpace = "special", subIndex = 3}>)
// CHECK: func private @complex_types(complex<i1>) -> complex<f32>
func private @complex_types(complex<i1>) -> complex<f32>
func.func private @complex_types(complex<i1>) -> complex<f32>
// CHECK: func private @memref_with_index_elems(memref<1x?xindex>)
func private @memref_with_index_elems(memref<1x?xindex>)
func.func private @memref_with_index_elems(memref<1x?xindex>)
// CHECK: func private @memref_with_complex_elems(memref<1x?xcomplex<f32>>)
func private @memref_with_complex_elems(memref<1x?xcomplex<f32>>)
func.func private @memref_with_complex_elems(memref<1x?xcomplex<f32>>)
// CHECK: func private @memref_with_vector_elems(memref<1x?xvector<10xf32>>)
func private @memref_with_vector_elems(memref<1x?xvector<10xf32>>)
func.func private @memref_with_vector_elems(memref<1x?xvector<10xf32>>)
// CHECK: func private @memref_with_custom_elem(memref<1x?x!test.memref_element>)
func private @memref_with_custom_elem(memref<1x?x!test.memref_element>)
func.func private @memref_with_custom_elem(memref<1x?x!test.memref_element>)
// CHECK: func private @memref_of_memref(memref<1xmemref<1xf64>>)
func private @memref_of_memref(memref<1xmemref<1xf64>>)
func.func private @memref_of_memref(memref<1xmemref<1xf64>>)
// CHECK: func private @memref_of_unranked_memref(memref<1xmemref<*xf32>>)
func private @memref_of_unranked_memref(memref<1xmemref<*xf32>>)
func.func private @memref_of_unranked_memref(memref<1xmemref<*xf32>>)
// CHECK: func private @unranked_memref_of_memref(memref<*xmemref<1xf32>>)
func private @unranked_memref_of_memref(memref<*xmemref<1xf32>>)
func.func private @unranked_memref_of_memref(memref<*xmemref<1xf32>>)
// CHECK: func private @unranked_memref_of_unranked_memref(memref<*xmemref<*xi32>>)
func private @unranked_memref_of_unranked_memref(memref<*xmemref<*xi32>>)
func.func private @unranked_memref_of_unranked_memref(memref<*xmemref<*xi32>>)
// CHECK: func private @unranked_memref_with_complex_elems(memref<*xcomplex<f32>>)
func private @unranked_memref_with_complex_elems(memref<*xcomplex<f32>>)
func.func private @unranked_memref_with_complex_elems(memref<*xcomplex<f32>>)
// CHECK: func private @unranked_memref_with_index_elems(memref<*xindex>)
func private @unranked_memref_with_index_elems(memref<*xindex>)
func.func private @unranked_memref_with_index_elems(memref<*xindex>)
// CHECK: func private @unranked_memref_with_vector_elems(memref<*xvector<10xf32>>)
func private @unranked_memref_with_vector_elems(memref<*xvector<10xf32>>)
func.func private @unranked_memref_with_vector_elems(memref<*xvector<10xf32>>)
// CHECK-LABEL: func @simpleCFG(%{{.*}}: i32, %{{.*}}: f32) -> i1 {
func @simpleCFG(%arg0: i32, %f: f32) -> i1 {
func.func @simpleCFG(%arg0: i32, %f: f32) -> i1 {
// CHECK: %{{.*}} = "foo"() : () -> i64
%1 = "foo"() : ()->i64
// CHECK: "bar"(%{{.*}}) : (i64) -> (i1, i1, i1)
@@ -172,7 +172,7 @@ func @simpleCFG(%arg0: i32, %f: f32) -> i1 {
}
// CHECK-LABEL: func @simpleCFGUsingBBArgs(%{{.*}}: i32, %{{.*}}: i64) {
func @simpleCFGUsingBBArgs(i32, i64) {
func.func @simpleCFGUsingBBArgs(i32, i64) {
^bb42 (%arg0: i32, %f: i64):
// CHECK: "bar"(%{{.*}}) : (i64) -> (i1, i1, i1)
%2:3 = "bar"(%f) : (i64) -> (i1,i1,i1)
@@ -182,13 +182,13 @@ func @simpleCFGUsingBBArgs(i32, i64) {
}
// CHECK-LABEL: func @block_label_empty_list
func @block_label_empty_list() {
func.func @block_label_empty_list() {
^bb0():
return
}
// CHECK-LABEL: func @multiblock() {
func @multiblock() {
func.func @multiblock() {
return // CHECK: return
^bb1: // CHECK: ^bb1: // no predecessors
cf.br ^bb4 // CHECK: cf.br ^bb3
@@ -199,26 +199,26 @@ func @multiblock() {
} // CHECK: }
// CHECK-LABEL: func @emptyMLF() {
func @emptyMLF() {
func.func @emptyMLF() {
return // CHECK: return
} // CHECK: }
// CHECK-LABEL: func @func_with_one_arg(%{{.*}}: i1) -> i2 {
func @func_with_one_arg(%c : i1) -> i2 {
func.func @func_with_one_arg(%c : i1) -> i2 {
// CHECK: %{{.*}} = "foo"(%{{.*}}) : (i1) -> i2
%b = "foo"(%c) : (i1) -> (i2)
return %b : i2 // CHECK: return %{{.*}} : i2
} // CHECK: }
// CHECK-LABEL: func @func_with_two_args(%{{.*}}: f16, %{{.*}}: i8) -> (i1, i32) {
func @func_with_two_args(%a : f16, %b : i8) -> (i1, i32) {
func.func @func_with_two_args(%a : f16, %b : i8) -> (i1, i32) {
// CHECK: %{{.*}}:2 = "foo"(%{{.*}}, %{{.*}}) : (f16, i8) -> (i1, i32)
%c:2 = "foo"(%a, %b) : (f16, i8)->(i1, i32)
return %c#0, %c#1 : i1, i32 // CHECK: return %{{.*}}#0, %{{.*}}#1 : i1, i32
} // CHECK: }
// CHECK-LABEL: func @second_order_func() -> (() -> ()) {
func @second_order_func() -> (() -> ()) {
func.func @second_order_func() -> (() -> ()) {
// CHECK-NEXT: %{{.*}} = constant @emptyMLF : () -> ()
%c = constant @emptyMLF : () -> ()
// CHECK-NEXT: return %{{.*}} : () -> ()
@@ -226,7 +226,7 @@ func @second_order_func() -> (() -> ()) {
}
// CHECK-LABEL: func @third_order_func() -> (() -> (() -> ())) {
func @third_order_func() -> (() -> (() -> ())) {
func.func @third_order_func() -> (() -> (() -> ())) {
// CHECK-NEXT: %{{.*}} = constant @second_order_func : () -> (() -> ())
%c = constant @second_order_func : () -> (() -> ())
// CHECK-NEXT: return %{{.*}} : () -> (() -> ())
@@ -234,13 +234,13 @@ func @third_order_func() -> (() -> (() -> ())) {
}
// CHECK-LABEL: func @identity_functor(%{{.*}}: () -> ()) -> (() -> ()) {
func @identity_functor(%a : () -> ()) -> (() -> ()) {
func.func @identity_functor(%a : () -> ()) -> (() -> ()) {
// CHECK-NEXT: return %{{.*}} : () -> ()
return %a : () -> ()
}
// CHECK-LABEL: func @func_ops_in_loop() {
func @func_ops_in_loop() {
func.func @func_ops_in_loop() {
// CHECK: %{{.*}} = "foo"() : () -> i64
%a = "foo"() : ()->i64
// CHECK: affine.for %{{.*}} = 1 to 10 {
@@ -258,7 +258,7 @@ func @func_ops_in_loop() {
// CHECK-LABEL: func @loops() {
func @loops() {
func.func @loops() {
// CHECK: affine.for %{{.*}} = 1 to 100 step 2 {
affine.for %i = 1 to 100 step 2 {
// CHECK: affine.for %{{.*}} = 1 to 200 {
@@ -269,7 +269,7 @@ func @loops() {
} // CHECK: }
// CHECK-LABEL: func @complex_loops() {
func @complex_loops() {
func.func @complex_loops() {
affine.for %i1 = 1 to 100 { // CHECK: affine.for %{{.*}} = 1 to 100 {
affine.for %j1 = 1 to 100 { // CHECK: affine.for %{{.*}} = 1 to 100 {
// CHECK: "foo"(%{{.*}}, %{{.*}}) : (index, index) -> ()
@@ -286,7 +286,7 @@ func @complex_loops() {
} // CHECK: }
// CHECK: func @triang_loop(%{{.*}}: index, %{{.*}}: memref<?x?xi32>) {
func @triang_loop(%arg0: index, %arg1: memref<?x?xi32>) {
func.func @triang_loop(%arg0: index, %arg1: memref<?x?xi32>) {
%c = arith.constant 0 : i32 // CHECK: %{{.*}} = arith.constant 0 : i32
affine.for %i0 = 1 to %arg0 { // CHECK: affine.for %{{.*}} = 1 to %{{.*}} {
affine.for %i1 = affine_map<(d0)[]->(d0)>(%i0)[] to %arg0 { // CHECK: affine.for %{{.*}} = #map{{[0-9]+}}(%{{.*}}) to %{{.*}} {
@@ -297,7 +297,7 @@ func @triang_loop(%arg0: index, %arg1: memref<?x?xi32>) {
} // CHECK: }
// CHECK: func @minmax_loop(%{{.*}}: index, %{{.*}}: index, %{{.*}}: memref<100xf32>) {
func @minmax_loop(%arg0: index, %arg1: index, %arg2: memref<100xf32>) {
func.func @minmax_loop(%arg0: index, %arg1: index, %arg2: memref<100xf32>) {
// CHECK: affine.for %{{.*}} = max #map{{.*}}()[%{{.*}}] to min #map{{.*}}()[%{{.*}}] {
affine.for %i0 = max affine_map<()[s]->(0,s-1)>()[%arg0] to min affine_map<()[s]->(100,s+1)>()[%arg1] {
// CHECK: "foo"(%{{.*}}, %{{.*}}) : (memref<100xf32>, index) -> ()
@@ -307,7 +307,7 @@ func @minmax_loop(%arg0: index, %arg1: index, %arg2: memref<100xf32>) {
} // CHECK: }
// CHECK-LABEL: func @loop_bounds(%{{.*}}: index) {
func @loop_bounds(%N : index) {
func.func @loop_bounds(%N : index) {
// CHECK: %{{.*}} = "foo"(%{{.*}}) : (index) -> index
%s = "foo"(%N) : (index) -> index
// CHECK: affine.for %{{.*}} = %{{.*}} to %{{.*}}
@@ -338,7 +338,7 @@ func @loop_bounds(%N : index) {
} // CHECK: }
// CHECK-LABEL: func @ifinst(%{{.*}}: index) {
func @ifinst(%N: index) {
func.func @ifinst(%N: index) {
%c = arith.constant 200 : index // CHECK %{{.*}} = arith.constant 200
affine.for %i = 1 to 10 { // CHECK affine.for %{{.*}} = 1 to 10 {
affine.if #set0(%i)[%N, %c] { // CHECK affine.if #set0(%{{.*}})[%{{.*}}, %{{.*}}] {
@@ -361,7 +361,7 @@ func @ifinst(%N: index) {
} // CHECK }
// CHECK-LABEL: func @simple_ifinst(%{{.*}}: index) {
func @simple_ifinst(%N: index) {
func.func @simple_ifinst(%N: index) {
%c = arith.constant 200 : index // CHECK %{{.*}} = arith.constant 200
affine.for %i = 1 to 10 { // CHECK affine.for %{{.*}} = 1 to 10 {
affine.if #set0(%i)[%N, %c] { // CHECK affine.if #set0(%{{.*}})[%{{.*}}, %{{.*}}] {
@@ -375,7 +375,7 @@ func @simple_ifinst(%N: index) {
} // CHECK }
// CHECK-LABEL: func @attributes() {
func @attributes() {
func.func @attributes() {
// CHECK: "foo"()
"foo"(){} : ()->()
@@ -419,7 +419,7 @@ func @attributes() {
}
// CHECK-LABEL: func @ssa_values() -> (i16, i8) {
func @ssa_values() -> (i16, i8) {
func.func @ssa_values() -> (i16, i8) {
// CHECK: %{{.*}}:2 = "foo"() : () -> (i1, i17)
%0:2 = "foo"() : () -> (i1, i17)
cf.br ^bb2
@@ -438,7 +438,7 @@ func @ssa_values() -> (i16, i8) {
}
// CHECK-LABEL: func @bbargs() -> (i16, i8) {
func @bbargs() -> (i16, i8) {
func.func @bbargs() -> (i16, i8) {
// CHECK: %{{.*}}:2 = "foo"() : () -> (i1, i17)
%0:2 = "foo"() : () -> (i1, i17)
cf.br ^bb1(%0#1, %0#0 : i17, i1)
@@ -450,7 +450,7 @@ func @bbargs() -> (i16, i8) {
}
// CHECK-LABEL: func @verbose_terminators() -> (i1, i17)
func @verbose_terminators() -> (i1, i17) {
func.func @verbose_terminators() -> (i1, i17) {
%0:2 = "foo"() : () -> (i1, i17)
// CHECK: cf.br ^bb1(%{{.*}}#0, %{{.*}}#1 : i1, i17)
"cf.br"(%0#0, %0#1)[^bb1] : (i1, i17) -> ()
@@ -470,7 +470,7 @@ func @verbose_terminators() -> (i1, i17) {
}
// CHECK-LABEL: func @condbr_simple
func @condbr_simple() -> (i32) {
func.func @condbr_simple() -> (i32) {
%cond = "foo"() : () -> i1
%a = "bar"() : () -> i32
%b = "bar"() : () -> i64
@@ -488,7 +488,7 @@ func @condbr_simple() -> (i32) {
}
// CHECK-LABEL: func @condbr_moarargs
func @condbr_moarargs() -> (i32) {
func.func @condbr_moarargs() -> (i32) {
%cond = "foo"() : () -> i1
%a = "bar"() : () -> i32
%b = "bar"() : () -> i64
@@ -506,7 +506,7 @@ func @condbr_moarargs() -> (i32) {
// Test pretty printing of constant names.
// CHECK-LABEL: func @constants
func @constants() -> (i32, i23, i23, i1, i1) {
func.func @constants() -> (i32, i23, i23, i1, i1) {
// CHECK: %{{.*}} = arith.constant 42 : i32
%x = arith.constant 42 : i32
// CHECK: %{{.*}} = arith.constant 17 : i23
@@ -531,7 +531,7 @@ func @constants() -> (i32, i23, i23, i1, i1) {
}
// CHECK-LABEL: func @typeattr
func @typeattr() -> () {
func.func @typeattr() -> () {
^bb0:
// CHECK: "foo"() {bar = tensor<*xf32>} : () -> ()
"foo"(){bar = tensor<*xf32>} : () -> ()
@@ -539,7 +539,7 @@ func @typeattr() -> () {
}
// CHECK-LABEL: func @stringquote
func @stringquote() -> () {
func.func @stringquote() -> () {
^bb0:
// CHECK: "foo"() {bar = "a\22quoted\22string"} : () -> ()
"foo"(){bar = "a\"quoted\"string"} : () -> ()
@@ -550,7 +550,7 @@ func @stringquote() -> () {
}
// CHECK-LABEL: func @unitAttrs
func @unitAttrs() -> () {
func.func @unitAttrs() -> () {
// CHECK-NEXT: "foo"() {unitAttr}
"foo"() {unitAttr = unit} : () -> ()
@@ -563,7 +563,7 @@ func @unitAttrs() -> () {
}
// CHECK-LABEL: func @floatAttrs
func @floatAttrs() -> () {
func.func @floatAttrs() -> () {
^bb0:
// CHECK: "foo"() {a = 4.000000e+00 : f64, b = 2.000000e+00 : f64, c = 7.100000e+00 : f64, d = -0.000000e+00 : f64} : () -> ()
"foo"(){a = 4.0, b = 2.0, c = 7.1, d = -0.0} : () -> ()
@@ -571,16 +571,16 @@ func @floatAttrs() -> () {
}
// CHECK-LABEL: func private @externalfuncattr
func private @externalfuncattr() -> ()
func.func private @externalfuncattr() -> ()
// CHECK: attributes {dialect.a = "a\22quoted\22string", dialect.b = 4.000000e+00 : f64, dialect.c = tensor<*xf32>}
attributes {dialect.a = "a\"quoted\"string", dialect.b = 4.0, dialect.c = tensor<*xf32>}
// CHECK-LABEL: func private @funcattrempty
func private @funcattrempty() -> ()
func.func private @funcattrempty() -> ()
attributes {}
// CHECK-LABEL: func private @funcattr
func private @funcattr() -> ()
func.func private @funcattr() -> ()
// CHECK: attributes {dialect.a = "a\22quoted\22string", dialect.b = 4.000000e+00 : f64, dialect.c = tensor<*xf32>}
attributes {dialect.a = "a\"quoted\"string", dialect.b = 4.0, dialect.c = tensor<*xf32>} {
^bb0:
@@ -588,7 +588,7 @@ func private @funcattr() -> ()
}
// CHECK-LABEL: func @funcattrwithblock
func @funcattrwithblock() -> ()
func.func @funcattrwithblock() -> ()
attributes {} {
^bb0:
return
@@ -601,7 +601,7 @@ func @funcattrwithblock() -> ()
#map_non_simple1 = affine_map<(d0)[s0] -> (d0 + s0)>
#map_non_simple2 = affine_map<()[s0, s1] -> (s0 + s1)>
#map_non_simple3 = affine_map<()[s0] -> (s0 + 3)>
func @funcsimplemap(%arg0: index, %arg1: index) -> () {
func.func @funcsimplemap(%arg0: index, %arg1: index) -> () {
affine.for %i0 = 0 to #map_simple0()[] {
// CHECK: affine.for %{{.*}} = 0 to 10 {
affine.for %i1 = 0 to #map_simple1()[%arg1] {
@@ -625,7 +625,7 @@ func @funcsimplemap(%arg0: index, %arg1: index) -> () {
}
// CHECK-LABEL: func @splattensorattr
func @splattensorattr() -> () {
func.func @splattensorattr() -> () {
^bb0:
// CHECK: "splatBoolTensor"() {bar = dense<false> : tensor<i1>} : () -> ()
"splatBoolTensor"(){bar = dense<false> : tensor<i1>} : () -> ()
@@ -653,7 +653,7 @@ func @splattensorattr() -> () {
}
// CHECK-LABEL: func @densetensorattr
func @densetensorattr() -> () {
func.func @densetensorattr() -> () {
^bb0:
// NOTE: The {{\[\[}} syntax is because "[[" confuses FileCheck.
@@ -731,7 +731,7 @@ func @densetensorattr() -> () {
}
// CHECK-LABEL: func @densevectorattr
func @densevectorattr() -> () {
func.func @densevectorattr() -> () {
^bb0:
// NOTE: The {{\[\[}} syntax is because "[[" confuses FileCheck.
// CHECK: "fooi8"() {bar = dense<5> : vector<1x1x1xi8>} : () -> ()
@@ -761,7 +761,7 @@ func @densevectorattr() -> () {
}
// CHECK-LABEL: func @sparsetensorattr
func @sparsetensorattr() -> () {
func.func @sparsetensorattr() -> () {
^bb0:
// NOTE: The {{\[\[}} syntax is because "[[" confuses FileCheck.
// CHECK: "fooi8"() {bar = sparse<0, -2> : tensor<1x1x1xi8>} : () -> ()
@@ -798,7 +798,7 @@ func @sparsetensorattr() -> () {
}
// CHECK-LABEL: func @sparsevectorattr
func @sparsevectorattr() -> () {
func.func @sparsevectorattr() -> () {
^bb0:
// NOTE: The {{\[\[}} syntax is because "[[" confuses FileCheck.
// CHECK: "fooi8"() {bar = sparse<0, -2> : vector<1x1x1xi8>} : () -> ()
@@ -820,7 +820,7 @@ func @sparsevectorattr() -> () {
}
// CHECK-LABEL: func @unknown_dialect_type() -> !bar<""> {
func @unknown_dialect_type() -> !bar<""> {
func.func @unknown_dialect_type() -> !bar<""> {
// Unregistered dialect 'bar'.
// CHECK: "foo"() : () -> !bar<"">
%0 = "foo"() : () -> !bar<"">
@@ -833,7 +833,7 @@ func @unknown_dialect_type() -> !bar<""> {
// CHECK-LABEL: func @type_alias() -> i32 {
!i32_type_alias = type i32
func @type_alias() -> !i32_type_alias {
func.func @type_alias() -> !i32_type_alias {
// Return a non-aliased i32 type.
%0 = "foo"() : () -> i32
@@ -841,7 +841,7 @@ func @type_alias() -> !i32_type_alias {
}
// CHECK-LABEL: func @no_integer_set_constraints(
func @no_integer_set_constraints() {
func.func @no_integer_set_constraints() {
// CHECK: affine.if [[$SET_TRUE]]() {
affine.if affine_set<() : ()> () {
}
@@ -849,7 +849,7 @@ func @no_integer_set_constraints() {
}
// CHECK-LABEL: func @verbose_if(
func @verbose_if(%N: index) {
func.func @verbose_if(%N: index) {
%c = arith.constant 200 : index
// CHECK: affine.if #set{{.*}}(%{{.*}})[%{{.*}}, %{{.*}}] {
@@ -868,7 +868,7 @@ func @verbose_if(%N: index) {
}
// CHECK-LABEL: func @terminator_with_regions
func @terminator_with_regions() {
func.func @terminator_with_regions() {
// Combine successors and regions in the same operation.
// CHECK: "region"()[^bb1] ({
// CHECK: }) : () -> ()
@@ -878,7 +878,7 @@ func @terminator_with_regions() {
}
// CHECK-LABEL: func @unregistered_term
func @unregistered_term(%arg0 : i1) -> i1 {
func.func @unregistered_term(%arg0 : i1) -> i1 {
// CHECK-NEXT: "unregistered_br"(%{{.*}})[^bb1] : (i1) -> ()
"unregistered_br"(%arg0)[^bb1] : (i1) -> ()
@@ -887,49 +887,49 @@ func @unregistered_term(%arg0 : i1) -> i1 {
}
// CHECK-LABEL: func @dialect_attrs
func @dialect_attrs()
func.func @dialect_attrs()
// CHECK: attributes {dialect.attr = 10
attributes {dialect.attr = 10} {
return
}
// CHECK-LABEL: func private @_valid.function$name
func private @_valid.function$name()
func.func private @_valid.function$name()
// CHECK-LABEL: func private @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32)
func private @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32)
func.func private @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32)
// CHECK-LABEL: func @func_arg_attrs(%{{.*}}: i1 {dialect.attr = 10 : i64})
func @func_arg_attrs(%arg0: i1 {dialect.attr = 10 : i64}) {
func.func @func_arg_attrs(%arg0: i1 {dialect.attr = 10 : i64}) {
return
}
// CHECK-LABEL: func @func_result_attrs({{.*}}) -> (f32 {dialect.attr = 1 : i64})
func @func_result_attrs(%arg0: f32) -> (f32 {dialect.attr = 1}) {
func.func @func_result_attrs(%arg0: f32) -> (f32 {dialect.attr = 1}) {
return %arg0 : f32
}
// CHECK-LABEL: func private @empty_tuple(tuple<>)
func private @empty_tuple(tuple<>)
func.func private @empty_tuple(tuple<>)
// CHECK-LABEL: func private @tuple_single_element(tuple<i32>)
func private @tuple_single_element(tuple<i32>)
func.func private @tuple_single_element(tuple<i32>)
// CHECK-LABEL: func private @tuple_multi_element(tuple<i32, i16, f32>)
func private @tuple_multi_element(tuple<i32, i16, f32>)
func.func private @tuple_multi_element(tuple<i32, i16, f32>)
// CHECK-LABEL: func private @tuple_nested(tuple<tuple<tuple<i32>>>)
func private @tuple_nested(tuple<tuple<tuple<i32>>>)
func.func private @tuple_nested(tuple<tuple<tuple<i32>>>)
// CHECK-LABEL: func @pretty_form_multi_result
func @pretty_form_multi_result() -> (i16, i16) {
func.func @pretty_form_multi_result() -> (i16, i16) {
// CHECK: %{{.*}}:2 = "foo_div"() : () -> (i16, i16)
%quot, %rem = "foo_div"() : () -> (i16, i16)
return %quot, %rem : i16, i16
}
// CHECK-LABEL: func @pretty_form_multi_result_groups
func @pretty_form_multi_result_groups() -> (i16, i16, i16, i16, i16) {
func.func @pretty_form_multi_result_groups() -> (i16, i16, i16, i16, i16) {
// CHECK: %[[RES:.*]]:5 =
// CHECK: return %[[RES]]#0, %[[RES]]#1, %[[RES]]#2, %[[RES]]#3, %[[RES]]#4
%group_1:2, %group_2, %group_3:2 = "foo_test"() : () -> (i16, i16, i16, i16, i16)
@@ -937,7 +937,7 @@ func @pretty_form_multi_result_groups() -> (i16, i16, i16, i16, i16) {
}
// CHECK-LABEL: func @pretty_dialect_attribute()
func @pretty_dialect_attribute() {
func.func @pretty_dialect_attribute() {
// CHECK: "foo.unknown_op"() {foo = #foo.simple_attr} : () -> ()
"foo.unknown_op"() {foo = #foo.simple_attr} : () -> ()
@@ -961,7 +961,7 @@ func @pretty_dialect_attribute() {
}
// CHECK-LABEL: func @pretty_dialect_type()
func @pretty_dialect_type() {
func.func @pretty_dialect_type() {
// CHECK: %{{.*}} = "foo.unknown_op"() : () -> !foo.simpletype
%0 = "foo.unknown_op"() : () -> !foo.simpletype
@@ -986,14 +986,14 @@ func @pretty_dialect_type() {
}
// CHECK-LABEL: func @none_type
func @none_type() {
func.func @none_type() {
// CHECK: "foo.unknown_op"() : () -> none
%none_val = "foo.unknown_op"() : () -> none
return
}
// CHECK-LABEL: func @scoped_names
func @scoped_names() {
func.func @scoped_names() {
// CHECK-NEXT: "foo.region_op"
"foo.region_op"() ({
// CHECK-NEXT: "foo.unknown_op"
@@ -1008,13 +1008,13 @@ func @scoped_names() {
}
// CHECK-LABEL: func @dialect_attribute_with_type
func @dialect_attribute_with_type() {
func.func @dialect_attribute_with_type() {
// CHECK-NEXT: foo = #foo.attr : i32
"foo.unknown_op"() {foo = #foo.attr : i32} : () -> ()
}
// CHECK-LABEL: @f16_special_values
func @f16_special_values() {
func.func @f16_special_values() {
// F16 NaNs.
// CHECK: arith.constant 0x7C01 : f16
%0 = arith.constant 0x7C01 : f16
@@ -1034,7 +1034,7 @@ func @f16_special_values() {
}
// CHECK-LABEL: @f32_special_values
func @f32_special_values() {
func.func @f32_special_values() {
// F32 signaling NaNs.
// CHECK: arith.constant 0x7F800001 : f32
%0 = arith.constant 0x7F800001 : f32
@@ -1058,7 +1058,7 @@ func @f32_special_values() {
}
// CHECK-LABEL: @f64_special_values
func @f64_special_values() {
func.func @f64_special_values() {
// F64 signaling NaNs.
// CHECK: arith.constant 0x7FF0000000000001 : f64
%0 = arith.constant 0x7FF0000000000001 : f64
@@ -1087,7 +1087,7 @@ func @f64_special_values() {
}
// CHECK-LABEL: @bfloat16_special_values
func @bfloat16_special_values() {
func.func @bfloat16_special_values() {
// bfloat16 signaling NaNs.
// CHECK: arith.constant 0x7F81 : bf16
%0 = arith.constant 0x7F81 : bf16
@@ -1114,14 +1114,14 @@ func @bfloat16_special_values() {
// but it may lead to precision loss when parsing back, in which case we print
// the decimal form instead.
// CHECK-LABEL: @f32_potential_precision_loss()
func @f32_potential_precision_loss() {
func.func @f32_potential_precision_loss() {
// CHECK: arith.constant -1.23697901 : f32
%0 = arith.constant -1.23697901 : f32
return
}
// CHECK-LABEL: @special_float_values_in_tensors
func @special_float_values_in_tensors() {
func.func @special_float_values_in_tensors() {
// CHECK: dense<0xFFFFFFFF> : tensor<4x4xf32>
"foo"(){bar = dense<0xFFFFFFFF> : tensor<4x4xf32>} : () -> ()
// CHECK: dense<[{{\[}}0xFFFFFFFF, 0x7F800000], [0x7FBFFFFF, 0x7F800001]]> : tensor<2x2xf32>
@@ -1137,7 +1137,7 @@ func @special_float_values_in_tensors() {
// delimiter.
// CHECK-LABEL: func @op_with_region_args
func @op_with_region_args() {
func.func @op_with_region_args() {
// CHECK: "test.polyfor"() ({
// CHECK-NEXT: ^bb{{.*}}(%{{.*}}: index, %{{.*}}: index, %{{.*}}: index):
test.polyfor %i, %j, %k {
@@ -1149,7 +1149,7 @@ func @op_with_region_args() {
// Test allowing different name scopes for regions isolated from above.
// CHECK-LABEL: func @op_with_passthrough_region_args
func @op_with_passthrough_region_args() {
func.func @op_with_passthrough_region_args() {
// CHECK: [[VAL:%.*]] = arith.constant
%0 = arith.constant 10 : index
@@ -1174,48 +1174,48 @@ func @op_with_passthrough_region_args() {
}
// CHECK-LABEL: func private @ptr_to_function() -> !unreg.ptr<() -> ()>
func private @ptr_to_function() -> !unreg.ptr<() -> ()>
func.func private @ptr_to_function() -> !unreg.ptr<() -> ()>
// CHECK-LABEL: func private @escaped_string_char(i1 {foo.value = "\0A"})
func private @escaped_string_char(i1 {foo.value = "\n"})
func.func private @escaped_string_char(i1 {foo.value = "\n"})
// CHECK-LABEL: func @parse_integer_literal_test
func @parse_integer_literal_test() {
func.func @parse_integer_literal_test() {
// CHECK: test.parse_integer_literal : 5
test.parse_integer_literal : 5
return
}
// CHECK-LABEL: func @parse_wrapped_keyword_test
func @parse_wrapped_keyword_test() {
func.func @parse_wrapped_keyword_test() {
// CHECK: test.parse_wrapped_keyword foo.keyword
test.parse_wrapped_keyword foo.keyword
return
}
// CHECK-LABEL: func @"\22_string_symbol_reference\22"
func @"\"_string_symbol_reference\""() {
func.func @"\"_string_symbol_reference\""() {
// CHECK: ref = @"\22_string_symbol_reference\22"
"foo.symbol_reference"() {ref = @"\"_string_symbol_reference\""} : () -> ()
return
}
// CHECK-LABEL: func private @parse_opaque_attr_escape
func private @parse_opaque_attr_escape() {
func.func private @parse_opaque_attr_escape() {
// CHECK: value = #foo<"\22escaped\\\0A\22">
"foo.constant"() {value = #foo<"\"escaped\\\n\"">} : () -> ()
}
// CHECK-LABEL: func private @string_attr_name
// CHECK-SAME: {"0 . 0", nested = {"0 . 0"}}
func private @string_attr_name() attributes {"0 . 0", nested = {"0 . 0"}}
func.func private @string_attr_name() attributes {"0 . 0", nested = {"0 . 0"}}
// CHECK-LABEL: func private @nested_reference
// CHECK: ref = @some_symbol::@some_nested_symbol
func private @nested_reference() attributes {test.ref = @some_symbol::@some_nested_symbol }
func.func private @nested_reference() attributes {test.ref = @some_symbol::@some_nested_symbol }
// CHECK-LABEL: func @custom_asm_names
func @custom_asm_names() -> (i32, i32, i32, i32, i32, i32) {
func.func @custom_asm_names() -> (i32, i32, i32, i32, i32, i32) {
// CHECK: %[[FIRST:first.*]], %[[MIDDLE:middle_results.*]]:2, %[[LAST:[0-9]+]]
%0, %1:2, %2 = "test.asm_interface_op"() : () -> (i32, i32, i32, i32)
@@ -1230,7 +1230,7 @@ func @custom_asm_names() -> (i32, i32, i32, i32, i32, i32) {
// CHECK-LABEL: func @pretty_names
// This tests the behavior
func @pretty_names() {
func.func @pretty_names() {
// Simple case, should parse and print as %x being an implied 'name'
// attribute.
%x = test.string_attr_pretty_name
@@ -1270,7 +1270,7 @@ func @pretty_names() {
// operations like `test.default_dialect` can define a default dialect
// used in nested region.
// CHECK-LABEL: func @default_dialect
func @default_dialect(%bool : i1) {
func.func @default_dialect(%bool : i1) {
test.default_dialect {
// The test dialect is the default in this region, the following two
// operations are parsed identically.
@@ -1290,7 +1290,7 @@ func @default_dialect(%bool : i1) {
}
// CHECK-LABEL: func @unreachable_dominance_violation_ok
func @unreachable_dominance_violation_ok() -> i1 {
func.func @unreachable_dominance_violation_ok() -> i1 {
// CHECK: [[VAL:%.*]] = arith.constant false
// CHECK: return [[VAL]] : i1
// CHECK: ^bb1: // no predecessors
@@ -1316,7 +1316,7 @@ func @unreachable_dominance_violation_ok() -> i1 {
}
// CHECK-LABEL: func @graph_region_in_hierarchy_ok
func @graph_region_in_hierarchy_ok() -> i64 {
func.func @graph_region_in_hierarchy_ok() -> i64 {
// CHECK: cf.br ^bb2
// CHECK: ^bb1:
// CHECK: test.graph_region {
@@ -1344,7 +1344,7 @@ func @graph_region_in_hierarchy_ok() -> i64 {
}
// CHECK-LABEL: func @graph_region_kind
func @graph_region_kind() -> () {
func.func @graph_region_kind() -> () {
// CHECK: [[VAL2:%.*]]:3 = "bar"([[VAL3:%.*]]) : (i64) -> (i1, i1, i1)
// CHECK: [[VAL3]] = "baz"([[VAL2]]#0) : (i1) -> i64
test.graph_region {
@@ -1356,7 +1356,7 @@ func @graph_region_kind() -> () {
}
// CHECK-LABEL: func @graph_region_inside_ssacfg_region
func @graph_region_inside_ssacfg_region() -> () {
func.func @graph_region_inside_ssacfg_region() -> () {
// CHECK: "test.ssacfg_region"
// CHECK: [[VAL3:%.*]] = "baz"() : () -> i64
// CHECK: test.graph_region {
@@ -1374,7 +1374,7 @@ func @graph_region_inside_ssacfg_region() -> () {
}
// CHECK-LABEL: func @graph_region_in_graph_region_ok
func @graph_region_in_graph_region_ok() -> () {
func.func @graph_region_in_graph_region_ok() -> () {
// CHECK: test.graph_region {
// CHECK: test.graph_region {
// CHECK: [[VAL2:%.*]]:3 = "bar"([[VAL3:%.*]]) : (i64) -> (i1, i1, i1)

View File

@@ -3,7 +3,7 @@
#set0 = affine_set<(d0) : (1 == 0)>
// CHECK-LABEL: func @inline_notation
func @inline_notation() -> i32 {
func.func @inline_notation() -> i32 {
// CHECK: -> i32 "foo"
%1 = "foo"() : () -> i32 loc("foo")

View File

@@ -1,7 +1,7 @@
// RUN: mlir-opt -allow-unregistered-dialect %s | FileCheck %s
// CHECK-LABEL: func @custom_region_names
func @custom_region_names() -> () {
func.func @custom_region_names() -> () {
"test.polyfor"() ({
^bb0(%arg0: index, %arg1: index, %arg2: index):
"foo"() : () -> ()
@@ -13,7 +13,7 @@ func @custom_region_names() -> () {
// CHECK-LABEL: func @weird_names
// Make sure the asmprinter handles weird names correctly.
func @weird_names() -> () {
func.func @weird_names() -> () {
"test.polyfor"() ({
^bb0(%arg0: i32, %arg1: i32, %arg2: index):
"foo"() : () -> i32

View File

@@ -4,7 +4,7 @@
// -----
func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
func.func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
// CHECK-CUSTOM: test.pretty_printed_region %arg1, %arg0 start special.op end : (f32, f32) -> f32
// CHECK-GENERIC: "test.pretty_printed_region"(%arg1, %arg0)
// CHECK-GENERIC: ^bb0(%arg[[x:[0-9]+]]: f32, %arg[[y:[0-9]+]]: f32
@@ -18,7 +18,7 @@ func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
// -----
func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
func.func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
// CHECK-CUSTOM: test.pretty_printed_region %arg1, %arg0
// CHECK-GENERIC: "test.pretty_printed_region"(%arg1, %arg0)
// CHECK: ^bb0(%arg[[x:[0-9]+]]: f32, %arg[[y:[0-9]+]]: f32):
@@ -36,7 +36,7 @@ func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
// -----
func @pretty_printed_region_op_deferred_loc(%arg0 : f32, %arg1 : f32) -> (f32) {
func.func @pretty_printed_region_op_deferred_loc(%arg0 : f32, %arg1 : f32) -> (f32) {
// CHECK-LOCATION: "test.pretty_printed_region"(%arg1, %arg0)
// CHECK-LOCATION: ^bb0(%arg[[x:[0-9]+]]: f32 loc("foo"), %arg[[y:[0-9]+]]: f32 loc("foo")
// CHECK-LOCATION: %[[RES:.*]] = "special.op"(%arg[[x]], %arg[[y]]) : (f32, f32) -> f32
@@ -53,7 +53,7 @@ func @pretty_printed_region_op_deferred_loc(%arg0 : f32, %arg1 : f32) -> (f32) {
// operations like `test.block_names` can define custom names for blocks in
// nested regions.
// CHECK-CUSTOM-LABEL: func @block_names
func @block_names(%bool : i1) {
func.func @block_names(%bool : i1) {
// CHECK: test.block_names
test.block_names {
// CHECK-CUSTOM: br ^foo1

View File

@@ -3,7 +3,7 @@
// CHECK-LABEL: func @pretty_names
// CHECK-GENERIC: "func"()
func @pretty_names() {
func.func @pretty_names() {
%x = test.string_attr_pretty_name
// CHECK: %x = test.string_attr_pretty_name
// GENERIC: %0 = "test.string_attr_pretty_name"()

View File

@@ -1,7 +1,7 @@
// RUN: mlir-opt %s -test-recursive-types | FileCheck %s
// CHECK-LABEL: @roundtrip
func @roundtrip() {
func.func @roundtrip() {
// CHECK: !test.test_rec<a, test_rec<b, test_type>>
"test.dummy_op_for_roundtrip"() : () -> !test.test_rec<a, test_rec<b, test_type>>
// CHECK: !test.test_rec<c, test_rec<c>>
@@ -10,7 +10,7 @@ func @roundtrip() {
}
// CHECK-LABEL: @create
func @create() {
func.func @create() {
// CHECK: !test.test_rec<some_long_and_unique_name, test_rec<some_long_and_unique_name>>
return
}

View File

@@ -4,7 +4,7 @@
// Test the number of regions
//===----------------------------------------------------------------------===//
func @correct_number_of_regions() {
func.func @correct_number_of_regions() {
// CHECK: test.two_region_op
"test.two_region_op"()(
{"work"() : () -> ()},
@@ -15,7 +15,7 @@ func @correct_number_of_regions() {
// -----
func @missing_regions() {
func.func @missing_regions() {
// expected-error@+1 {{expected 2 regions}}
"test.two_region_op"()(
{"work"() : () -> ()}
@@ -25,7 +25,7 @@ func @missing_regions() {
// -----
func @extra_regions() {
func.func @extra_regions() {
// expected-error@+1 {{expected 2 regions}}
"test.two_region_op"()(
{"work"() : () -> ()},
@@ -41,7 +41,7 @@ func @extra_regions() {
// Test SizedRegion
//===----------------------------------------------------------------------===//
func @unnamed_region_has_wrong_number_of_blocks() {
func.func @unnamed_region_has_wrong_number_of_blocks() {
// expected-error@+1 {{region #1 failed to verify constraint: region with 1 blocks}}
"test.sized_region_op"() (
{
@@ -62,7 +62,7 @@ func @unnamed_region_has_wrong_number_of_blocks() {
// -----
// Test region name in error message
func @named_region_has_wrong_number_of_blocks() {
func.func @named_region_has_wrong_number_of_blocks() {
// expected-error@+1 {{region #0 ('my_region') failed to verify constraint: region with 2 blocks}}
"test.sized_region_op"() (
{
@@ -87,18 +87,18 @@ func @named_region_has_wrong_number_of_blocks() {
// CHECK: test.single_no_terminator_op
"test.single_no_terminator_op"() (
{
func @foo1() { return }
func @foo2() { return }
func.func @foo1() { return }
func.func @foo2() { return }
}
) : () -> ()
// CHECK: test.variadic_no_terminator_op
"test.variadic_no_terminator_op"() (
{
func @foo1() { return }
func.func @foo1() { return }
},
{
func @foo2() { return }
func.func @foo2() { return }
}
) : () -> ()

View File

@@ -1,6 +1,6 @@
// RUN: mlir-opt %s | FileCheck %s
func @testType(tensor<1x224x224x3xf32>) -> tensor<96xf32> {
func.func @testType(tensor<1x224x224x3xf32>) -> tensor<96xf32> {
^bb0(%arg0: tensor<1x224x224x3xf32>):
%1 = "arith.constant"() {value = dense<0.1> : tensor<1xf32>} : () -> (tensor<1xf32>)
%2 = "arith.constant"() {value = dense<0.1> : tensor<2xf32>} : () -> (tensor<2xf32>)

View File

@@ -4,7 +4,7 @@
// Test mixed normal and variadic results
//===----------------------------------------------------------------------===//
func @correct_variadic_result() -> tensor<f32> {
func.func @correct_variadic_result() -> tensor<f32> {
// CHECK: mixed_normal_variadic_result
%0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>)
return %0#4 : tensor<f32>
@@ -12,7 +12,7 @@ func @correct_variadic_result() -> tensor<f32> {
// -----
func @error_in_first_variadic_result() -> tensor<f32> {
func.func @error_in_first_variadic_result() -> tensor<f32> {
// expected-error @+1 {{result #1 must be tensor of any type}}
%0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, f32, tensor<f32>, tensor<f32>, tensor<f32>)
return %0#4 : tensor<f32>
@@ -20,7 +20,7 @@ func @error_in_first_variadic_result() -> tensor<f32> {
// -----
func @error_in_normal_result() -> tensor<f32> {
func.func @error_in_normal_result() -> tensor<f32> {
// expected-error @+1 {{result #2 must be tensor of any type}}
%0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, f32, tensor<f32>, tensor<f32>)
return %0#4 : tensor<f32>
@@ -28,7 +28,7 @@ func @error_in_normal_result() -> tensor<f32> {
// -----
func @error_in_second_variadic_result() -> tensor<f32> {
func.func @error_in_second_variadic_result() -> tensor<f32> {
// expected-error @+1 {{result #3 must be tensor of any type}}
%0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, tensor<f32>, f32, tensor<f32>)
return %0#4 : tensor<f32>

View File

@@ -1,6 +1,6 @@
// RUN: mlir-opt -slice-analysis-test %s | FileCheck %s
func @slicing_linalg_op(%arg0 : index, %arg1 : index, %arg2 : index) {
func.func @slicing_linalg_op(%arg0 : index, %arg1 : index, %arg2 : index) {
%a = memref.alloc(%arg0, %arg2) : memref<?x?xf32>
%b = memref.alloc(%arg2, %arg1) : memref<?x?xf32>
%c = memref.alloc(%arg0, %arg1) : memref<?x?xf32>

View File

@@ -1,7 +1,7 @@
// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="func.func(test-clone)" -split-input-file
module {
func @fixpoint(%arg1 : i32) -> i32 {
func.func @fixpoint(%arg1 : i32) -> i32 {
%r = "test.use"(%arg1) ({
"test.yield"(%arg1) : (i32) -> ()
}) : (i32) -> i32

View File

@@ -2,7 +2,7 @@
// CHECK: func @f()
// CHECK-NOT: attributes{{.*}}arg
func @f(%arg0: f32 {test.erase_this_arg}) {
func.func @f(%arg0: f32 {test.erase_this_arg}) {
return
}
@@ -10,7 +10,7 @@ func @f(%arg0: f32 {test.erase_this_arg}) {
// CHECK: func @f(%arg0: f32 {test.A})
// CHECK-NOT: attributes{{.*}}arg
func @f(
func.func @f(
%arg0: f32 {test.erase_this_arg},
%arg1: f32 {test.A}) {
return
@@ -20,7 +20,7 @@ func @f(
// CHECK: func @f(%arg0: f32 {test.A})
// CHECK-NOT: attributes{{.*}}arg
func @f(
func.func @f(
%arg0: f32 {test.A},
%arg1: f32 {test.erase_this_arg}) {
return
@@ -30,7 +30,7 @@ func @f(
// CHECK: func @f(%arg0: f32 {test.A}, %arg1: f32 {test.B})
// CHECK-NOT: attributes{{.*}}arg
func @f(
func.func @f(
%arg0: f32 {test.A},
%arg1: f32 {test.erase_this_arg},
%arg2: f32 {test.B}) {
@@ -41,7 +41,7 @@ func @f(
// CHECK: func @f(%arg0: f32 {test.A}, %arg1: f32 {test.B})
// CHECK-NOT: attributes{{.*}}arg
func @f(
func.func @f(
%arg0: f32 {test.A},
%arg1: f32 {test.erase_this_arg},
%arg2: f32 {test.erase_this_arg},
@@ -53,7 +53,7 @@ func @f(
// CHECK: func @f(%arg0: f32 {test.A}, %arg1: f32 {test.B}, %arg2: f32 {test.C})
// CHECK-NOT: attributes{{.*}}arg
func @f(
func.func @f(
%arg0: f32 {test.A},
%arg1: f32 {test.erase_this_arg},
%arg2: f32 {test.B},
@@ -66,7 +66,7 @@ func @f(
// CHECK: func @f(%arg0: tensor<1xf32>, %arg1: tensor<2xf32>, %arg2: tensor<3xf32>)
// CHECK-NOT: attributes{{.*}}arg
func @f(
func.func @f(
%arg0: tensor<1xf32>,
%arg1: f32 {test.erase_this_arg},
%arg2: tensor<2xf32>,

View File

@@ -2,13 +2,13 @@
// CHECK: func private @f(){{$}}
// CHECK-NOT: attributes{{.*}}result
func private @f() -> (f32 {test.erase_this_result})
func.func private @f() -> (f32 {test.erase_this_result})
// -----
// CHECK: func private @f() -> (f32 {test.A})
// CHECK-NOT: attributes{{.*}}result
func private @f() -> (
func.func private @f() -> (
f32 {test.erase_this_result},
f32 {test.A}
)
@@ -17,7 +17,7 @@ func private @f() -> (
// CHECK: func private @f() -> (f32 {test.A})
// CHECK-NOT: attributes{{.*}}result
func private @f() -> (
func.func private @f() -> (
f32 {test.A},
f32 {test.erase_this_result}
)
@@ -26,7 +26,7 @@ func private @f() -> (
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B})
// CHECK-NOT: attributes{{.*}}result
func private @f() -> (
func.func private @f() -> (
f32 {test.A},
f32 {test.erase_this_result},
f32 {test.B}
@@ -36,7 +36,7 @@ func private @f() -> (
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B})
// CHECK-NOT: attributes{{.*}}result
func private @f() -> (
func.func private @f() -> (
f32 {test.A},
f32 {test.erase_this_result},
f32 {test.erase_this_result},
@@ -47,7 +47,7 @@ func private @f() -> (
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B}, f32 {test.C})
// CHECK-NOT: attributes{{.*}}result
func private @f() -> (
func.func private @f() -> (
f32 {test.A},
f32 {test.erase_this_result},
f32 {test.B},
@@ -59,7 +59,7 @@ func private @f() -> (
// CHECK: func private @f() -> (tensor<1xf32>, tensor<2xf32>, tensor<3xf32>)
// CHECK-NOT: attributes{{.*}}result
func private @f() -> (
func.func private @f() -> (
tensor<1xf32>,
f32 {test.erase_this_result},
tensor<2xf32>,

View File

@@ -1,7 +1,7 @@
// RUN: mlir-opt %s -test-func-insert-arg -split-input-file | FileCheck %s
// CHECK: func @f(%arg0: i1 {test.A})
func @f() attributes {test.insert_args = [
func.func @f() attributes {test.insert_args = [
[0, i1, {test.A}]]} {
return
}
@@ -9,7 +9,7 @@ func @f() attributes {test.insert_args = [
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B})
func @f(%arg0: i2 {test.B}) attributes {test.insert_args = [
func.func @f(%arg0: i2 {test.B}) attributes {test.insert_args = [
[0, i1, {test.A}]]} {
return
}
@@ -17,7 +17,7 @@ func @f(%arg0: i2 {test.B}) attributes {test.insert_args = [
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B})
func @f(%arg0: i1 {test.A}) attributes {test.insert_args = [
func.func @f(%arg0: i1 {test.A}) attributes {test.insert_args = [
[1, i2, {test.B}]]} {
return
}
@@ -25,7 +25,7 @@ func @f(%arg0: i1 {test.A}) attributes {test.insert_args = [
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B}, %arg2: i3 {test.C})
func @f(%arg0: i1 {test.A}, %arg1: i3 {test.C}) attributes {test.insert_args = [
func.func @f(%arg0: i1 {test.A}, %arg1: i3 {test.C}) attributes {test.insert_args = [
[1, i2, {test.B}]]} {
return
}
@@ -33,7 +33,7 @@ func @f(%arg0: i1 {test.A}, %arg1: i3 {test.C}) attributes {test.insert_args = [
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B}, %arg2: i3 {test.C})
func @f(%arg0: i2 {test.B}) attributes {test.insert_args = [
func.func @f(%arg0: i2 {test.B}) attributes {test.insert_args = [
[0, i1, {test.A}],
[1, i3, {test.C}]]} {
return
@@ -42,7 +42,7 @@ func @f(%arg0: i2 {test.B}) attributes {test.insert_args = [
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B}, %arg2: i3 {test.C})
func @f(%arg0: i3 {test.C}) attributes {test.insert_args = [
func.func @f(%arg0: i3 {test.C}) attributes {test.insert_args = [
[0, i1, {test.A}],
[0, i2, {test.B}]]} {
return

View File

@@ -1,37 +1,37 @@
// RUN: mlir-opt %s -test-func-insert-result -split-input-file | FileCheck %s
// CHECK: func private @f() -> (f32 {test.A})
func private @f() attributes {test.insert_results = [
func.func private @f() attributes {test.insert_results = [
[0, f32, {test.A}]]}
// -----
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B})
func private @f() -> (f32 {test.B}) attributes {test.insert_results = [
func.func private @f() -> (f32 {test.B}) attributes {test.insert_results = [
[0, f32, {test.A}]]}
// -----
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B})
func private @f() -> (f32 {test.A}) attributes {test.insert_results = [
func.func private @f() -> (f32 {test.A}) attributes {test.insert_results = [
[1, f32, {test.B}]]}
// -----
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B}, f32 {test.C})
func private @f() -> (f32 {test.A}, f32 {test.C}) attributes {test.insert_results = [
func.func private @f() -> (f32 {test.A}, f32 {test.C}) attributes {test.insert_results = [
[1, f32, {test.B}]]}
// -----
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B}, f32 {test.C})
func private @f() -> (f32 {test.B}) attributes {test.insert_results = [
func.func private @f() -> (f32 {test.B}) attributes {test.insert_results = [
[0, f32, {test.A}],
[1, f32, {test.C}]]}
// -----
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B}, f32 {test.C})
func private @f() -> (f32 {test.C}) attributes {test.insert_results = [
func.func private @f() -> (f32 {test.C}) attributes {test.insert_results = [
[0, f32, {test.A}],
[0, f32, {test.B}]]}

View File

@@ -9,8 +9,8 @@
// Test case: The setType call needs to erase some arg attrs.
// CHECK: func private @erase_arg(f32 {test.A})
func private @t(f32)
func private @erase_arg(%arg0: f32 {test.A}, %arg1: f32 {test.B})
func.func private @t(f32)
func.func private @erase_arg(%arg0: f32 {test.A}, %arg1: f32 {test.B})
attributes {test.set_type_from = @t}
// -----
@@ -18,6 +18,6 @@ attributes {test.set_type_from = @t}
// Test case: The setType call needs to erase some result attrs.
// CHECK: func private @erase_result() -> (f32 {test.A})
func private @t() -> (f32)
func private @erase_result() -> (f32 {test.A}, f32 {test.B})
func.func private @t() -> (f32)
func.func private @erase_result() -> (f32 {test.A}, f32 {test.B})
attributes {test.set_type_from = @t}

View File

@@ -1,6 +1,6 @@
// RUN: mlir-opt %s -mlir-disable-threading=true -pass-pipeline="func.func(test-matchers)" -o /dev/null 2>&1 | FileCheck %s
func @test1(%a: f32, %b: f32, %c: f32) {
func.func @test1(%a: f32, %b: f32, %c: f32) {
%0 = arith.addf %a, %b: f32
%1 = arith.addf %a, %c: f32
%2 = arith.addf %c, %b: f32
@@ -31,7 +31,7 @@ func @test1(%a: f32, %b: f32, %c: f32) {
// CHECK: Pattern mul(mul(a, *), add(a, c)) matched 1 times
// CHECK: Pattern mul(mul(a, *), add(c, b)) matched 0 times
func @test2(%a: f32) -> f32 {
func.func @test2(%a: f32) -> f32 {
%0 = arith.constant 1.0: f32
%1 = arith.addf %a, %0: f32
%2 = arith.mulf %a, %1: f32

View File

@@ -6,11 +6,11 @@
// CHECK-SAME: @symbol_foo
module attributes {sym.outside_use = @symbol_foo } {
// CHECK: func private @replaced_foo
func private @symbol_foo() attributes {sym.new_name = "replaced_foo" }
func.func private @symbol_foo() attributes {sym.new_name = "replaced_foo" }
// CHECK: func @symbol_bar
// CHECK: @replaced_foo
func @symbol_bar() attributes {sym.use = @symbol_foo} {
func.func @symbol_bar() attributes {sym.use = @symbol_foo} {
// CHECK: foo.op
// CHECK-SAME: non_symbol_attr,
// CHECK-SAME: use = [{nested_symbol = [@replaced_foo], other_use = @symbol_bar, z_use = @replaced_foo}],
@@ -39,7 +39,7 @@ module {
// CHECK: module @module_a
module @module_a {
// CHECK: func nested @replaced_foo
func nested @foo() attributes {sym.new_name = "replaced_foo" }
func.func nested @foo() attributes {sym.new_name = "replaced_foo" }
}
// CHECK: module @replaced_module_b
@@ -47,12 +47,12 @@ module {
// CHECK: module @replaced_module_c
module @module_c attributes {sym.new_name = "replaced_module_c"} {
// CHECK: func nested @replaced_foo
func nested @foo() attributes {sym.new_name = "replaced_foo" }
func.func nested @foo() attributes {sym.new_name = "replaced_foo" }
}
}
// CHECK: func @symbol_bar
func @symbol_bar() {
func.func @symbol_bar() {
// CHECK: foo.op
// CHECK-SAME: use_1 = @module_a::@replaced_foo
// CHECK-SAME: use_2 = @replaced_module_b::@replaced_module_c::@replaced_foo
@@ -68,7 +68,7 @@ module {
// Check that the replacement fails for potentially unknown symbol tables.
module {
// CHECK: func private @failed_repl
func private @failed_repl() attributes {sym.new_name = "replaced_name" }
func.func private @failed_repl() attributes {sym.new_name = "replaced_name" }
"foo.possibly_unknown_symbol_table"() ({
}) : () -> ()
@@ -79,10 +79,10 @@ module {
// Check that replacement works in any implementations of SubElementsAttrInterface
module {
// CHECK: func private @replaced_foo
func private @symbol_foo() attributes {sym.new_name = "replaced_foo" }
func.func private @symbol_foo() attributes {sym.new_name = "replaced_foo" }
// CHECK: func @symbol_bar
func @symbol_bar() {
func.func @symbol_bar() {
// CHECK: foo.op
// CHECK-SAME: non_symbol_attr,
// CHECK-SAME: use = [#test.sub_elements_access<[@replaced_foo], @symbol_bar, @replaced_foo>],

View File

@@ -5,12 +5,12 @@
// expected-remark@below {{symbol_removable function successfully erased}}
module attributes {sym.outside_use = @symbol_foo } {
// expected-remark@+1 {{symbol has 2 uses}}
func private @symbol_foo()
func.func private @symbol_foo()
// expected-remark@below {{symbol has no uses}}
// expected-remark@below {{found use of symbol : @symbol_foo}}
// expected-remark@below {{symbol contains 2 nested references}}
func @symbol_bar() attributes {sym.use = @symbol_foo} {
func.func @symbol_bar() attributes {sym.use = @symbol_foo} {
// expected-remark@+1 {{found use of symbol : @symbol_foo}}
"foo.op"() {
non_symbol_attr,
@@ -20,10 +20,10 @@ module attributes {sym.outside_use = @symbol_foo } {
}
// expected-remark@below {{symbol has no uses}}
func private @symbol_removable()
func.func private @symbol_removable()
// expected-remark@+1 {{symbol has 1 use}}
func private @symbol_baz()
func.func private @symbol_baz()
// expected-remark@+1 {{found use of symbol : @symbol_baz}}
module attributes {test.reference = @symbol_baz} {
@@ -40,13 +40,13 @@ module {
// expected-remark@+1 {{symbol has 1 uses}}
module @module_c {
// expected-remark@+1 {{symbol has 1 uses}}
func nested @foo()
func.func nested @foo()
}
}
// expected-remark@below {{symbol has no uses}}
// expected-remark@below {{symbol contains 2 nested references}}
func @symbol_bar() {
func.func @symbol_bar() {
// expected-remark@below {{found use of symbol : @module_b::@module_c::@foo : "foo"}}
// expected-remark@below {{found use of symbol : @module_b::@module_c::@foo : "module_c"}}
// expected-remark@below {{found use of symbol : @module_b::@module_c::@foo : "module_b"}}
@@ -62,7 +62,7 @@ module {
// -----
// expected-remark@+1 {{contains an unknown nested operation that 'may' define a new symbol table}}
func @symbol_bar() {
func.func @symbol_bar() {
"foo.possibly_unknown_symbol_table"() ({
}) : () -> ()
}

View File

@@ -1,6 +1,6 @@
// RUN: mlir-opt --mlir-disable-threading -split-input-file -verify-diagnostics %s
func @verify_operand_type() {
func.func @verify_operand_type() {
%0 = arith.constant 1 : index
// expected-error@+1 {{op operand #0 must be 32-bit signless integer, but got 'index'}}
"test.verifiers"(%0) ({
@@ -11,7 +11,7 @@ func @verify_operand_type() {
// -----
func @verify_nested_op_block_trait() {
func.func @verify_nested_op_block_trait() {
%0 = arith.constant 1 : i32
// expected-remark@+1 {{success run of verifier}}
"test.verifiers"(%0) ({
@@ -24,7 +24,7 @@ func @verify_nested_op_block_trait() {
// -----
func @verify_nested_op_operand() {
func.func @verify_nested_op_operand() {
%0 = arith.constant 1 : i32
// expected-remark@+1 {{success run of verifier}}
"test.verifiers"(%0) ({
@@ -39,7 +39,7 @@ func @verify_nested_op_operand() {
// -----
func @verify_nested_isolated_above() {
func.func @verify_nested_isolated_above() {
%0 = arith.constant 1 : i32
// expected-remark@+1 {{success run of verifier}}
"test.verifiers"(%0) ({

View File

@@ -1,7 +1,7 @@
// RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file -verify-diagnostics | FileCheck %s
// CHECK: succeededSameOperandsElementType
func @succeededSameOperandsElementType(%t10x10 : tensor<10x10xf32>, %t1f: tensor<1xf32>, %v1: vector<1xf32>, %t1i: tensor<1xi32>, %sf: f32) {
func.func @succeededSameOperandsElementType(%t10x10 : tensor<10x10xf32>, %t1f: tensor<1xf32>, %v1: vector<1xf32>, %t1i: tensor<1xi32>, %sf: f32) {
"test.same_operand_element_type"(%t1f, %t1f) : (tensor<1xf32>, tensor<1xf32>) -> tensor<1xi32>
"test.same_operand_element_type"(%t1f, %t10x10) : (tensor<1xf32>, tensor<10x10xf32>) -> tensor<1xi32>
"test.same_operand_element_type"(%t10x10, %v1) : (tensor<10x10xf32>, vector<1xf32>) -> tensor<1xi32>
@@ -16,21 +16,21 @@ func @succeededSameOperandsElementType(%t10x10 : tensor<10x10xf32>, %t1f: tensor
// -----
func @failedSameOperandElementType(%t1f: tensor<1xf32>, %t1i: tensor<1xi32>) {
func.func @failedSameOperandElementType(%t1f: tensor<1xf32>, %t1i: tensor<1xi32>) {
// expected-error@+1 {{requires the same element type for all operands}}
"test.same_operand_element_type"(%t1f, %t1i) : (tensor<1xf32>, tensor<1xi32>) -> tensor<1xf32>
}
// -----
func @failedSameOperandAndResultElementType_no_operands() {
func.func @failedSameOperandAndResultElementType_no_operands() {
// expected-error@+1 {{expected 2 operands, but found 0}}
"test.same_operand_element_type"() : () -> tensor<1xf32>
}
// -----
func @failedSameOperandElementType_scalar_type_mismatch(%si: i32, %sf: f32) {
func.func @failedSameOperandElementType_scalar_type_mismatch(%si: i32, %sf: f32) {
// expected-error@+1 {{requires the same element type for all operands}}
"test.same_operand_element_type"(%sf, %si) : (f32, i32) -> tensor<1xf32>
}
@@ -38,7 +38,7 @@ func @failedSameOperandElementType_scalar_type_mismatch(%si: i32, %sf: f32) {
// -----
// CHECK: succeededSameOperandAndResultElementType
func @succeededSameOperandAndResultElementType(%t10x10 : tensor<10x10xf32>, %t1f: tensor<1xf32>, %v1: vector<1xf32>, %t1i: tensor<1xi32>, %sf: f32) {
func.func @succeededSameOperandAndResultElementType(%t10x10 : tensor<10x10xf32>, %t1f: tensor<1xf32>, %v1: vector<1xf32>, %t1i: tensor<1xi32>, %sf: f32) {
"test.same_operand_and_result_element_type"(%t1f, %t1f) : (tensor<1xf32>, tensor<1xf32>) -> tensor<1xf32>
"test.same_operand_and_result_element_type"(%t1f, %t10x10) : (tensor<1xf32>, tensor<10x10xf32>) -> tensor<1xf32>
"test.same_operand_and_result_element_type"(%t10x10, %v1) : (tensor<10x10xf32>, vector<1xf32>) -> tensor<1xf32>
@@ -53,35 +53,35 @@ func @succeededSameOperandAndResultElementType(%t10x10 : tensor<10x10xf32>, %t1f
// -----
func @failedSameOperandAndResultElementType_operand_result_mismatch(%t1f: tensor<1xf32>) {
func.func @failedSameOperandAndResultElementType_operand_result_mismatch(%t1f: tensor<1xf32>) {
// expected-error@+1 {{requires the same element type for all operands and results}}
"test.same_operand_and_result_element_type"(%t1f, %t1f) : (tensor<1xf32>, tensor<1xf32>) -> tensor<1xi32>
}
// -----
func @failedSameOperandAndResultElementType_operand_mismatch(%t1f: tensor<1xf32>, %t1i: tensor<1xi32>) {
func.func @failedSameOperandAndResultElementType_operand_mismatch(%t1f: tensor<1xf32>, %t1i: tensor<1xi32>) {
// expected-error@+1 {{requires the same element type for all operands and results}}
"test.same_operand_and_result_element_type"(%t1f, %t1i) : (tensor<1xf32>, tensor<1xi32>) -> tensor<1xf32>
}
// -----
func @failedSameOperandAndResultElementType_result_mismatch(%t1f: tensor<1xf32>) {
func.func @failedSameOperandAndResultElementType_result_mismatch(%t1f: tensor<1xf32>) {
// expected-error@+1 {{requires the same element type for all operands and results}}
%0:2 = "test.same_operand_and_result_element_type"(%t1f) : (tensor<1xf32>) -> (tensor<1xf32>, tensor<1xi32>)
}
// -----
func @failedSameOperandAndResultElementType_no_operands() {
func.func @failedSameOperandAndResultElementType_no_operands() {
// expected-error@+1 {{expected 1 or more operands}}
"test.same_operand_and_result_element_type"() : () -> tensor<1xf32>
}
// -----
func @failedSameOperandAndResultElementType_no_results(%t1f: tensor<1xf32>) {
func.func @failedSameOperandAndResultElementType_no_results(%t1f: tensor<1xf32>) {
// expected-error@+1 {{expected 1 or more results}}
"test.same_operand_and_result_element_type"(%t1f) : (tensor<1xf32>) -> ()
}
@@ -89,7 +89,7 @@ func @failedSameOperandAndResultElementType_no_results(%t1f: tensor<1xf32>) {
// -----
// CHECK: succeededSameOperandShape
func @succeededSameOperandShape(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>, %m10x10 : memref<10x10xi32>, %tr: tensor<*xf32>) {
func.func @succeededSameOperandShape(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>, %m10x10 : memref<10x10xi32>, %tr: tensor<*xf32>) {
"test.same_operand_shape"(%t1, %t1) : (tensor<1xf32>, tensor<1xf32>) -> ()
"test.same_operand_shape"(%t10x10, %t10x10) : (tensor<10x10xf32>, tensor<10x10xf32>) -> ()
"test.same_operand_shape"(%t1, %tr) : (tensor<1xf32>, tensor<*xf32>) -> ()
@@ -99,14 +99,14 @@ func @succeededSameOperandShape(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>,
// -----
func @failedSameOperandShape_operand_mismatch(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>) {
func.func @failedSameOperandShape_operand_mismatch(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>) {
// expected-error@+1 {{requires the same shape for all operands}}
"test.same_operand_shape"(%t1, %t10x10) : (tensor<1xf32>, tensor<10x10xf32>) -> ()
}
// -----
func @failedSameOperandShape_no_operands() {
func.func @failedSameOperandShape_no_operands() {
// expected-error@+1 {{expected 1 or more operands}}
"test.same_operand_shape"() : () -> ()
}
@@ -114,7 +114,7 @@ func @failedSameOperandShape_no_operands() {
// -----
// CHECK: succeededSameOperandAndResultShape
func @succeededSameOperandAndResultShape(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>, %tr: tensor<*xf32>, %t1d: tensor<?xf32>) {
func.func @succeededSameOperandAndResultShape(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>, %tr: tensor<*xf32>, %t1d: tensor<?xf32>) {
"test.same_operand_and_result_shape"(%t1, %t1) : (tensor<1xf32>, tensor<1xf32>) -> tensor<1xf32>
"test.same_operand_and_result_shape"(%t10x10, %t10x10) : (tensor<10x10xf32>, tensor<10x10xf32>) -> tensor<10x10xf32>
"test.same_operand_and_result_shape"(%t1, %tr) : (tensor<1xf32>, tensor<*xf32>) -> tensor<1xf32>
@@ -126,28 +126,28 @@ func @succeededSameOperandAndResultShape(%t10x10 : tensor<10x10xf32>, %t1: tenso
// -----
func @failedSameOperandAndResultShape_operand_result_mismatch(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>) {
func.func @failedSameOperandAndResultShape_operand_result_mismatch(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>) {
// expected-error@+1 {{requires the same shape for all operands and results}}
"test.same_operand_and_result_shape"(%t1, %t10x10) : (tensor<1xf32>, tensor<10x10xf32>) -> tensor<10x10xf32>
}
// -----
func @failedSameOperandAndResultShape_operand_result_mismatch(%t10 : tensor<10xf32>, %t1: tensor<?xf32>) {
func.func @failedSameOperandAndResultShape_operand_result_mismatch(%t10 : tensor<10xf32>, %t1: tensor<?xf32>) {
// expected-error@+1 {{requires the same shape for all operands and results}}
"test.same_operand_and_result_shape"(%t1, %t10) : (tensor<?xf32>, tensor<10xf32>) -> tensor<3xf32>
}
// -----
func @failedSameOperandAndResultShape_no_operands() {
func.func @failedSameOperandAndResultShape_no_operands() {
// expected-error@+1 {{expected 1 or more operands}}
"test.same_operand_and_result_shape"() : () -> (tensor<1xf32>)
}
// -----
func @failedSameOperandAndResultShape_no_operands(%t1: tensor<1xf32>) {
func.func @failedSameOperandAndResultShape_no_operands(%t1: tensor<1xf32>) {
// expected-error@+1 {{expected 1 or more results}}
"test.same_operand_and_result_shape"(%t1) : (tensor<1xf32>) -> ()
}
@@ -155,7 +155,7 @@ func @failedSameOperandAndResultShape_no_operands(%t1: tensor<1xf32>) {
// -----
// CHECK: succeededSameOperandAndResultType
func @succeededSameOperandAndResultType(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>, %tr: tensor<*xf32>, %t1d: tensor<?xf32>, %i32 : i32) {
func.func @succeededSameOperandAndResultType(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>, %tr: tensor<*xf32>, %t1d: tensor<?xf32>, %i32 : i32) {
"test.same_operand_and_result_type"(%t1, %t1) : (tensor<1xf32>, tensor<1xf32>) -> tensor<1xf32>
"test.same_operand_and_result_type"(%t10x10, %t10x10) : (tensor<10x10xf32>, tensor<10x10xf32>) -> tensor<10x10xf32>
"test.same_operand_and_result_type"(%t1, %tr) : (tensor<1xf32>, tensor<*xf32>) -> tensor<1xf32>
@@ -166,7 +166,7 @@ func @succeededSameOperandAndResultType(%t10x10 : tensor<10x10xf32>, %t1: tensor
// -----
func @failedSameOperandAndResultType_operand_result_mismatch(%t10 : tensor<10xf32>, %t20 : tensor<20xf32>) {
func.func @failedSameOperandAndResultType_operand_result_mismatch(%t10 : tensor<10xf32>, %t20 : tensor<20xf32>) {
// expected-error@+1 {{requires the same type for all operands and results}}
"test.same_operand_and_result_type"(%t10, %t20) : (tensor<10xf32>, tensor<20xf32>) -> tensor<10xf32>
return
@@ -174,7 +174,7 @@ func @failedSameOperandAndResultType_operand_result_mismatch(%t10 : tensor<10xf3
// -----
func @failedElementwiseMappable_different_rankedness(%arg0: tensor<?xf32>, %arg1: tensor<*xf32>) {
func.func @failedElementwiseMappable_different_rankedness(%arg0: tensor<?xf32>, %arg1: tensor<*xf32>) {
// expected-error@+1 {{all non-scalar operands/results must have the same shape and base type}}
%0 = "test.elementwise_mappable"(%arg0, %arg1) : (tensor<?xf32>, tensor<*xf32>) -> tensor<*xf32>
return
@@ -182,7 +182,7 @@ func @failedElementwiseMappable_different_rankedness(%arg0: tensor<?xf32>, %arg1
// -----
func @failedElementwiseMappable_different_rank(%arg0: tensor<?xf32>, %arg1: tensor<?x?xf32>) {
func.func @failedElementwiseMappable_different_rank(%arg0: tensor<?xf32>, %arg1: tensor<?x?xf32>) {
// expected-error@+1 {{all non-scalar operands/results must have the same shape and base type}}
%0 = "test.elementwise_mappable"(%arg0, %arg1) : (tensor<?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
return
@@ -190,7 +190,7 @@ func @failedElementwiseMappable_different_rank(%arg0: tensor<?xf32>, %arg1: tens
// -----
func @elementwiseMappable_dynamic_shapes(%arg0: tensor<?xf32>,
func.func @elementwiseMappable_dynamic_shapes(%arg0: tensor<?xf32>,
%arg1: tensor<5xf32>) {
%0 = "test.elementwise_mappable"(%arg0, %arg1) :
(tensor<?xf32>, tensor<5xf32>) -> tensor<?xf32>
@@ -199,7 +199,7 @@ func @elementwiseMappable_dynamic_shapes(%arg0: tensor<?xf32>,
// -----
func @failedElementwiseMappable_different_base_type(%arg0: vector<2xf32>, %arg1: tensor<2xf32>) {
func.func @failedElementwiseMappable_different_base_type(%arg0: vector<2xf32>, %arg1: tensor<2xf32>) {
// expected-error@+1 {{all non-scalar operands/results must have the same shape and base type}}
%0 = "test.elementwise_mappable"(%arg0, %arg1) : (vector<2xf32>, tensor<2xf32>) -> tensor<2xf32>
return
@@ -207,7 +207,7 @@ func @failedElementwiseMappable_different_base_type(%arg0: vector<2xf32>, %arg1:
// -----
func @failedElementwiseMappable_non_scalar_output(%arg0: vector<2xf32>) {
func.func @failedElementwiseMappable_non_scalar_output(%arg0: vector<2xf32>) {
// expected-error@+1 {{if an operand is non-scalar, then there must be at least one non-scalar result}}
%0 = "test.elementwise_mappable"(%arg0) : (vector<2xf32>) -> f32
return
@@ -215,7 +215,7 @@ func @failedElementwiseMappable_non_scalar_output(%arg0: vector<2xf32>) {
// -----
func @failedElementwiseMappable_non_scalar_result_all_scalar_input(%arg0: f32) {
func.func @failedElementwiseMappable_non_scalar_result_all_scalar_input(%arg0: f32) {
// expected-error@+1 {{if a result is non-scalar, then at least one operand must be non-scalar}}
%0 = "test.elementwise_mappable"(%arg0) : (f32) -> tensor<f32>
return
@@ -223,7 +223,7 @@ func @failedElementwiseMappable_non_scalar_result_all_scalar_input(%arg0: f32) {
// -----
func @failedElementwiseMappable_mixed_scalar_non_scalar_results(%arg0: tensor<10xf32>) {
func.func @failedElementwiseMappable_mixed_scalar_non_scalar_results(%arg0: tensor<10xf32>) {
// expected-error@+1 {{if an operand is non-scalar, then all results must be non-scalar}}
%0, %1 = "test.elementwise_mappable"(%arg0) : (tensor<10xf32>) -> (f32, tensor<10xf32>)
return
@@ -231,7 +231,7 @@ func @failedElementwiseMappable_mixed_scalar_non_scalar_results(%arg0: tensor<10
// -----
func @failedElementwiseMappable_zero_results(%arg0: tensor<10xf32>) {
func.func @failedElementwiseMappable_zero_results(%arg0: tensor<10xf32>) {
// expected-error@+1 {{if an operand is non-scalar, then there must be at least one non-scalar result}}
"test.elementwise_mappable"(%arg0) : (tensor<10xf32>) -> ()
return
@@ -239,7 +239,7 @@ func @failedElementwiseMappable_zero_results(%arg0: tensor<10xf32>) {
// -----
func @failedElementwiseMappable_zero_operands() {
func.func @failedElementwiseMappable_zero_operands() {
// expected-error@+1 {{if a result is non-scalar, then at least one operand must be non-scalar}}
"test.elementwise_mappable"() : () -> (tensor<6xf32>)
return
@@ -247,7 +247,7 @@ func @failedElementwiseMappable_zero_operands() {
// -----
func @succeededElementwiseMappable(%arg0: vector<2xf32>) {
func.func @succeededElementwiseMappable(%arg0: vector<2xf32>) {
// Check that varying element types are allowed.
// CHECK: test.elementwise_mappable
%0 = "test.elementwise_mappable"(%arg0) : (vector<2xf32>) -> vector<2xf16>
@@ -256,7 +256,7 @@ func @succeededElementwiseMappable(%arg0: vector<2xf32>) {
// -----
func @failedHasParent_wrong_parent() {
func.func @failedHasParent_wrong_parent() {
"some.op"() ({
// expected-error@+1 {{'test.child' op expects parent op 'test.parent'}}
"test.child"() : () -> ()
@@ -266,7 +266,7 @@ func @failedHasParent_wrong_parent() {
// -----
// CHECK: succeededParentOneOf
func @succeededParentOneOf() {
func.func @succeededParentOneOf() {
"test.parent"() ({
"test.child_with_parent_one_of"() : () -> ()
"test.finish"() : () -> ()
@@ -277,7 +277,7 @@ func @succeededParentOneOf() {
// -----
// CHECK: succeededParent1OneOf
func @succeededParent1OneOf() {
func.func @succeededParent1OneOf() {
"test.parent1"() ({
"test.child_with_parent_one_of"() : () -> ()
"test.finish"() : () -> ()
@@ -287,7 +287,7 @@ func @succeededParent1OneOf() {
// -----
func @failedParentOneOf_wrong_parent1() {
func.func @failedParentOneOf_wrong_parent1() {
"some.otherop"() ({
// expected-error@+1 {{'test.child_with_parent_one_of' op expects parent op to be one of 'test.parent, test.parent1'}}
"test.child_with_parent_one_of"() : () -> ()
@@ -298,7 +298,7 @@ func @failedParentOneOf_wrong_parent1() {
// -----
func @failedSingleBlockImplicitTerminator_empty_block() {
func.func @failedSingleBlockImplicitTerminator_empty_block() {
// expected-error@+1 {{'test.SingleBlockImplicitTerminator' op expects a non-empty block}}
"test.SingleBlockImplicitTerminator"() ({
^entry:
@@ -307,7 +307,7 @@ func @failedSingleBlockImplicitTerminator_empty_block() {
// -----
func @failedSingleBlockImplicitTerminator_too_many_blocks() {
func.func @failedSingleBlockImplicitTerminator_too_many_blocks() {
// expected-error@+1 {{'test.SingleBlockImplicitTerminator' op expects region #0 to have 0 or 1 block}}
"test.SingleBlockImplicitTerminator"() ({
^entry:
@@ -319,7 +319,7 @@ func @failedSingleBlockImplicitTerminator_too_many_blocks() {
// -----
func @failedSingleBlockImplicitTerminator_missing_terminator() {
func.func @failedSingleBlockImplicitTerminator_missing_terminator() {
// expected-error@+2 {{'test.SingleBlockImplicitTerminator' op expects regions to end with 'test.finish'}}
// expected-note@+1 {{in custom textual format, the absence of terminator implies 'test.finish'}}
"test.SingleBlockImplicitTerminator"() ({
@@ -356,10 +356,10 @@ func @failedSingleBlockImplicitTerminator_missing_terminator() {
// Test that operation with the SymbolTable Trait define a new symbol scope.
"test.symbol_scope"() ({
func private @foo()
func.func private @foo()
"test.finish" () : () -> ()
}) : () -> ()
func private @foo()
func.func private @foo()
// -----
@@ -374,56 +374,56 @@ func private @foo()
// -----
func @failedMissingOperandSizeAttr(%arg: i32) {
func.func @failedMissingOperandSizeAttr(%arg: i32) {
// expected-error @+1 {{requires 1D i32 elements attribute 'operand_segment_sizes'}}
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) : (i32, i32, i32, i32) -> ()
}
// -----
func @failedOperandSizeAttrWrongType(%arg: i32) {
func.func @failedOperandSizeAttrWrongType(%arg: i32) {
// expected-error @+1 {{requires 1D i32 elements attribute 'operand_segment_sizes'}}
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = 10} : (i32, i32, i32, i32) -> ()
}
// -----
func @failedOperandSizeAttrWrongRank(%arg: i32) {
func.func @failedOperandSizeAttrWrongRank(%arg: i32) {
// expected-error @+1 {{requires 1D i32 elements attribute 'operand_segment_sizes'}}
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = dense<[[1, 1], [1, 1]]>: vector<2x2xi32>} : (i32, i32, i32, i32) -> ()
}
// -----
func @failedOperandSizeAttrWrongElementType(%arg: i32) {
func.func @failedOperandSizeAttrWrongElementType(%arg: i32) {
// expected-error @+1 {{requires 1D i32 elements attribute 'operand_segment_sizes'}}
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = dense<[1, 1, 1, 1]>: vector<4xi64>} : (i32, i32, i32, i32) -> ()
}
// -----
func @failedOperandSizeAttrNegativeValue(%arg: i32) {
func.func @failedOperandSizeAttrNegativeValue(%arg: i32) {
// expected-error @+1 {{'operand_segment_sizes' attribute cannot have negative elements}}
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = dense<[1, 1, -1, 1]>: vector<4xi32>} : (i32, i32, i32, i32) -> ()
}
// -----
func @failedOperandSizeAttrWrongTotalSize(%arg: i32) {
func.func @failedOperandSizeAttrWrongTotalSize(%arg: i32) {
// expected-error @+1 {{operand count (4) does not match with the total size (3) specified in attribute 'operand_segment_sizes'}}
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = dense<[0, 1, 1, 1]>: vector<4xi32>} : (i32, i32, i32, i32) -> ()
}
// -----
func @failedOperandSizeAttrWrongCount(%arg: i32) {
func.func @failedOperandSizeAttrWrongCount(%arg: i32) {
// expected-error @+1 {{'operand_segment_sizes' attribute for specifying operand segments must have 4 elements}}
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = dense<[2, 1, 1]>: vector<3xi32>} : (i32, i32, i32, i32) -> ()
}
// -----
func @succeededOperandSizeAttr(%arg: i32) {
func.func @succeededOperandSizeAttr(%arg: i32) {
// CHECK: test.attr_sized_operands
"test.attr_sized_operands"(%arg, %arg, %arg, %arg) {operand_segment_sizes = dense<[0, 2, 1, 1]>: vector<4xi32>} : (i32, i32, i32, i32) -> ()
return
@@ -431,56 +431,56 @@ func @succeededOperandSizeAttr(%arg: i32) {
// -----
func @failedMissingResultSizeAttr() {
func.func @failedMissingResultSizeAttr() {
// expected-error @+1 {{requires 1D i32 elements attribute 'result_segment_sizes'}}
%0:4 = "test.attr_sized_results"() : () -> (i32, i32, i32, i32)
}
// -----
func @failedResultSizeAttrWrongType() {
func.func @failedResultSizeAttrWrongType() {
// expected-error @+1 {{requires 1D i32 elements attribute 'result_segment_sizes'}}
%0:4 = "test.attr_sized_results"() {result_segment_sizes = 10} : () -> (i32, i32, i32, i32)
}
// -----
func @failedResultSizeAttrWrongRank() {
func.func @failedResultSizeAttrWrongRank() {
// expected-error @+1 {{requires 1D i32 elements attribute 'result_segment_sizes'}}
%0:4 = "test.attr_sized_results"() {result_segment_sizes = dense<[[1, 1], [1, 1]]>: vector<2x2xi32>} : () -> (i32, i32, i32, i32)
}
// -----
func @failedResultSizeAttrWrongElementType() {
func.func @failedResultSizeAttrWrongElementType() {
// expected-error @+1 {{requires 1D i32 elements attribute 'result_segment_sizes'}}
%0:4 = "test.attr_sized_results"() {result_segment_sizes = dense<[1, 1, 1, 1]>: vector<4xi64>} : () -> (i32, i32, i32, i32)
}
// -----
func @failedResultSizeAttrNegativeValue() {
func.func @failedResultSizeAttrNegativeValue() {
// expected-error @+1 {{'result_segment_sizes' attribute cannot have negative elements}}
%0:4 = "test.attr_sized_results"() {result_segment_sizes = dense<[1, 1, -1, 1]>: vector<4xi32>} : () -> (i32, i32, i32, i32)
}
// -----
func @failedResultSizeAttrWrongTotalSize() {
func.func @failedResultSizeAttrWrongTotalSize() {
// expected-error @+1 {{result count (4) does not match with the total size (3) specified in attribute 'result_segment_sizes'}}
%0:4 = "test.attr_sized_results"() {result_segment_sizes = dense<[0, 1, 1, 1]>: vector<4xi32>} : () -> (i32, i32, i32, i32)
}
// -----
func @failedResultSizeAttrWrongCount() {
func.func @failedResultSizeAttrWrongCount() {
// expected-error @+1 {{'result_segment_sizes' attribute for specifying result segments must have 4 elements, but got 3}}
%0:4 = "test.attr_sized_results"() {result_segment_sizes = dense<[2, 1, 1]>: vector<3xi32>} : () -> (i32, i32, i32, i32)
}
// -----
func @succeededResultSizeAttr() {
func.func @succeededResultSizeAttr() {
// CHECK: test.attr_sized_results
%0:4 = "test.attr_sized_results"() {result_segment_sizes = dense<[0, 2, 1, 1]>: vector<4xi32>} : () -> (i32, i32, i32, i32)
return
@@ -489,7 +489,7 @@ func @succeededResultSizeAttr() {
// -----
// CHECK-LABEL: @succeededOilistTrivial
func @succeededOilistTrivial() {
func.func @succeededOilistTrivial() {
// CHECK: test.oilist_with_keywords_only keyword
test.oilist_with_keywords_only keyword
// CHECK: test.oilist_with_keywords_only otherKeyword
@@ -508,7 +508,7 @@ func @succeededOilistTrivial() {
// -----
// CHECK-LABEL: @succeededOilistSimple
func @succeededOilistSimple(%arg0 : i32, %arg1 : i32, %arg2 : i32) {
func.func @succeededOilistSimple(%arg0 : i32, %arg1 : i32, %arg2 : i32) {
// CHECK: test.oilist_with_simple_args keyword %{{.*}} : i32
test.oilist_with_simple_args keyword %arg0 : i32
// CHECK: test.oilist_with_simple_args otherKeyword %{{.*}} : i32
@@ -536,7 +536,7 @@ func @succeededOilistSimple(%arg0 : i32, %arg1 : i32, %arg2 : i32) {
// CHECK-LABEL: @succeededOilistVariadic
// CHECK-SAME: (%[[ARG0:.*]]: i32, %[[ARG1:.*]]: i32, %[[ARG2:.*]]: i32)
func @succeededOilistVariadic(%arg0: i32, %arg1: i32, %arg2: i32) {
func.func @succeededOilistVariadic(%arg0: i32, %arg1: i32, %arg2: i32) {
// CHECK: test.oilist_variadic_with_parens keyword(%[[ARG0]], %[[ARG1]] : i32, i32)
test.oilist_variadic_with_parens keyword (%arg0, %arg1 : i32, i32)
// CHECK: test.oilist_variadic_with_parens keyword(%[[ARG0]], %[[ARG1]] : i32, i32) otherKeyword(%[[ARG2]], %[[ARG1]] : i32, i32)
@@ -549,7 +549,7 @@ func @succeededOilistVariadic(%arg0: i32, %arg1: i32, %arg2: i32) {
// -----
// CHECK-LABEL: succeededOilistCustom
// CHECK-SAME: (%[[ARG0:.*]]: i32, %[[ARG1:.*]]: i32, %[[ARG2:.*]]: i32)
func @succeededOilistCustom(%arg0: i32, %arg1: i32, %arg2: i32) {
func.func @succeededOilistCustom(%arg0: i32, %arg1: i32, %arg2: i32) {
// CHECK: test.oilist_custom private(%[[ARG0]], %[[ARG1]] : i32, i32)
test.oilist_custom private (%arg0, %arg1 : i32, i32)
// CHECK: test.oilist_custom private(%[[ARG0]], %[[ARG1]] : i32, i32) nowait
@@ -561,7 +561,7 @@ func @succeededOilistCustom(%arg0: i32, %arg1: i32, %arg2: i32) {
// -----
func @failedHasDominanceScopeOutsideDominanceFreeScope() -> () {
func.func @failedHasDominanceScopeOutsideDominanceFreeScope() -> () {
"test.ssacfg_region"() ({
test.graph_region {
// expected-error @+1 {{operand #0 does not dominate this use}}
@@ -577,7 +577,7 @@ func @failedHasDominanceScopeOutsideDominanceFreeScope() -> () {
// Ensure that SSACFG regions of operations in GRAPH regions are
// checked for dominance
func @illegalInsideDominanceFreeScope() -> () {
func.func @illegalInsideDominanceFreeScope() -> () {
test.graph_region {
func.func @test() -> i1 {
^bb1:
@@ -596,7 +596,7 @@ func @illegalInsideDominanceFreeScope() -> () {
// Ensure that SSACFG regions of operations in GRAPH regions are
// checked for dominance
func @illegalCDFGInsideDominanceFreeScope() -> () {
func.func @illegalCDFGInsideDominanceFreeScope() -> () {
test.graph_region {
func.func @test() -> i1 {
^bb1:
@@ -617,7 +617,7 @@ func @illegalCDFGInsideDominanceFreeScope() -> () {
// -----
// Ensure that GRAPH regions still have all values defined somewhere.
func @illegalCDFGInsideDominanceFreeScope() -> () {
func.func @illegalCDFGInsideDominanceFreeScope() -> () {
test.graph_region {
// expected-error @+1 {{use of undeclared SSA value name}}
%2:3 = "bar"(%1) : (i64) -> (i1,i1,i1)
@@ -628,7 +628,7 @@ func @illegalCDFGInsideDominanceFreeScope() -> () {
// -----
func @graph_region_cant_have_blocks() {
func.func @graph_region_cant_have_blocks() {
test.graph_region {
// expected-error@-1 {{'test.graph_region' op expects graph region #0 to have 0 or 1 blocks}}
^bb42:
@@ -641,7 +641,7 @@ func @graph_region_cant_have_blocks() {
// -----
// Check that we can query traits in types
func @succeeded_type_traits() {
func.func @succeeded_type_traits() {
// CHECK: "test.result_type_with_trait"() : () -> !test.test_type_with_trait
"test.result_type_with_trait"() : () -> !test.test_type_with_trait
return
@@ -650,7 +650,7 @@ func @succeeded_type_traits() {
// -----
// Check that we can query traits in types
func @failed_type_traits() {
func.func @failed_type_traits() {
// expected-error@+1 {{result type should have trait 'TestTypeTrait'}}
"test.result_type_with_trait"() : () -> i32
return
@@ -659,7 +659,7 @@ func @failed_type_traits() {
// -----
// Check that we can query traits in attributes
func @succeeded_attr_traits() {
func.func @succeeded_attr_traits() {
// CHECK: "test.attr_with_trait"() {attr = #test.attr_with_trait} : () -> ()
"test.attr_with_trait"() {attr = #test.attr_with_trait} : () -> ()
return
@@ -668,7 +668,7 @@ func @succeeded_attr_traits() {
// -----
// Check that we can query traits in attributes
func @failed_attr_traits() {
func.func @failed_attr_traits() {
// expected-error@+1 {{'attr' attribute should have trait 'TestAttrTrait'}}
"test.attr_with_trait"() {attr = 42 : i32} : () -> ()
return

View File

@@ -5,7 +5,7 @@
// Module and function op and their immediately nested blocks are not erased in
// callbacks with return so that the output includes more cases in pre-order.
func @structured_cfg() {
func.func @structured_cfg() {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c10 = arith.constant 10 : index
@@ -112,7 +112,7 @@ func @structured_cfg() {
// -----
func @unstructured_cfg() {
func.func @unstructured_cfg() {
"regionOp0"() ({
^bb0:
"op0"() : () -> ()

View File

@@ -3,7 +3,7 @@
// CHECK-LABEL: func @wrapping_op
// CHECK-GENERIC: "func.func"
func @wrapping_op(%arg0 : i32, %arg1 : f32) -> (i3, i2, i1) {
func.func @wrapping_op(%arg0 : i32, %arg1 : f32) -> (i3, i2, i1) {
// CHECK: %0:3 = test.wrapping_region wraps "some.op"(%arg1, %arg0) {test.attr = "attr"} : (f32, i32) -> (i1, i2, i3)
// CHECK-GENERIC: "test.wrapping_region"() ({
// CHECK-GENERIC: %[[NESTED_RES:.*]]:3 = "some.op"(%arg1, %arg0) {test.attr = "attr"} : (f32, i32) -> (i1, i2, i3) loc("some_NameLoc")

View File

@@ -4,7 +4,7 @@ module attributes { dlti.dl_spec = #dlti.dl_spec<
#dlti.dl_entry<!test.test_type_with_layout<10>, ["size", 12]>,
#dlti.dl_entry<!test.test_type_with_layout<20>, ["alignment", 32]>>} {
// CHECK-LABEL: @module_level_layout
func @module_level_layout() {
func.func @module_level_layout() {
// CHECK: alignment = 32
// CHECK: bitsize = 12
// CHECK: preferred = 1

View File

@@ -1,7 +1,7 @@
// RUN: mlir-opt --test-data-layout-query %s | FileCheck %s
// CHECK-LABEL: @no_layout_builtin
func @no_layout_builtin() {
func.func @no_layout_builtin() {
// CHECK: alignment = 4
// CHECK: bitsize = 32
// CHECK: preferred = 4
@@ -27,7 +27,7 @@ func @no_layout_builtin() {
}
// CHECK-LABEL: @no_layout_custom
func @no_layout_custom() {
func.func @no_layout_custom() {
// CHECK: alignment = 1
// CHECK: bitsize = 1
// CHECK: preferred = 1
@@ -37,7 +37,7 @@ func @no_layout_custom() {
}
// CHECK-LABEL: @layout_op_no_layout
func @layout_op_no_layout() {
func.func @layout_op_no_layout() {
"test.op_with_data_layout"() ({
// CHECK: alignment = 1
// CHECK: bitsize = 1
@@ -50,7 +50,7 @@ func @layout_op_no_layout() {
}
// CHECK-LABEL: @layout_op
func @layout_op() {
func.func @layout_op() {
"test.op_with_data_layout"() ({
// CHECK: alignment = 20
// CHECK: bitsize = 10
@@ -67,7 +67,7 @@ func @layout_op() {
// Make sure the outer op with layout may be missing the spec.
// CHECK-LABEL: @nested_inner_only
func @nested_inner_only() {
func.func @nested_inner_only() {
"test.op_with_data_layout"() ({
"test.op_with_data_layout"() ({
// CHECK: alignment = 20
@@ -87,7 +87,7 @@ func @nested_inner_only() {
// Make sure the inner op with layout may be missing the spec.
// CHECK-LABEL: @nested_outer_only
func @nested_outer_only() {
func.func @nested_outer_only() {
"test.op_with_data_layout"() ({
"test.op_with_data_layout"() ({
// CHECK: alignment = 20
@@ -106,7 +106,7 @@ func @nested_outer_only() {
}
// CHECK-LABEL: @nested_middle_only
func @nested_middle_only() {
func.func @nested_middle_only() {
"test.op_with_data_layout"() ({
"test.op_with_data_layout"() ({
"test.op_with_data_layout"() ({
@@ -128,7 +128,7 @@ func @nested_middle_only() {
}
// CHECK-LABEL: @nested_combine_with_missing
func @nested_combine_with_missing() {
func.func @nested_combine_with_missing() {
"test.op_with_data_layout"() ({
"test.op_with_data_layout"() ({
"test.op_with_data_layout"() ({
@@ -158,7 +158,7 @@ func @nested_combine_with_missing() {
}
// CHECK-LABEL: @nested_combine_all
func @nested_combine_all() {
func.func @nested_combine_all() {
"test.op_with_data_layout"() ({
"test.op_with_data_layout"() ({
"test.op_with_data_layout"() ({
@@ -196,7 +196,7 @@ func @nested_combine_all() {
}
// CHECK-LABEL: @integers
func @integers() {
func.func @integers() {
"test.op_with_data_layout"() ({
// CHECK: alignment = 8
// CHECK: bitsize = 32
@@ -244,7 +244,7 @@ func @integers() {
return
}
func @floats() {
func.func @floats() {
"test.op_with_data_layout"() ({
// CHECK: alignment = 8
// CHECK: bitsize = 32

View File

@@ -38,7 +38,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<
// CHECK-LABEL: @index
module @index attributes { dlti.dl_spec = #dlti.dl_spec<
#dlti.dl_entry<index, 32>>} {
func @query() {
func.func @query() {
// CHECK: bitsize = 32
"test.data_layout_query"() : () -> index
return
@@ -49,7 +49,7 @@ module @index attributes { dlti.dl_spec = #dlti.dl_spec<
// CHECK-LABEL: @index_default
module @index_default {
func @query() {
func.func @query() {
// CHECK: bitsize = 64
"test.data_layout_query"() : () -> index
return

View File

@@ -1,6 +1,6 @@
// RUN: mlir-opt %s -resolve-shaped-type-result-dims -split-input-file | FileCheck %s
func @result_shape(%arg0 : tensor<2x3x?xf32>, %arg1 : tensor<?x5xf32>)
func.func @result_shape(%arg0 : tensor<2x3x?xf32>, %arg1 : tensor<?x5xf32>)
-> (index, index, index, index, index) {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
@@ -27,7 +27,7 @@ func @result_shape(%arg0 : tensor<2x3x?xf32>, %arg1 : tensor<?x5xf32>)
// -----
func @result_shape_per_dim(%arg0 : tensor<2x3x?xf32>, %arg1 : tensor<?x5xf32>)
func.func @result_shape_per_dim(%arg0 : tensor<2x3x?xf32>, %arg1 : tensor<?x5xf32>)
-> (index, index, index, index, index) {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index