diff --git a/test/canonicalization.mlir b/test/canonicalization.mlir index c8dbb9b9..5746defc 100644 --- a/test/canonicalization.mlir +++ b/test/canonicalization.mlir @@ -1,11 +1,11 @@ // RUN: sair-opt %s -canonicalize | FileCheck %s -func @use(%arg0: f32) { +func.func @use(%arg0: f32) { return } // CHECK-LABEL: @deduplicate_map_input -func @deduplicate_map_input(%arg0: f32) { +func.func @deduplicate_map_input(%arg0: f32) { sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -25,7 +25,7 @@ func @deduplicate_map_input(%arg0: f32) { } // CHECK-LABEL: @deduplicate_map_input_instances -func @deduplicate_map_input_instances(%arg0: f32) { +func.func @deduplicate_map_input_instances(%arg0: f32) { sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -49,7 +49,7 @@ func @deduplicate_map_input_instances(%arg0: f32) { } // CHECK-LABEL: @deduplicate_map_output -func @deduplicate_map_output() { +func.func @deduplicate_map_output() { %3, %4 = sair.program { // CHECK: %[[V0:.*]] = sair.map %0, %1 = sair.map { @@ -67,7 +67,7 @@ func @deduplicate_map_output() { } // CHECK-LABEL: @fold_empty_proj -func @fold_empty_proj(%arg0: f32) { +func.func @fold_empty_proj(%arg0: f32) { %n = arith.constant 8 : index %0 = sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -85,7 +85,7 @@ func @fold_empty_proj(%arg0: f32) { } // CHECK-LABEL: @fold_empty_fby -func @fold_empty_fby(%arg0: f32) { +func.func @fold_empty_fby(%arg0: f32) { %n = arith.constant 8 : index %0 = sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -103,7 +103,7 @@ func @fold_empty_fby(%arg0: f32) { } // CHECK-LABEL: @merge_proj -func @merge_proj(%arg0: f32) { +func.func @merge_proj(%arg0: f32) { %n = arith.constant 8 : index %0 = sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -123,7 +123,7 @@ func @merge_proj(%arg0: f32) { } // CHECK-LABEL: @remove_cyclic_fby -func @remove_cyclic_fby(%arg0: f32, %arg1: memref) { +func.func @remove_cyclic_fby(%arg0: f32, %arg1: memref) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -144,7 +144,7 @@ func @remove_cyclic_fby(%arg0: f32, %arg1: memref) { } // CHECK-LABEL: @remove_useless_dims_fby -func @remove_useless_dims_fby(%arg0: f32) { +func.func @remove_useless_dims_fby(%arg0: f32) { %n = arith.constant 8 : index %0 = sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -166,7 +166,7 @@ func @remove_useless_dims_fby(%arg0: f32) { } // CHECK-LABEL: @remove_useless_dims_proj -func @remove_useless_dims_proj(%arg0: f32) { +func.func @remove_useless_dims_proj(%arg0: f32) { %n = arith.constant 8 : index %0 = sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -188,7 +188,7 @@ func @remove_useless_dims_proj(%arg0: f32) { } // CHECK-LABEL: @remove_useless_dims_proj_dependent -func @remove_useless_dims_proj_dependent(%arg0: f32, %arg1: index) { +func.func @remove_useless_dims_proj_dependent(%arg0: f32, %arg1: index) { %n = arith.constant 8 : index %0 = sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -216,7 +216,7 @@ func @remove_useless_dims_proj_dependent(%arg0: f32, %arg1: index) { } // CHECK-LABEL: @mappings -func @mappings(%arg0: f32) { +func.func @mappings(%arg0: f32) { %n = arith.constant 8 : index %0 = sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -234,7 +234,7 @@ func @mappings(%arg0: f32) { } // CHECK-LABEL: @sequence -func @sequence(%arg0 : f32, %arg1 : index) { +func.func @sequence(%arg0 : f32, %arg1 : index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.from_scalar %arg1 : !sair.value<(), index> diff --git a/test/default_expansion.mlir b/test/default_expansion.mlir index 32e7859a..0de0e91b 100644 --- a/test/default_expansion.mlir +++ b/test/default_expansion.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt -sair-assign-default-expansion %s | FileCheck %s // CHECK-LABEL: @map -func @map() { +func.func @map() { sair.program { // CHECK: sair.map // CHECK-SAME: expansion = "map" @@ -16,7 +16,7 @@ func @map() { } // CHECK-LABEL: @copy -func @copy(%arg0: f32) { +func.func @copy(%arg0: f32) { sair.program { // CHECK: sair.from_scalar %0 = sair.from_scalar %arg0 { diff --git a/test/default_expansion_invalid.mlir b/test/default_expansion_invalid.mlir index 8f9faa96..1d21d47a 100644 --- a/test/default_expansion_invalid.mlir +++ b/test/default_expansion_invalid.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt -sair-assign-default-expansion %s -split-input-file -verify-diagnostics -func @main() { +func.func @main() { sair.program { // expected-error @+1 {{not supported}} sair.map_reduce reduce attributes {instances = [{}]} { diff --git a/test/default_loop_nest.mlir b/test/default_loop_nest.mlir index a894b9a7..5eb0aa50 100644 --- a/test/default_loop_nest.mlir +++ b/test/default_loop_nest.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt -sair-assign-default-loop-nest %s | FileCheck %s -func @default_loop_nest(%arg0: f32) { +func.func @default_loop_nest(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<16> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> diff --git a/test/default_sequence.mlir b/test/default_sequence.mlir index c0c7279e..b63d9622 100644 --- a/test/default_sequence.mlir +++ b/test/default_sequence.mlir @@ -2,7 +2,7 @@ // CHECK-LABEL: @empty // Shouldn't fail here. -func @empty() { +func.func @empty() { sair.program { sair.exit } @@ -10,7 +10,7 @@ func @empty() { } // CHECK-LABEL: @simple_use_def -func @simple_use_def() { +func.func @simple_use_def() { sair.program { // CHECK: sair.alloc // CHECK-SAME: sequence = 0 @@ -28,7 +28,7 @@ func @simple_use_def() { } // CHECK-LABEL: @simple_use_def_chain -func @simple_use_def_chain(%arg0: f32) { +func.func @simple_use_def_chain(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // CHECK: sair.copy @@ -62,7 +62,7 @@ func @simple_use_def_chain(%arg0: f32) { // CHECK-LABEL: @use_def_graph // Check that we deterministically prefer the original order of operations in // absence of other criteria. -func @use_def_graph(%arg0: f32, %arg1: f32) { +func.func @use_def_graph(%arg0: f32, %arg1: f32) { sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -103,7 +103,7 @@ func @use_def_graph(%arg0: f32, %arg1: f32) { // CHECK-LABEL: @use_def_graph_partial // Check that pre-existent relative order is preserved. -func @use_def_graph_partial(%arg0: f32, %arg1: f32) { +func.func @use_def_graph_partial(%arg0: f32, %arg1: f32) { sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -144,7 +144,7 @@ func @use_def_graph_partial(%arg0: f32, %arg1: f32) { // CHECK-LABEL: @fby // Check that the pass is not confused by fby self-dependency. -func @fby(%arg0: f32) { +func.func @fby(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -168,7 +168,7 @@ func @fby(%arg0: f32) { } // CHECK-LABEL: @fby_many_compute -func @fby_many_compute(%arg0: f32) -> f32 { +func.func @fby_many_compute(%arg0: f32) -> f32 { %out = sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -205,7 +205,7 @@ func @fby_many_compute(%arg0: f32) -> f32 { } // CHECK-LABEL: @fby_two_cycles -func @fby_two_cycles(%arg0: f32) -> f32 { +func.func @fby_two_cycles(%arg0: f32) -> f32 { %out = sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -242,7 +242,7 @@ func @fby_two_cycles(%arg0: f32) -> f32 { } // CHECK-LABEL: @fby_then_different_source -func @fby_then_different_source(%arg0: f32) { +func.func @fby_then_different_source(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -271,7 +271,7 @@ func @fby_then_different_source(%arg0: f32) { } // CHECK-LABEL: @sequence_domain -func @sequence_domain(%arg0: index) { +func.func @sequence_domain(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.dyn_range %0 : !sair.dyn_range @@ -294,7 +294,7 @@ func @sequence_domain(%arg0: index) { } // CHECK-LABEL: @sequence_implicit_domain -func @sequence_implicit_domain(%arg0: index) { +func.func @sequence_implicit_domain(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.dyn_range %0 : !sair.dyn_range @@ -324,7 +324,7 @@ func @sequence_implicit_domain(%arg0: index) { } // CHECK-LABEL: @sequence_implicit_domain_partial -func @sequence_implicit_domain_partial(%arg0: index) { +func.func @sequence_implicit_domain_partial(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.dyn_range %0 : !sair.dyn_range @@ -360,7 +360,7 @@ func @sequence_implicit_domain_partial(%arg0: index) { // It shouldn't be a problem to have a dynamic range for a rematerialized // dimension to be defined after its used as long as there is no circular // dependency introduced. -func @reordered_remat(%arg0: f32) { +func.func @reordered_remat(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // CHECK: sair.copy diff --git a/test/default_storage.mlir b/test/default_storage.mlir index 492091e1..cf21e2fa 100644 --- a/test/default_storage.mlir +++ b/test/default_storage.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt %s -sair-assign-default-storage | FileCheck %s // CHECK-LABEL: @memory_space_is_set -func @memory_space_is_set() { +func.func @memory_space_is_set() { sair.program { // CHECK: %{{.*}} = sair.map attributes { // CHECK: storage = [{layout = #sair.named_mapping<[] -> ()>, space = "register"}] @@ -16,7 +16,7 @@ func @memory_space_is_set() { } // CHECK-LABEL: @preserve_memory_space -func @preserve_memory_space() { +func.func @preserve_memory_space() { sair.program { // CHECK: %{{.*}} = sair.map attributes { // CHECK: storage = [{layout = #sair.named_mapping<[] -> ()>, name = "A", space = "memory"}] @@ -36,7 +36,7 @@ func @preserve_memory_space() { } // CHECK-LABEL: @multi_dim -func @multi_dim(%arg0: f32, %arg1: memref<8x8xf32>) { +func.func @multi_dim(%arg0: f32, %arg1: memref<8x8xf32>) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -79,7 +79,7 @@ func @multi_dim(%arg0: f32, %arg1: memref<8x8xf32>) { } // CHECK-LABEL: @to_memref_proj_fby -func @to_memref_proj_fby(%arg0: f32, %arg1: memref) { +func.func @to_memref_proj_fby(%arg0: f32, %arg1: memref) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -116,7 +116,7 @@ func @to_memref_proj_fby(%arg0: f32, %arg1: memref) { } // CHECK-LABEL: @propagate_storage -func @propagate_storage(%arg0: f32) { +func.func @propagate_storage(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -136,7 +136,7 @@ func @propagate_storage(%arg0: f32) { } // CHECK-LABEL: @non_rectangular -func @non_rectangular_shape(%arg0: f32, %arg1: index) { +func.func @non_rectangular_shape(%arg0: f32, %arg1: index) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -170,7 +170,7 @@ func @non_rectangular_shape(%arg0: f32, %arg1: index) { } // CHECK-LABEL: @buffer_reuse -func @buffer_reuse(%arg0: f32) { +func.func @buffer_reuse(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> diff --git a/test/default_storage_invalid.mlir b/test/default_storage_invalid.mlir index 0ed9e44f..842290ac 100644 --- a/test/default_storage_invalid.mlir +++ b/test/default_storage_invalid.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt -sair-assign-default-storage -split-input-file -verify-diagnostics %s -func @expected_loop_nest(%arg0: f32) { +func.func @expected_loop_nest(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{expected a loop-nest attribute}} @@ -14,7 +14,7 @@ func @expected_loop_nest(%arg0: f32) { // ----- -func @index_to_memory(%arg0: index) { +func.func @index_to_memory(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.dyn_range %0 : !sair.dyn_range @@ -36,7 +36,7 @@ func @index_to_memory(%arg0: index) { // ----- -func @non_rectangular_shape(%arg0: f32, %arg1: index) { +func.func @non_rectangular_shape(%arg0: f32, %arg1: index) { // expected-error @+1 {{unable to generate storage attributes}} sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -67,7 +67,7 @@ func @non_rectangular_shape(%arg0: f32, %arg1: index) { // ----- -func @incomplete_loop_nest(%arg0: memref<4xf32>, %arg1: index) { +func.func @incomplete_loop_nest(%arg0: memref<4xf32>, %arg1: index) { %c = arith.constant 42.0 : f32 sair.program { %n = sair.from_scalar %arg1 : !sair.value<(), index> @@ -87,7 +87,7 @@ func @incomplete_loop_nest(%arg0: memref<4xf32>, %arg1: index) { // ----- -func @increase_external_buffer_rank(%arg0: memref, %arg1: index) { +func.func @increase_external_buffer_rank(%arg0: memref, %arg1: index) { sair.program { %n = sair.from_scalar %arg1 : !sair.value<(), index> %r = sair.dyn_range %n : !sair.dyn_range diff --git a/test/from_linalg.mlir b/test/from_linalg.mlir index 59d6bc44..11f2e1d3 100644 --- a/test/from_linalg.mlir +++ b/test/from_linalg.mlir @@ -10,7 +10,7 @@ } // CHECK-LABEL: @pointwise -func @pointwise(%arg0: memref<1x2x3xf32>, %arg1: memref<2x3x1xf32>) { +func.func @pointwise(%arg0: memref<1x2x3xf32>, %arg1: memref<2x3x1xf32>) { // CHECK: %[[s0:.*]] = sair.static_range : !sair.static_range<1> // CHECK: %[[s1:.*]] = sair.static_range : !sair.static_range<2> // CHECK: %[[s2:.*]] = sair.static_range : !sair.static_range<3> @@ -51,7 +51,7 @@ func @pointwise(%arg0: memref<1x2x3xf32>, %arg1: memref<2x3x1xf32>) { // CHECK-LABEL: @dynamic // CHECK: (%[[ARG0:.*]]: memref, %[[ARG1:.*]]: memref<2x?x?xf32>) -func @dynamic(%arg0: memref, %arg1: memref<2x?x?xf32>) { +func.func @dynamic(%arg0: memref, %arg1: memref<2x?x?xf32>) { // CHECK: %[[DIM0_0:.*]] = memref.dim %[[ARG0]], %c0 // CHECK: %[[DIM0_2:.*]] = memref.dim %[[ARG0]], %c2 // CHECK: %[[DIM1_1:.*]] = memref.dim %[[ARG1]], %c1 @@ -109,7 +109,7 @@ func @dynamic(%arg0: memref, %arg1: memref<2x?x?xf32>) { } // CHECK-LABEL: @reductions -func @reductions(%arg0: memref<2x3x4x5x6xf32>, %arg1: memref<2x4x6xf32>) { +func.func @reductions(%arg0: memref<2x3x4x5x6xf32>, %arg1: memref<2x4x6xf32>) { // CHECK: %[[s0:.*]] = sair.static_range : !sair.static_range<2> // CHECK: %[[s1:.*]] = sair.static_range : !sair.static_range<3> // CHECK: %[[s2:.*]] = sair.static_range : !sair.static_range<4> @@ -153,7 +153,7 @@ func @reductions(%arg0: memref<2x3x4x5x6xf32>, %arg1: memref<2x4x6xf32>) { } // CHECK-LABEL: @indices -func @indices(%arg0: memref<1x2x3xf32>, %arg1: memref<2x3x1xf32>) { +func.func @indices(%arg0: memref<1x2x3xf32>, %arg1: memref<2x3x1xf32>) { // CHECK: sair.map // CHECK: ^{{.*}}(%[[I0:.*]]: index, %[[I1:.*]]: index, %[[I2:.*]]: index, %{{.*}}: f32, %{{.*}}: f32): linalg.generic #pointwise_trait diff --git a/test/from_linalg_invalid.mlir b/test/from_linalg_invalid.mlir index 7f20f347..47358ec3 100644 --- a/test/from_linalg_invalid.mlir +++ b/test/from_linalg_invalid.mlir @@ -10,7 +10,7 @@ "parallel"] } -func @reductions(%arg0: memref<2x3x4x5x6xf32>, %arg1: memref<2x4x6xf32>) { +func.func @reductions(%arg0: memref<2x3x4x5x6xf32>, %arg1: memref<2x4x6xf32>) { // expected-error @+1 {{unexpected output tensor expression in indexing map #0 a.k.a 'd3' is function of reduction iterator 'd3'}} linalg.generic #reductions_trait ins(%arg0 : memref<2x3x4x5x6xf32>) @@ -33,7 +33,7 @@ func @reductions(%arg0: memref<2x3x4x5x6xf32>, %arg1: memref<2x4x6xf32>) { iterator_types = ["parallel"] } -func @shape_mismatch(%arg0: memref, %arg1: memref<2xf32>) { +func.func @shape_mismatch(%arg0: memref, %arg1: memref<2xf32>) { // expected-error @+1 {{Linalg op is not compatible with Sair}} linalg.generic #pointwise_trait ins(%arg0 : memref) diff --git a/test/inline_trivial_sair_ops.mlir b/test/inline_trivial_sair_ops.mlir index 67500359..f4660273 100644 --- a/test/inline_trivial_sair_ops.mlir +++ b/test/inline_trivial_sair_ops.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt -inline-trivial-sair-ops %s | FileCheck %s // CHECK-LABEL: @one_map -func @one_map() -> f32 { +func.func @one_map() -> f32 { // CHECK: %[[v0:.*]] = arith.constant 1.0 %0 = arith.constant 1.0 : f32 // CHECK-NOT: sair.program @@ -24,7 +24,7 @@ func @one_map() -> f32 { } // CHECK-LABEL: @sequence -func @sequence() -> f32 { +func.func @sequence() -> f32 { // CHECK: %[[v0:.*]] = arith.constant 1.0 %0 = arith.constant 1.0 : f32 // CHECK-NOT: sair.program @@ -47,7 +47,7 @@ func @sequence() -> f32 { } // CHECK-LABEL: @do_nothing -func @do_nothing() { +func.func @do_nothing() { %0 = arith.constant 1.0 : f32 sair.program { %1 = sair.static_range : !sair.static_range<8> diff --git a/test/integration/sair_to_llvm.mlir b/test/integration/sair_to_llvm.mlir index ad01f7ed..891c45f3 100644 --- a/test/integration/sair_to_llvm.mlir +++ b/test/integration/sair_to_llvm.mlir @@ -6,7 +6,7 @@ // Helper function that returns 1.0 if the two memrefs are equal and 0.0 // otherwise. -func @check_memrefs_equal(%lhs: memref<8xi32>, %rhs: memref<8xi32>) -> f32 { +func.func @check_memrefs_equal(%lhs: memref<8xi32>, %rhs: memref<8xi32>) -> f32 { %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index %c8 = arith.constant 8 : index @@ -31,7 +31,7 @@ func @check_memrefs_equal(%lhs: memref<8xi32>, %rhs: memref<8xi32>) -> f32 { return %7 : f32 } -func @from_scalar() -> f32 { +func.func @from_scalar() -> f32 { %0 = arith.constant 1.0 : f32 %2 = sair.program { %1 = sair.from_scalar %0 : !sair.value<(), f32> @@ -40,7 +40,7 @@ func @from_scalar() -> f32 { return %2 : f32 } -func @from_to_memref() -> f32 { +func.func @from_to_memref() -> f32 { %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index %c8 = arith.constant 8 : index diff --git a/test/integration/sair_to_loop.mlir b/test/integration/sair_to_loop.mlir index 1f3f605f..814327d8 100644 --- a/test/integration/sair_to_loop.mlir +++ b/test/integration/sair_to_loop.mlir @@ -2,7 +2,7 @@ // RUN: -canonicalize -mlir-print-local-scope %s | FileCheck %s // CHECK-LABEL: @empty_program -func @empty_program() { +func.func @empty_program() { // CHECK-NOT: sair.program sair.program { // CHECK-NOT: sair.exit @@ -13,7 +13,7 @@ func @empty_program() { // CHECK-LABEL: @copy_to_memref // CHECK: %[[ARG0:.*]]: memref<8xf32>, %[[ARG1:.*]]: memref<8xf32> -func @copy_to_memref(%arg0: memref<8xf32>, %arg1: memref<8xf32>) { +func.func @copy_to_memref(%arg0: memref<8xf32>, %arg1: memref<8xf32>) { // CHECK-NOT: sair.program sair.program { // CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index @@ -41,7 +41,7 @@ func @copy_to_memref(%arg0: memref<8xf32>, %arg1: memref<8xf32>) { // CHECK-LABEL: @matmul // CHECK: %[[A:.*]]: memref<8x8xf32>, %[[B:.*]]: memref<8x8xf32>, %[[C:.*]]: memref<8x8xf32> -func @matmul(%arg0: memref<8x8xf32>, +func.func @matmul(%arg0: memref<8x8xf32>, %arg1: memref<8x8xf32>, %arg2: memref<8x8xf32>) { // CHECK-DAG: %[[CF0:.*]] = arith.constant 0.0 diff --git a/test/introduce_loops.mlir b/test/introduce_loops.mlir index b20a7ed0..224ab3ab 100644 --- a/test/introduce_loops.mlir +++ b/test/introduce_loops.mlir @@ -1,10 +1,10 @@ // RUN: sair-opt %s -sair-introduce-loops | FileCheck %s -func @foo(%arg0: index, %arg1: index) { return } +func.func @foo(%arg0: index, %arg1: index) { return } // CHECK-LABEL: @map // CHECK: %[[ARG0:.*]]: index -func @map(%arg0: index) { +func.func @map(%arg0: index) { sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar %[[ARG0]] %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), index> @@ -43,7 +43,7 @@ func @map(%arg0: index) { } // CHECK-LABEL: @proj_last -func @proj_last(%arg0: f32) { +func.func @proj_last(%arg0: f32) { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<8> %1 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> @@ -64,10 +64,10 @@ func @proj_last(%arg0: f32) { return } -func @bar(%arg0: f32) -> f32 { return %arg0 : f32 } +func.func @bar(%arg0: f32) -> f32 { return %arg0 : f32 } // CHECK-LABEL: @fby -func @fby(%arg0: f32) { +func.func @fby(%arg0: f32) { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<8> // CHECK: %[[V0:.*]] = sair.from_scalar @@ -93,7 +93,7 @@ func @fby(%arg0: f32) { } // CHECK-LABEL: @fuse -func @fuse(%arg0: f32) { +func.func @fuse(%arg0: f32) { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<4> %1 = sair.static_range { instances = [{}] } : !sair.static_range<8> @@ -142,7 +142,7 @@ func @fuse(%arg0: f32) { } // CHECK-LABEL: @fuse_reorder -func @fuse_reorder(%arg0: f32) { +func.func @fuse_reorder(%arg0: f32) { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<8> %1 = sair.static_range { instances = [{}] } : !sair.static_range<16> @@ -217,7 +217,7 @@ func @fuse_reorder(%arg0: f32) { } // CHECK-LABEL: @dependent_dims -func @dependent_dims() { +func.func @dependent_dims() { sair.program { // CHECK: sair.map // CHECK-DAG: %[[V0:.*]] = arith.constant 0 @@ -267,10 +267,10 @@ func @dependent_dims() { return } -func private @baz() +func.func private @baz() // CHECK-LABEL: @full_unroll -func @full_unroll() { +func.func @full_unroll() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<3> // CHECK: sair.map @@ -294,7 +294,7 @@ func @full_unroll() { } // CHECK-LABEL: @partial_unroll -func @partial_unroll() { +func.func @partial_unroll() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<5> // CHECK: sair.map @@ -323,7 +323,7 @@ func @partial_unroll() { } // CHECK-LABEL: @dyn_range_unroll -func @dyn_range_unroll(%sz: index) { +func.func @dyn_range_unroll(%sz: index) { sair.program { %0 = sair.from_scalar %sz { instances = [{}] } : !sair.value<(), index> %1 = sair.dyn_range %0 { instances = [{}] } : !sair.dyn_range @@ -353,7 +353,7 @@ func @dyn_range_unroll(%sz: index) { } // CHECK-LABEL: @nested_unroll -func @nested_unroll() { +func.func @nested_unroll() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<2> // CHECK: sair.map diff --git a/test/introduce_loops_invalid.mlir b/test/introduce_loops_invalid.mlir index c7607da1..85a874f4 100644 --- a/test/introduce_loops_invalid.mlir +++ b/test/introduce_loops_invalid.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt -split-input-file -sair-introduce-loops -verify-diagnostics %s -func @must_lower_to_map() { +func.func @must_lower_to_map() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<8> // expected-error @+1 {{operation must be lowered to sair.map}} @@ -19,7 +19,7 @@ func @must_lower_to_map() { // ----- -func @missing_loop_nest_attribute() { +func.func @missing_loop_nest_attribute() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<8> // expected-error @+1 {{missing loop_nest attribute}} @@ -36,7 +36,7 @@ func @missing_loop_nest_attribute() { // ----- -func @proj_any_must_be_eliminated() { +func.func @proj_any_must_be_eliminated() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<8> %1 = sair.map[d0:%0] attributes { @@ -55,7 +55,7 @@ func @proj_any_must_be_eliminated() { // ----- -func @strip_mined_loop() { +func.func @strip_mined_loop() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<8> // expected-error @+1 {{loop must not rematerialize or be strip-mined}} @@ -77,7 +77,7 @@ func @strip_mined_loop() { // ----- -func @unable_to_create_default_value() { +func.func @unable_to_create_default_value() { %0 = sair.program { %1 = sair.static_range { instances = [{}] } : !sair.static_range<8> // expected-error @+1 {{unable to create a default value of type 'memref'}} @@ -98,7 +98,7 @@ func @unable_to_create_default_value() { // ----- -func @proj_of_fby(%arg0: f32) { +func.func @proj_of_fby(%arg0: f32) { %0 = sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> %1 = sair.static_range { instances = [{}] } : !sair.static_range<8> @@ -121,9 +121,9 @@ func @proj_of_fby(%arg0: f32) { // ----- -func @foo() { return } +func.func @foo() { return } -func @size_not_in_register(%arg0: index) { +func.func @size_not_in_register(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), index> %1 = sair.map %0 attributes { @@ -148,7 +148,7 @@ func @size_not_in_register(%arg0: index) { // ----- -func @placeholder() { +func.func @placeholder() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<8> // expected-error @+1 {{placeholders must be replaced by actual dimensions before introducing loops}} @@ -176,7 +176,7 @@ func @placeholder() { // ----- -func @copies(%arg0: f32) { +func.func @copies(%arg0: f32) { sair.program { // expected-error @+1 {{operations must have exactly one instance when introducing loops}} sair.from_scalar %arg0 { diff --git a/test/invalid.mlir b/test/invalid.mlir index 7a70c168..5ad1fccd 100644 --- a/test/invalid.mlir +++ b/test/invalid.mlir @@ -1,50 +1,50 @@ // RUN: sair-opt --allow-unregistered-dialect -split-input-file -verify-diagnostics %s // expected-error @+1 {{invalid sair type}} -func @invalid_type() -> !sair.foo +func.func @invalid_type() -> !sair.foo // ----- // expected-error @+1 {{unexpected nul or EOF}} -func @unfinished_range_dep() -> !sair.dyn_range !sair.dyn_range'}} -func @garbage_in_range_dep() -> !sair.dyn_range +func.func @garbage_in_range_dep() -> !sair.dyn_range // ----- // expected-error @+1 {{dimension 'd1' is out of range (0 dimensions)}} -func @invalid_dep() -> !sair.dyn_range +func.func @invalid_dep() -> !sair.dyn_range // ----- // expected-error @+1 {{invalid dimension name}} -func @invalid_dep() -> !sair.dyn_range +func.func @invalid_dep() -> !sair.dyn_range // ----- // expected-error @+1 {{non-transitive dependency}} -func @non_transitive_dependency() -> !sair.dyn_range +func.func @non_transitive_dependency() -> !sair.dyn_range // ----- // expected-error @+1 {{invalid mapping}} -func @duplicate_dependency() -> !sair.dyn_range +func.func @duplicate_dependency() -> !sair.dyn_range // ----- // expected-error @+1 {{expected 'd1'}} -func @shape_dim_redefinition() -> !sair.dyn_range +func.func @shape_dim_redefinition() -> !sair.dyn_range // ----- // expected-error @+1 {{the mapping must map all dimensions}} -func @shape_none_dim() -> !sair.dyn_range +func.func @shape_none_dim() -> !sair.dyn_range // ----- -func @operand_mapping_dim_not_mapped(%arg0: f32) { +func.func @operand_mapping_dim_not_mapped(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -58,7 +58,7 @@ func @operand_mapping_dim_not_mapped(%arg0: f32) { // ----- -func @operand_mapping_dim_not_mapped_raw(%arg0: f32) { +func.func @operand_mapping_dim_not_mapped_raw(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -74,7 +74,7 @@ func @operand_mapping_dim_not_mapped_raw(%arg0: f32) { // ----- -func @dimension_out_of_range() { +func.func @dimension_out_of_range() { // expected-error @+1 {{dimension 'd2' is out of range}} "foo"() {mapping = #sair.mapping<2 : d0, d1, d2>} : () -> () } @@ -82,7 +82,7 @@ func @dimension_out_of_range() { // ----- // expected-note @+1 {{prior use here}} -func @dyn_range_op_invalid_type(%arg0 : !sair.value<(), index>) { +func.func @dyn_range_op_invalid_type(%arg0 : !sair.value<(), index>) { sair.program { // expected-error @+1 {{expects different type}} %1 = sair.dyn_range[d0:%arg0] %arg0 : !sair.dyn_range @@ -93,7 +93,7 @@ func @dyn_range_op_invalid_type(%arg0 : !sair.value<(), index>) { // ----- -func @domain_unexpected_num_dims(%arg0 : !sair.value<(), index>) { +func.func @domain_unexpected_num_dims(%arg0 : !sair.value<(), index>) { sair.program { %0 = sair.dyn_range %arg0 : !sair.dyn_range // expected-error @+1 {{2 operands present, but expected 1}} @@ -105,7 +105,7 @@ func @domain_unexpected_num_dims(%arg0 : !sair.value<(), index>) { // ----- -func @domain_unexpected_dimension_type(%arg0 : !sair.value<(), index>) { +func.func @domain_unexpected_dimension_type(%arg0 : !sair.value<(), index>) { sair.program { // expected-note @+1 {{prior use here}} %0 = sair.dyn_range %arg0 : !sair.dyn_range @@ -118,7 +118,7 @@ func @domain_unexpected_dimension_type(%arg0 : !sair.value<(), index>) { // ----- -func @domain_dim_redefinition(%arg0 : !sair.value<(), index>) { +func.func @domain_dim_redefinition(%arg0 : !sair.value<(), index>) { sair.program { %0 = sair.dyn_range %arg0 : !sair.dyn_range // expected-error @+1 {{expected 'd1'}} @@ -130,7 +130,7 @@ func @domain_dim_redefinition(%arg0 : !sair.value<(), index>) { // ----- -func @fby_cycle(%arg0: f32) { +func.func @fby_cycle(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> // expected-error @below {{unexpected use-def cycle}} @@ -147,7 +147,7 @@ func @fby_cycle(%arg0: f32) { // ----- -func @copy_cycle(%arg0: f32) { +func.func @copy_cycle(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> // expected-error @below {{unexpected use-def cycle}} @@ -170,7 +170,7 @@ func @copy_cycle(%arg0: f32) { // ----- -func @mixed_cycle(%arg0: f32) { +func.func @mixed_cycle(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> // expected-error @below {{unexpected use-def cycle}} @@ -186,7 +186,7 @@ func @mixed_cycle(%arg0: f32) { // ----- -func @domain_cycle(%arg0: f32, %arg1: index) { +func.func @domain_cycle(%arg0: f32, %arg1: index) { sair.program { %0 = sair.from_scalar %arg1 : !sair.value<(), index> %1 = sair.static_range : !sair.static_range<42> @@ -203,7 +203,7 @@ func @domain_cycle(%arg0: f32, %arg1: index) { // ----- -func @invalid_mapping(%arg0 : !sair.dyn_range, +func.func @invalid_mapping(%arg0 : !sair.dyn_range, // expected-note @+1 {{prior use here}} %arg1 : !sair.value) { sair.program { @@ -216,14 +216,14 @@ func @invalid_mapping(%arg0 : !sair.dyn_range, // ----- -func @invalid_attr_name() { +func.func @invalid_attr_name() { // expected-error @+1 {{unexpected Sair attribute}} "foo"() {shape=#sair.invalid_attr_name<()>} : () -> () } // ----- -func @copy_exected_same_element_type(%arg0 : f32) { +func.func @copy_exected_same_element_type(%arg0 : f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{same element type}} @@ -236,7 +236,7 @@ func @copy_exected_same_element_type(%arg0 : f32) { // ----- -func @invalid_use_domain_size(%arg0 : f32) { +func.func @invalid_use_domain_size(%arg0 : f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{invalid use domain size}} @@ -249,7 +249,7 @@ func @invalid_use_domain_size(%arg0 : f32) { // ----- -func @copy_expected_value() { +func.func @copy_expected_value() { sair.program { // expected-error @+1 {{expected a sair value access}} sair.copy : !sair.value<(), f32> @@ -260,7 +260,7 @@ func @copy_expected_value() { // ----- -func @from_memref_exected_same_element_type(%arg0 : memref) { +func.func @from_memref_exected_same_element_type(%arg0 : memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), memref> // expected-error @+1 {{same element type}} @@ -277,7 +277,7 @@ func @from_memref_exected_same_element_type(%arg0 : memref) { // ----- -func @load_from_memref_exected_same_element_type(%arg0 : memref) { +func.func @load_from_memref_exected_same_element_type(%arg0 : memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), memref> // expected-error @+1 {{memref and value type must have the same element type}} @@ -290,7 +290,7 @@ func @load_from_memref_exected_same_element_type(%arg0 : memref) { // ----- -func @load_from_memref_rank_mismatch(%arg0 : memref) { +func.func @load_from_memref_rank_mismatch(%arg0 : memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), memref> // expected-error @+1 {{memref and layout must have the same rank}} @@ -303,7 +303,7 @@ func @load_from_memref_rank_mismatch(%arg0 : memref) { // ----- -func @load_from_memref_layout_partially_specified(%arg0 : memref) { +func.func @load_from_memref_layout_partially_specified(%arg0 : memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), memref> // expected-error @+1 {{layout must be surjective}} @@ -316,7 +316,7 @@ func @load_from_memref_layout_partially_specified(%arg0 : memref) { // ----- -func @hyper_rectangular_domain(%arg0: index, %arg1 : memref) { +func.func @hyper_rectangular_domain(%arg0: index, %arg1 : memref) { sair.program { %0 = sair.static_range :!sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), index> @@ -334,7 +334,7 @@ func @hyper_rectangular_domain(%arg0: index, %arg1 : memref) { // ----- -func @from_memref_rank(%arg0 : memref) { +func.func @from_memref_rank(%arg0 : memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), memref> // expected-error @+1 {{expected memref of rank 0, got 1}} @@ -348,7 +348,7 @@ func @from_memref_rank(%arg0 : memref) { // ----- -func @map_wrong_body_argument_count(%arg0 : f32) { +func.func @map_wrong_body_argument_count(%arg0 : f32) { sair.program { %0 = sair.static_range :!sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -364,7 +364,7 @@ func @map_wrong_body_argument_count(%arg0 : f32) { // ----- -func @map_wrong_body_argument_type(%arg0 : f32) { +func.func @map_wrong_body_argument_type(%arg0 : f32) { sair.program { %0 = sair.static_range :!sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -380,7 +380,7 @@ func @map_wrong_body_argument_type(%arg0 : f32) { // ----- -func @map_wrong_body_argument_trailing_type(%arg0 : f32) { +func.func @map_wrong_body_argument_trailing_type(%arg0 : f32) { sair.program { %0 = sair.static_range :!sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -396,7 +396,7 @@ func @map_wrong_body_argument_trailing_type(%arg0 : f32) { // ----- -func @map_wrong_terminator() { +func.func @map_wrong_terminator() { sair.program { // expected-error @+1 {{expects body to be terminated with 'sair.return'}} sair.map { @@ -410,7 +410,7 @@ func @map_wrong_terminator() { // ----- -func @map_wrong_terminator_operand() { +func.func @map_wrong_terminator_operand() { sair.program { // expected-error @+1 {{expects element types of results to match operand types of the body terminator}} sair.map { @@ -426,7 +426,7 @@ func @map_wrong_terminator_operand() { // ----- -func @map_wrong_trailing_arg_count() { +func.func @map_wrong_trailing_arg_count() { sair.program { %0 = sair.static_range : !sair.static_range<8> sair.map[d0:%0] { @@ -440,7 +440,7 @@ func @map_wrong_trailing_arg_count() { // ----- -func @map_reduce_wrong_trailing_arg_count(%arg0 : f32) { +func.func @map_reduce_wrong_trailing_arg_count(%arg0 : f32) { sair.program { %0 = sair.static_range :!sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -456,7 +456,7 @@ func @map_reduce_wrong_trailing_arg_count(%arg0 : f32) { // ----- -func @map_reduce_wrong_trailing_res_count(%arg0 : f32) { +func.func @map_reduce_wrong_trailing_res_count(%arg0 : f32) { sair.program { %1 = sair.from_scalar %arg0 : !sair.value<(), f32> sair.map_reduce %1 reduce { @@ -472,7 +472,7 @@ func @map_reduce_wrong_trailing_res_count(%arg0 : f32) { // ----- -func @map_reduce_wrong_body_argument_count(%arg0 : f32) { +func.func @map_reduce_wrong_body_argument_count(%arg0 : f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -489,7 +489,7 @@ func @map_reduce_wrong_body_argument_count(%arg0 : f32) { // ----- -func @map_reduce_wrong_terminator_type(%arg0 : f32) { +func.func @map_reduce_wrong_terminator_type(%arg0 : f32) { sair.program { %0 = sair.static_range :!sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -507,7 +507,7 @@ func @map_reduce_wrong_terminator_type(%arg0 : f32) { // ----- -func @map_reduce_init_accessing_reduction(%arg0 : f32) { +func.func @map_reduce_init_accessing_reduction(%arg0 : f32) { sair.program { %0 = sair.static_range :!sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -530,7 +530,7 @@ func @map_reduce_init_accessing_reduction(%arg0 : f32) { // ----- -func @map_reduce_unexpected_shape() { +func.func @map_reduce_unexpected_shape() { sair.program { // expected-error @+1 {{unexpected shape}} "sair.map_reduce"() ({ @@ -549,7 +549,7 @@ func @map_reduce_unexpected_shape() { // ----- -func @from_scalar_element_type() { +func.func @from_scalar_element_type() { // expected-note @+1 {{prior use here}} %0 = arith.constant 0 : index sair.program { @@ -562,7 +562,7 @@ func @from_scalar_element_type() { // ----- -func @from_scalar_element_type_generic_form() { +func.func @from_scalar_element_type_generic_form() { %0 = arith.constant 0 : index sair.program { // expected-error @+1 {{expects different type}} @@ -574,7 +574,7 @@ func @from_scalar_element_type_generic_form() { // ----- -func @sair_program_non_sair_op() { +func.func @sair_program_non_sair_op() { // expected-error @+1 {{expected only Sair operations in the body}} sair.program { // expected-note @+1 {{found}} @@ -586,7 +586,7 @@ func @sair_program_non_sair_op() { // ----- -func @sair_op_outside_sair_program() { +func.func @sair_op_outside_sair_program() { // expected-error @+1 {{expected to be immediately contained in a 'sair.program'}} %0 = sair.static_range : !sair.static_range<42> return @@ -594,7 +594,7 @@ func @sair_op_outside_sair_program() { // ----- -func @sair_value_defined_outside_sair_program(%arg0: !sair.value<(), f32>) { +func.func @sair_value_defined_outside_sair_program(%arg0: !sair.value<(), f32>) { sair.program { // expected-error @+1 {{sair values must be defined in the region they are used}} %0 = sair.copy %arg0 : !sair.value<(), f32> @@ -605,7 +605,7 @@ func @sair_value_defined_outside_sair_program(%arg0: !sair.value<(), f32>) { // ----- -func @sair_dimension_defined_outside_sair_program(%arg0: !sair.dyn_range) { +func.func @sair_dimension_defined_outside_sair_program(%arg0: !sair.dyn_range) { %0 = arith.constant 1.0 : f32 sair.program { %1 = sair.from_scalar %0 : !sair.value<(), f32> @@ -618,7 +618,7 @@ func @sair_dimension_defined_outside_sair_program(%arg0: !sair.dyn_range) { // ----- -func @sair_program_wrong_terminator() { +func.func @sair_program_wrong_terminator() { // expected-error @+1 {{expected a sair.exit terminator}} sair.program { sair.static_range : !sair.static_range<8> @@ -628,7 +628,7 @@ func @sair_program_wrong_terminator() { // ----- -func @sair_exit_wrong_num_operands() { +func.func @sair_exit_wrong_num_operands() { %0 = sair.program { // expected-error @+1 {{expected 1 operands, found 0}} sair.exit @@ -638,7 +638,7 @@ func @sair_exit_wrong_num_operands() { // ----- -func @sair_exit_wrong_type() { +func.func @sair_exit_wrong_type() { %c0 = arith.constant 1 : i32 %0 = sair.program { %1 = sair.from_scalar %c0 : !sair.value<(), i32> @@ -650,7 +650,7 @@ func @sair_exit_wrong_type() { // ----- -func @sair_exit_type_operands_mismatch() { +func.func @sair_exit_type_operands_mismatch() { sair.program { // expected-error @+1 {{expected 0 types}} sair.exit : f32 @@ -659,7 +659,7 @@ func @sair_exit_type_operands_mismatch() { // ----- -func @expected_loop_attr() { +func.func @expected_loop_attr() { sair.program { // expected-error @+1 {{attribute 'instances' failed to satisfy constraint}} sair.map attributes {instances = [{loop_nest = [0]}]} { @@ -672,7 +672,7 @@ func @expected_loop_attr() { // ----- -func @loop_name_used_twice(%arg0: f32) { +func.func @loop_name_used_twice(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -692,7 +692,7 @@ func @loop_name_used_twice(%arg0: f32) { // ----- -func @dim_not_covered_by_loop_nest(%arg0: f32) { +func.func @dim_not_covered_by_loop_nest(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -706,7 +706,7 @@ func @dim_not_covered_by_loop_nest(%arg0: f32) { // ----- -func @loop_dependencies_not_covered(%arg0: index, %arg1: f32) { +func.func @loop_dependencies_not_covered(%arg0: index, %arg1: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), index> @@ -729,7 +729,7 @@ func @loop_dependencies_not_covered(%arg0: index, %arg1: f32) { // ----- -func @unknown_dim_in_loop_nest(%arg0: f32) { +func.func @unknown_dim_in_loop_nest(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{dimension 'd0' is out of range of the domain}} @@ -743,7 +743,7 @@ func @unknown_dim_in_loop_nest(%arg0: f32) { // ----- -func @loop_step_increasing(%arg0: f32) { +func.func @loop_step_increasing(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -763,7 +763,7 @@ func @loop_step_increasing(%arg0: f32) { // ----- -func @loop_fusion_different_prefix(%arg0: f32) { +func.func @loop_fusion_different_prefix(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -792,7 +792,7 @@ func @loop_fusion_different_prefix(%arg0: f32) { // ----- -func @loop_fusion_not_contiguous(%arg0: f32) { +func.func @loop_fusion_not_contiguous(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -819,7 +819,7 @@ func @loop_fusion_not_contiguous(%arg0: f32) { // ----- -func @iter_field_missing(%arg0: f32) { +func.func @iter_field_missing(%arg0: f32) { sair.program { %1 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{in loop "A": iterator is not fully specified}} @@ -833,7 +833,7 @@ func @iter_field_missing(%arg0: f32) { // ----- -func @loop_definition_mismatch(%arg0: f32) { +func.func @loop_definition_mismatch(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -855,7 +855,7 @@ func @loop_definition_mismatch(%arg0: f32) { // ----- -func @init_nested_in_reduction_loop(%arg0: f32) { +func.func @init_nested_in_reduction_loop(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -877,7 +877,7 @@ func @init_nested_in_reduction_loop(%arg0: f32) { // ----- -func @dimension_defined_in_loop_nest(%arg0: index, %arg1: f32) { +func.func @dimension_defined_in_loop_nest(%arg0: index, %arg1: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.from_scalar %arg1 : !sair.value<(), f32> @@ -897,7 +897,7 @@ func @dimension_defined_in_loop_nest(%arg0: index, %arg1: f32) { // ----- -func @proj_last_dependency(%arg0: f32) { +func.func @proj_last_dependency(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -916,7 +916,7 @@ func @proj_last_dependency(%arg0: f32) { // ----- -func @mapped_dimensions(%arg0: f32) { +func.func @mapped_dimensions(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -945,7 +945,7 @@ func @mapped_dimensions(%arg0: f32) { // ----- -func @dimension_size_loop_nest(%arg0: index, %arg1: f32) { +func.func @dimension_size_loop_nest(%arg0: index, %arg1: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.from_scalar %arg1 : !sair.value<(), f32> @@ -980,7 +980,7 @@ func @dimension_size_loop_nest(%arg0: index, %arg1: f32) { // ----- -func @fby_must_fuse(%arg0: f32) { +func.func @fby_must_fuse(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -999,7 +999,7 @@ func @fby_must_fuse(%arg0: f32) { // ----- -func @fby_of_proj_dependency(%arg0: f32) { +func.func @fby_of_proj_dependency(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1025,7 +1025,7 @@ func @fby_of_proj_dependency(%arg0: f32) { // ----- -func @fby_of_fby_dependency(%arg0: f32) { +func.func @fby_of_fby_dependency(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1051,7 +1051,7 @@ func @fby_of_fby_dependency(%arg0: f32) { // ----- // Make sure we don't crash here. -func @fby_dim_out_of_range(%arg0: f32) { +func.func @fby_dim_out_of_range(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1066,7 +1066,7 @@ func @fby_dim_out_of_range(%arg0: f32) { // ----- -func @wrong_order_for_remat(%arg0: index) { +func.func @wrong_order_for_remat(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> // expected-error @+1 {{rematerialized loop "A" indirectly uses the range before it is defined}} @@ -1088,7 +1088,7 @@ func @wrong_order_for_remat(%arg0: index) { // ----- -func @loop_unification_failed(%arg0: f32) { +func.func @loop_unification_failed(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1117,7 +1117,7 @@ func @loop_unification_failed(%arg0: f32) { // ----- -func @loop_unification_failed_subexpr(%arg0: f32) { +func.func @loop_unification_failed_subexpr(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1141,7 +1141,7 @@ func @loop_unification_failed_subexpr(%arg0: f32) { // ----- -func @incompatible_loop_iterators(%arg0: f32) { +func.func @incompatible_loop_iterators(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1161,41 +1161,41 @@ func @incompatible_loop_iterators(%arg0: f32) { // ----- -func @stripe_expected_less_than() { +func.func @stripe_expected_less_than() { // expected-error @+1 {{expected an integer > 2}} "foo"() { bar = #sair.mapping_expr } : () -> () } // ----- -func @invalid_expected_positive() { +func.func @invalid_expected_positive() { // expected-error @+1 {{expected a positive integer}} "foo"() { bar = #sair.mapping_expr } : () -> () } // ----- -func @unstripe_must_end_with_1() { +func.func @unstripe_must_end_with_1() { // expected-error @+1 {{unstripe factors must end with 1}} "foo"() { bar = #sair.mapping_expr } : () -> () } // ----- -func @unstripe_invalid_number_of_factors() { +func.func @unstripe_invalid_number_of_factors() { // expected-error @+1 {{invalid number of factors}} "foo"() { bar = #sair.mapping_expr } : () -> () } // ----- -func @invalid_mapping() { +func.func @invalid_mapping() { // expected-error @+1 {{invalid mapping}} "foo"() { bar = #sair.mapping<1: d0, d0> } : () -> () } // ----- -func @alloc_dim_sizes_mismatch(%arg0: index) { +func.func @alloc_dim_sizes_mismatch(%arg0: index) { sair.program { %0 = sair.static_range : !sair.static_range<2> %idx = sair.from_scalar %arg0 : !sair.value<(), index> @@ -1208,7 +1208,7 @@ func @alloc_dim_sizes_mismatch(%arg0: index) { // ----- -func @loop_crosses_subdomain_boundaries(%arg0: f32) { +func.func @loop_crosses_subdomain_boundaries(%arg0: f32) { %c4 = arith.constant 4 : index sair.program { %sc4 = sair.from_scalar %c4 : !sair.value<(), index> @@ -1232,7 +1232,7 @@ func @loop_crosses_subdomain_boundaries(%arg0: f32) { // ----- -func @storage_wrong_number_of_entries(%arg0: f32) { +func.func @storage_wrong_number_of_entries(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{wrong number of storage entries}} @@ -1249,7 +1249,7 @@ func @storage_wrong_number_of_entries(%arg0: f32) { // ----- -func @storage_invalid_attr(%arg0: f32) { +func.func @storage_invalid_attr(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{storage attribute must be an array of buffers or unit attributes}} @@ -1266,7 +1266,7 @@ func @storage_invalid_attr(%arg0: f32) { // ----- -func @invalid_memory_space(%arg0: f32) { +func.func @invalid_memory_space(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{invalid memory space}} @@ -1286,7 +1286,7 @@ func @invalid_memory_space(%arg0: f32) { // ----- -func @index_variable_in_memory(%arg0: index) { +func.func @index_variable_in_memory(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> // expected-error @+1 {{index and memref variables cannot be allocated in memory}} @@ -1306,7 +1306,7 @@ func @index_variable_in_memory(%arg0: index) { // ----- -func @buffer_must_have_name_if_in_memory(%arg0: f32) { +func.func @buffer_must_have_name_if_in_memory(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{buffers must have a name if and only if they are stored in memory}} @@ -1326,7 +1326,7 @@ func @buffer_must_have_name_if_in_memory(%arg0: f32) { // ----- -func @storage_1D_buffer_register(%arg0: f32) { +func.func @storage_1D_buffer_register(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1347,7 +1347,7 @@ func @storage_1D_buffer_register(%arg0: f32) { // ----- -func @storage_unknown_loop_name(%arg0: f32) { +func.func @storage_unknown_loop_name(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{unknown loop name "loopA"}} @@ -1367,7 +1367,7 @@ func @storage_unknown_loop_name(%arg0: f32) { // ----- -func @fby_operand_different_storage(%arg0: f32) { +func.func @fby_operand_different_storage(%arg0: f32) { sair.program { // expected-error @+1 {{conflicting memory spaces: expected "register", got "memory"}} %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -1389,7 +1389,7 @@ func @fby_operand_different_storage(%arg0: f32) { // ----- -func @fby_operand_different_storage2(%arg0: f32) { +func.func @fby_operand_different_storage2(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1417,7 +1417,7 @@ func @fby_operand_different_storage2(%arg0: f32) { // ----- -func @buffer_different_element_type(%arg0: f32, %arg1: i32) { +func.func @buffer_different_element_type(%arg0: f32, %arg1: i32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.from_scalar %arg1 : !sair.value<(), i32> @@ -1448,7 +1448,7 @@ func @buffer_different_element_type(%arg0: f32, %arg1: i32) { // ----- -func @buffer_layout_incompatible(%arg0: f32) { +func.func @buffer_layout_incompatible(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1479,7 +1479,7 @@ func @buffer_layout_incompatible(%arg0: f32) { // ----- -func @buffer_rank_differs(%arg0: f32) { +func.func @buffer_rank_differs(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1510,7 +1510,7 @@ func @buffer_rank_differs(%arg0: f32) { // ----- -func @layout_depends_on_loops(%arg0: f32, %arg1: index) { +func.func @layout_depends_on_loops(%arg0: f32, %arg1: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.from_scalar %arg1 : !sair.value<(), index> @@ -1550,7 +1550,7 @@ func @layout_depends_on_loops(%arg0: f32, %arg1: index) { // ----- -func @layout_depends_indexed_loop(%arg0: f32) { +func.func @layout_depends_indexed_loop(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1574,7 +1574,7 @@ func @layout_depends_indexed_loop(%arg0: f32) { // ----- -func @buffer_used_before_dimension_def(%arg0: f32, %arg1: index) { +func.func @buffer_used_before_dimension_def(%arg0: f32, %arg1: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -1615,7 +1615,7 @@ func @buffer_used_before_dimension_def(%arg0: f32, %arg1: index) { // ----- -func @buffer_used_before_dimension_def(%arg0: f32, %arg1: index) { +func.func @buffer_used_before_dimension_def(%arg0: f32, %arg1: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.from_scalar %arg1 : !sair.value<(), index> @@ -1657,7 +1657,7 @@ func @buffer_used_before_dimension_def(%arg0: f32, %arg1: index) { // ----- -func @placeholder_loop_nest_unspecified(%arg0: f32) { +func.func @placeholder_loop_nest_unspecified(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.placeholder : !sair.dyn_range @@ -1674,7 +1674,7 @@ func @placeholder_loop_nest_unspecified(%arg0: f32) { // ----- -func @partial_layout(%arg0: f32) { +func.func @partial_layout(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1693,7 +1693,7 @@ func @partial_layout(%arg0: f32) { // ----- -func @buffer_name_already_used(%arg0: memref, %arg1: memref) { +func.func @buffer_name_already_used(%arg0: memref, %arg1: memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), memref> %1 = sair.from_scalar %arg1 : !sair.value<(), memref> @@ -1709,7 +1709,7 @@ func @buffer_name_already_used(%arg0: memref, %arg1: memref) { // ----- -func @buffer_used_before_def(%arg0: f32, %arg1: memref) { +func.func @buffer_used_before_def(%arg0: f32, %arg1: memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{buffer "bufferA" used before it is defined}} @@ -1738,7 +1738,7 @@ func @buffer_used_before_def(%arg0: f32, %arg1: memref) { // ----- -func @buffer_used_before_def_seq(%arg0: f32, %arg1: memref) { +func.func @buffer_used_before_def_seq(%arg0: f32, %arg1: memref) { sair.program { %2 = sair.from_scalar %arg1 : !sair.value<(), memref> // expected-note @+1 {{buffer defined here}} @@ -1768,7 +1768,7 @@ func @buffer_used_before_def_seq(%arg0: f32, %arg1: memref) { // ----- -func @to_memref_buffer_name(%arg0: f32, %arg1: memref) { +func.func @to_memref_buffer_name(%arg0: f32, %arg1: memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.from_scalar %arg1 : !sair.value<(), memref> @@ -1792,7 +1792,7 @@ func @to_memref_buffer_name(%arg0: f32, %arg1: memref) { // ----- -func @to_memref_layout(%arg0: f32, %arg1: memref) { +func.func @to_memref_layout(%arg0: f32, %arg1: memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.from_scalar %arg1 : !sair.value<(), memref> @@ -1820,7 +1820,7 @@ func @to_memref_layout(%arg0: f32, %arg1: memref) { // ----- -func @two_results_same_buffer() { +func.func @two_results_same_buffer() { sair.program { // expected-error @+1 {{operation cannot store two results in the same buffer}} %0, %1 = sair.map attributes { @@ -1843,7 +1843,7 @@ func @two_results_same_buffer() { // ----- -func @storage_must_cover_dimensions(%arg0: f32) { +func.func @storage_must_cover_dimensions(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1867,7 +1867,7 @@ func @storage_must_cover_dimensions(%arg0: f32) { // ----- -func @inplace_update_different_layout(%arg0: f32) { +func.func @inplace_update_different_layout(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1903,7 +1903,7 @@ func @inplace_update_different_layout(%arg0: f32) { // ----- -func @unknown_operand_mapping(%arg0: f32) { +func.func @unknown_operand_mapping(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -1917,7 +1917,7 @@ func @unknown_operand_mapping(%arg0: f32) { // ----- -func @unknown_loop_nest(%arg0: f32) { +func.func @unknown_loop_nest(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{loop iterators cannot contain `?` expressions}} @@ -1933,7 +1933,7 @@ func @unknown_loop_nest(%arg0: f32) { // ----- -func @unknown_layout(%arg0: f32) { +func.func @unknown_layout(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{layouts cannot contain `?` expressions}} @@ -1951,7 +1951,7 @@ func @unknown_layout(%arg0: f32) { // ----- -func @from_memref_overwrite(%arg0 : memref) { +func.func @from_memref_overwrite(%arg0 : memref) { // expected-note @+1 {{value stored before entering sair program}} sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), memref> @@ -1978,7 +1978,7 @@ func @from_memref_overwrite(%arg0 : memref) { // ----- -func @to_memref_overwrite(%arg0: memref, %arg1: f32) { +func.func @to_memref_overwrite(%arg0: memref, %arg1: f32) { // expected-note @+1 {{value used after exiting sair program}} sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), memref> @@ -2000,7 +2000,7 @@ func @to_memref_overwrite(%arg0: memref, %arg1: f32) { // ----- -func @fby_init_overwrite(%arg0 : f32) { +func.func @fby_init_overwrite(%arg0 : f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %r = sair.static_range : !sair.static_range<8> @@ -2026,7 +2026,7 @@ func @fby_init_overwrite(%arg0 : f32) { // ----- -func @fby_value_overwrite(%arg0 : f32) { +func.func @fby_value_overwrite(%arg0 : f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %r = sair.static_range : !sair.static_range<8> @@ -2055,7 +2055,7 @@ func @fby_value_overwrite(%arg0 : f32) { // ----- -func @sequence_inversion_two_compute() { +func.func @sequence_inversion_two_compute() { sair.program { // expected-error @below {{operation sequencing contradicts use-def chains}} // expected-note @below {{sequenceable operation}} @@ -2075,7 +2075,7 @@ func @sequence_inversion_two_compute() { // By default, MLIR treats attributes as unsigned but prints them as signed... // Make sure we use signed everywhere to avoid confusion. -func @sequence_inversion_negative_value() { +func.func @sequence_inversion_negative_value() { sair.program { // expected-error @below {{operation sequencing contradicts use-def chains}} // expected-note @below {{sequenceable operation}} @@ -2093,7 +2093,7 @@ func @sequence_inversion_negative_value() { // ----- -func @sequence_inversion_proj_any(%arg0: f32) { +func.func @sequence_inversion_proj_any(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -2115,7 +2115,7 @@ func @sequence_inversion_proj_any(%arg0: f32) { // ----- -func @sequence_inversion_proj_last(%arg0: f32) { +func.func @sequence_inversion_proj_last(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -2137,7 +2137,7 @@ func @sequence_inversion_proj_last(%arg0: f32) { // ----- -func @sequence_inversion_fby(%arg0: f32) { +func.func @sequence_inversion_fby(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -2162,7 +2162,7 @@ func @sequence_inversion_fby(%arg0: f32) { // ----- -func @sequence_inversion_fby_then(%arg0: f32) { +func.func @sequence_inversion_fby_then(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -2192,7 +2192,7 @@ func @sequence_inversion_fby_then(%arg0: f32) { // If the "then" operand of fby comes from a different operation that the user // of fby, it should be sequenced before. -func @sequence_same_fby_then_different_source(%arg0: f32) { +func.func @sequence_same_fby_then_different_source(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -2220,7 +2220,7 @@ func @sequence_same_fby_then_different_source(%arg0: f32) { // ----- -func @sequence_inversion_from_memref(%arg0: f32) { +func.func @sequence_inversion_from_memref(%arg0: f32) { sair.program { // expected-error @below {{operation sequencing contradicts use-def chains}} // expected-note @below {{sequenceable operation}} @@ -2240,7 +2240,7 @@ func @sequence_inversion_from_memref(%arg0: f32) { // ----- -func @sequence_inversion_domain(%arg0: index) { +func.func @sequence_inversion_domain(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.dyn_range %0 : !sair.dyn_range @@ -2264,7 +2264,7 @@ func @sequence_inversion_domain(%arg0: index) { // ----- -func @sequence_inversion_implicit_sequence_domain(%arg0: index) { +func.func @sequence_inversion_implicit_sequence_domain(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.dyn_range %0 : !sair.dyn_range @@ -2297,7 +2297,7 @@ func @sequence_inversion_implicit_sequence_domain(%arg0: index) { // Shouldn't fail on placeholders even though the check will go through // dyn_range. -func @sequence_inversion_placeholder(%arg0: index) { +func.func @sequence_inversion_placeholder(%arg0: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), index> %1 = sair.dyn_range %0 : !sair.dyn_range @@ -2320,7 +2320,7 @@ func @sequence_inversion_placeholder(%arg0: index) { // ----- -func @invalid_mapping_shape_in_shape() { +func.func @invalid_mapping_shape_in_shape() { "foo"() { // expected-error @+1 {{in operation shape: operand 1 of unstripe in #sair.mapping_expr has an invalid shape}} bar = #sair.shape @@ -2329,7 +2329,7 @@ func @invalid_mapping_shape_in_shape() { // ----- -func @invalid_mapping_shape_in_operand(%arg0: f32, %arg1: index) { +func.func @invalid_mapping_shape_in_operand(%arg0: f32, %arg1: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.from_scalar %arg1 : !sair.value<(), index> @@ -2349,7 +2349,7 @@ func @invalid_mapping_shape_in_operand(%arg0: f32, %arg1: index) { // ----- -func @invalid_mapping_shape_in_operand_raw(%arg0: f32, %arg1: index) { +func.func @invalid_mapping_shape_in_operand_raw(%arg0: f32, %arg1: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.from_scalar %arg1 : !sair.value<(), index> @@ -2373,7 +2373,7 @@ func @invalid_mapping_shape_in_operand_raw(%arg0: f32, %arg1: index) { // ----- -func @invalid_operand_shape(%arg0: f32) { +func.func @invalid_operand_shape(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -2389,7 +2389,7 @@ func @invalid_operand_shape(%arg0: f32) { // ----- -func @use_def_partial_invalid(%arg0: f32) { +func.func @use_def_partial_invalid(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.copy %0 { @@ -2415,7 +2415,7 @@ func @use_def_partial_invalid(%arg0: f32) { // ----- -func @storage_invalid_shape(%arg0: f32) { +func.func @storage_invalid_shape(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<8> @@ -2438,11 +2438,11 @@ func @storage_invalid_shape(%arg0: f32) { // ----- // expected-error @+1 {{expected positive step and size}} -func @static_range_type() -> !sair.static_range<0> +func.func @static_range_type() -> !sair.static_range<0> // ----- -func @sequence_attr(%arg0: f32) { +func.func @sequence_attr(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<16> @@ -2483,7 +2483,7 @@ func @sequence_attr(%arg0: f32) { // ----- -func @mismatching_unroll() { +func.func @mismatching_unroll() { sair.program { %0 = sair.static_range : !sair.static_range<3> // expected-note@below {{previous occurrence here}} @@ -2516,7 +2516,7 @@ func @mismatching_unroll() { // ----- -func @mismatching_unroll_missing() { +func.func @mismatching_unroll_missing() { sair.program { %0 = sair.static_range : !sair.static_range<3> // expected-note@below {{previous occurrence here}} @@ -2549,7 +2549,7 @@ func @mismatching_unroll_missing() { // ----- -func @invalid_expansion_pattern_name(%arg0: f32) { +func.func @invalid_expansion_pattern_name(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{invalid expansion pattern name "invalid_name"}} @@ -2563,7 +2563,7 @@ func @invalid_expansion_pattern_name(%arg0: f32) { // ----- -func @invalid_expansion_pattern(%arg0: f32) { +func.func @invalid_expansion_pattern(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{expansion pattern does not apply to the operation}} @@ -2577,7 +2577,7 @@ func @invalid_expansion_pattern(%arg0: f32) { // ----- -func @copies_arity(%arg0: f32) { +func.func @copies_arity(%arg0: f32) { sair.program { // expected-error @+1 {{the `copies` attribute must have one entry per operation result}} %0 = sair.from_scalar %arg0 { @@ -2590,7 +2590,7 @@ func @copies_arity(%arg0: f32) { // ----- -func @copies_invalid_loop_nest(%arg0: f32) { +func.func @copies_invalid_loop_nest(%arg0: f32) { sair.program { // expected-error @+1 {{dimension 'd0' is out of range of the domain}} %0 = sair.from_scalar %arg0 { @@ -2605,7 +2605,7 @@ func @copies_invalid_loop_nest(%arg0: f32) { // ----- -func @copies_invalid_expansion(%arg0: f32) { +func.func @copies_invalid_expansion(%arg0: f32) { sair.program { // expected-error @+1 {{in copy 0 of result 0: expansion pattern does not apply to the operation}} %0 = sair.from_scalar %arg0 { @@ -2618,7 +2618,7 @@ func @copies_invalid_expansion(%arg0: f32) { // ----- -func @non_existent_self_instance(%arg0: f32) { +func.func @non_existent_self_instance(%arg0: f32) { sair.program { // expected-error @below {{'copy_of' refers to non-existent instance}} %0 = sair.from_scalar %arg0 { @@ -2632,7 +2632,7 @@ func @non_existent_self_instance(%arg0: f32) { // ----- -func @non_existent_self_copy(%arg0: f32) { +func.func @non_existent_self_copy(%arg0: f32) { sair.program { // expected-error @below {{'copy_of' refers to non-existent copy}} %0 = sair.from_scalar %arg0 { @@ -2645,7 +2645,7 @@ func @non_existent_self_copy(%arg0: f32) { // ----- -func @copy_of_in_instance(%arg0: f32) { +func.func @copy_of_in_instance(%arg0: f32) { sair.program { // expected-error @below {{cannot specify 'copy_of' in 'instances'}} %0 = sair.from_scalar %arg0 { @@ -2658,7 +2658,7 @@ func @copy_of_in_instance(%arg0: f32) { // ----- -func @producer_cannot_have_copies(%arg0: f32) { +func.func @producer_cannot_have_copies(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<4> // expected-error @below {{'operands' attribute expects as many entries as op has operands (1, got 0) in instance #0}} @@ -2672,7 +2672,7 @@ func @producer_cannot_have_copies(%arg0: f32) { // ----- -func @producer_cannot_have_copies(%arg0: f32) { +func.func @producer_cannot_have_copies(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<4> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -2689,7 +2689,7 @@ func @producer_cannot_have_copies(%arg0: f32) { // ----- -func @producer_cannot_have_copies(%arg0: f32) { +func.func @producer_cannot_have_copies(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<4> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -2705,7 +2705,7 @@ func @producer_cannot_have_copies(%arg0: f32) { // ----- -func @non_existent_copy(%arg0: f32) { +func.func @non_existent_copy(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<4> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -2724,7 +2724,7 @@ func @non_existent_copy(%arg0: f32) { // ----- -func @non_existent_instance(%arg0: f32) { +func.func @non_existent_instance(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<4> %1 = sair.from_scalar %arg0 { @@ -2741,7 +2741,7 @@ func @non_existent_instance(%arg0: f32) { // ----- -func @producer_cannot_have_copies(%arg0: f32) { +func.func @producer_cannot_have_copies(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<4> // expected-error@below {{can specify only 'operands' decisions on non-compute Sair ops}} @@ -2755,7 +2755,7 @@ func @producer_cannot_have_copies(%arg0: f32) { // ----- -func @sair_exit_multi_instance() { +func.func @sair_exit_multi_instance() { sair.program { // expected-error@below {{op has at most one instance}} sair.exit {instances = [{}, {}]} @@ -2765,7 +2765,7 @@ func @sair_exit_multi_instance() { // ----- -func @sair_exit_no_instance() { +func.func @sair_exit_no_instance() { sair.program { // expected-error@below {{op must have an instance}} sair.exit {instances = []} @@ -2776,7 +2776,7 @@ func @sair_exit_no_instance() { // ----- // Make sure we don't segfault on malformed instances. -func @malformed_instances(%arg0: f32) { +func.func @malformed_instances(%arg0: f32) { sair.program { // expected-error@below {{failed to satisfy constraint: array of Sair decisions}} %0 = sair.from_scalar %arg0 { diff --git a/test/lower_map_reduce.mlir b/test/lower_map_reduce.mlir index a4304e26..baaa4286 100644 --- a/test/lower_map_reduce.mlir +++ b/test/lower_map_reduce.mlir @@ -2,7 +2,7 @@ // RUN: sair-opt %s -sair-lower-map-reduce --mlir-print-op-generic | FileCheck %s --check-prefix=GENERIC // CHECK-LABEL: @map_reduce -func @map_reduce(%r1: index, %r2: index, %in1: f32) { +func.func @map_reduce(%r1: index, %r2: index, %in1: f32) { sair.program { %0 = sair.from_scalar %r1 : !sair.value<(), index> %1 = sair.from_scalar %r2 : !sair.value<(), index> @@ -44,7 +44,7 @@ func @map_reduce(%r1: index, %r2: index, %in1: f32) { } // CHECK-LABEL: @map_reduce_multi_instance -func @map_reduce_multi_instance(%r1: index, %r2: index, %in1: f32) { +func.func @map_reduce_multi_instance(%r1: index, %r2: index, %in1: f32) { sair.program { %0 = sair.from_scalar %r1 : !sair.value<(), index> %1 = sair.from_scalar %r2 : !sair.value<(), index> diff --git a/test/lower_proj_any.mlir b/test/lower_proj_any.mlir index 499238d9..a5c5a568 100644 --- a/test/lower_proj_any.mlir +++ b/test/lower_proj_any.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt %s -sair-lower-proj-any | FileCheck %s // CHECK-LABEL: @eliminate -func @eliminate(%arg0: f32) { +func.func @eliminate(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -27,7 +27,7 @@ func @eliminate(%arg0: f32) { } // CHECK-LABEL: @convert_to_proj_last -func @convert_to_proj_last(%arg0: f32) { +func.func @convert_to_proj_last(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> diff --git a/test/lower_proj_any_invalid.mlir b/test/lower_proj_any_invalid.mlir index 83c4a0e6..14e679b3 100644 --- a/test/lower_proj_any_invalid.mlir +++ b/test/lower_proj_any_invalid.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt -sair-lower-proj-any -split-input-file -verify-diagnostics %s -func @source_not_normalized(%arg0: f32) { +func.func @source_not_normalized(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -25,7 +25,7 @@ func @source_not_normalized(%arg0: f32) { // ----- -func @result_not_normalized(%arg0: f32) { +func.func @result_not_normalized(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -50,7 +50,7 @@ func @result_not_normalized(%arg0: f32) { // ----- -func @cannot_lower(%arg0: f32) { +func.func @cannot_lower(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -75,7 +75,7 @@ func @cannot_lower(%arg0: f32) { // ----- -func @copies(%arg0: f32) { +func.func @copies(%arg0: f32) { sair.program { // expected-error @+1 {{copies must be materialized before lowering proj_any operations}} %0 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -89,7 +89,7 @@ func @copies(%arg0: f32) { // ----- -func @instances(%arg0: f32) { +func.func @instances(%arg0: f32) { sair.program { // expected-error @below {{instances must be materialized before lowering proj_any operations}} %0 = sair.from_scalar %arg0 : !sair.value<(), f32> diff --git a/test/lower_to_llvm.mlir b/test/lower_to_llvm.mlir index e762438f..656d1a71 100644 --- a/test/lower_to_llvm.mlir +++ b/test/lower_to_llvm.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt --sair-lower-to-llvm %s | FileCheck %s // CHECK-LABEL: @undef -func @undef() { +func.func @undef() { // = llvm.mlir.undef : f32 %0 = sair.undef : f32 return diff --git a/test/lower_to_map.mlir b/test/lower_to_map.mlir index 506c6bb6..723074ec 100644 --- a/test/lower_to_map.mlir +++ b/test/lower_to_map.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt %s -sair-lower-to-map --mlir-print-local-scope | FileCheck %s // CHECK-LABEL: @copy -func @copy(%arg0 : memref) { +func.func @copy(%arg0 : memref) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -25,7 +25,7 @@ func @copy(%arg0 : memref) { } // CHECK-LABEL: @alloc -func @alloc(%arg0: index) { +func.func @alloc(%arg0: index) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -56,7 +56,7 @@ func @alloc(%arg0: index) { } // CHECK-LABEL: @sair_free -func @sair_free(%arg0: index) { +func.func @sair_free(%arg0: index) { sair.program { %idx = sair.from_scalar %arg0 : !sair.value<(), index> // CHECK: %[[D0:.*]] = sair.dyn_range @@ -89,7 +89,7 @@ func @sair_free(%arg0: index) { } // CHECK-LABEL: @load_from_memref -func @load_from_memref(%arg0 : memref) { +func.func @load_from_memref(%arg0 : memref) { sair.program { %0 = sair.static_range : !sair.static_range<8, 2> %1, %2 = sair.map[d0:%0] attributes { @@ -120,7 +120,7 @@ func @load_from_memref(%arg0 : memref) { } // CHECK-LABEL: @store_to_memref -func @store_to_memref(%arg0 : f32, %arg1 : memref) { +func.func @store_to_memref(%arg0 : f32, %arg1 : memref) { sair.program { %0 = sair.static_range : !sair.static_range<8> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> diff --git a/test/lower_to_map_invalid.mlir b/test/lower_to_map_invalid.mlir index ef19e775..bc5308f0 100644 --- a/test/lower_to_map_invalid.mlir +++ b/test/lower_to_map_invalid.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt -split-input-file -sair-lower-to-map -verify-diagnostics %s -func @no_expansion_pattern(%arg0: f32) { +func.func @no_expansion_pattern(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{no target expansion pattern specified}} @@ -14,7 +14,7 @@ func @no_expansion_pattern(%arg0: f32) { // ----- -func @copies(%arg0: f32) { +func.func @copies(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // expected-error @+1 {{operations must have exactly one instance during expansion}} diff --git a/test/lowering_annotation_roundtrip.mlir b/test/lowering_annotation_roundtrip.mlir index 24911cf5..473efb82 100644 --- a/test/lowering_annotation_roundtrip.mlir +++ b/test/lowering_annotation_roundtrip.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt %s | sair-opt | FileCheck %s // CHECK-LABEL: @memory_space -func @memory_space() { +func.func @memory_space() { %c1 = arith.constant 1.0 : f32 sair.program { // CHECK: sair.map attributes {memory_space = [0, unit]} diff --git a/test/materialize_buffers.mlir b/test/materialize_buffers.mlir index 7e21b011..1a18fde4 100644 --- a/test/materialize_buffers.mlir +++ b/test/materialize_buffers.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt %s -sair-materialize-buffers -mlir-print-local-scope | FileCheck %s // CHECK-LABEL: @from_to_memref -func @from_to_memref(%arg0: memref, %arg1: memref) { +func.func @from_to_memref(%arg0: memref, %arg1: memref) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n { instances = [{}] } : !sair.value<(), index> @@ -38,7 +38,7 @@ func @from_to_memref(%arg0: memref, %arg1: memref) { } // CHECK-LABEL: @static_shape -func @static_shape(%arg0: f32) { +func.func @static_shape(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> %1 = sair.static_range { instances = [{}] } : !sair.static_range<16, 2> @@ -82,7 +82,7 @@ func @static_shape(%arg0: f32) { } // CHECK-LABEL: @dynamic_shape -func @dynamic_shape(%arg0: f32, %arg1: index, %arg2: index) { +func.func @dynamic_shape(%arg0: f32, %arg1: index, %arg2: index) { sair.program { // CHECK: %[[V3:.*]] = sair.map %[[V1:.*]], %[[V2:.*]] attributes { // CHECK: loop_nest = [] @@ -118,7 +118,7 @@ func @dynamic_shape(%arg0: f32, %arg1: index, %arg2: index) { } // CHECK-LABEL: @loop_nest -func @loop_nest(%arg0: f32) { +func.func @loop_nest(%arg0: f32) { sair.program { // CHECK: %[[D0:.*]] = sair.placeholder {instances = [{operands = []}]} : !sair.static_range<16, 4> @@ -211,7 +211,7 @@ func @loop_nest(%arg0: f32) { } // CHECK-LABEL: @sequence_attr -func @sequence_attr(%arg0: f32) { +func.func @sequence_attr(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> %1 = sair.static_range { instances = [{}] } : !sair.static_range<16> diff --git a/test/materialize_buffers_invalid.mlir b/test/materialize_buffers_invalid.mlir index 333ace7b..eaccc1cd 100644 --- a/test/materialize_buffers_invalid.mlir +++ b/test/materialize_buffers_invalid.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt -split-input-file -verify-diagnostics -sair-materialize-buffers %s -func @partial_layout(%arg0: f32) { +func.func @partial_layout(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> %1 = sair.static_range { instances = [{}] } : !sair.static_range<8> @@ -26,7 +26,7 @@ func @partial_layout(%arg0: f32) { // ----- -func @missing_memory_space(%arg0: f32) { +func.func @missing_memory_space(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> // expected-error @+1 {{missing memory space}} @@ -40,7 +40,7 @@ func @missing_memory_space(%arg0: f32) { // ----- -func @missing_layout(%arg0: f32) { +func.func @missing_layout(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> // expected-error @+1 {{missing layout}} @@ -57,7 +57,7 @@ func @missing_layout(%arg0: f32) { // ----- -func @copies(%arg0: f32) { +func.func @copies(%arg0: f32) { sair.program { // expected-error @+1 {{operations must have exactly one instance when materializing buffers}} sair.from_scalar %arg0 { diff --git a/test/materialize_instances.mlir b/test/materialize_instances.mlir index 0bbb4962..cd4e0cf5 100644 --- a/test/materialize_instances.mlir +++ b/test/materialize_instances.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt -sair-materialize-instances %s | FileCheck %s // CHECK-LABEL: @instances -func @instances(%arg0: f32) { +func.func @instances(%arg0: f32) { sair.program { // CHECK: %[[SCALAR0:.*]] = sair.from_scalar // CHECK: %[[SCALAR1:.*]] = sair.from_scalar @@ -19,7 +19,7 @@ func @instances(%arg0: f32) { } // CHECK-LABEL: @instances_and_copies -func @instances_and_copies(%arg0: f32) { +func.func @instances_and_copies(%arg0: f32) { sair.program { // CHECK: %[[SCALAR0:.*]] = sair.from_scalar // CHECK: %[[SCALAR1:.*]] = sair.from_scalar @@ -51,7 +51,7 @@ func @instances_and_copies(%arg0: f32) { } // CHECK-LABEL: @map_multi_result -func @map_multi_result(%arg0: f32) { +func.func @map_multi_result(%arg0: f32) { sair.program { // CHECK: %[[SCALAR:.*]] = sair.from_scalar %0 = sair.from_scalar %arg0 { @@ -128,7 +128,7 @@ func @map_multi_result(%arg0: f32) { } // CHECK-LABEL: @erase_zero_instance -func @erase_zero_instance(%arg0: f32) { +func.func @erase_zero_instance(%arg0: f32) { sair.program { // CHECK-NOT: sair.from_scalar sair.from_scalar %arg0 { instances = [] } : !sair.value<(), f32> diff --git a/test/materialize_instances_invalid.mlir b/test/materialize_instances_invalid.mlir index 2a8897f0..8068865f 100644 --- a/test/materialize_instances_invalid.mlir +++ b/test/materialize_instances_invalid.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt -sair-materialize-instances -split-input-file -verify-diagnostics -func @no_instances(%arg0: f32) { +func.func @no_instances(%arg0: f32) { sair.program { // expected-error@below {{expected ops to have instances}} sair.exit @@ -10,7 +10,7 @@ func @no_instances(%arg0: f32) { // ----- -func @user_of_zero_instance(%arg0: f32) { +func.func @user_of_zero_instance(%arg0: f32) { sair.program { // expected-error@below {{operation has zero instances but its results are in use}} %0 = sair.from_scalar %arg0 { instances = [] } : !sair.value<(), f32> @@ -23,7 +23,7 @@ func @user_of_zero_instance(%arg0: f32) { // ----- -func @no_operands(%arg0: f32) { +func.func @no_operands(%arg0: f32) { sair.program { // expected-error@below {{expected 'operands' field of 'instances' to be specified}} %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> @@ -34,7 +34,7 @@ func @no_operands(%arg0: f32) { // ----- -func @no_operands_copies(%arg0: f32) { +func.func @no_operands_copies(%arg0: f32) { sair.program { // expected-error@below {{expected the source of copy to be specified}} %0 = sair.from_scalar %arg0 { @@ -49,7 +49,7 @@ func @no_operands_copies(%arg0: f32) { // ----- -func @unit_operand(%arg0: f32) { +func.func @unit_operand(%arg0: f32) { sair.program { // expected-error@below {{expceted concerete instance or copy as operand #0}} %0 = sair.from_scalar %arg0 { @@ -62,7 +62,7 @@ func @unit_operand(%arg0: f32) { // ----- -func @unit_copy(%arg0: f32) { +func.func @unit_copy(%arg0: f32) { sair.program { // expected-error@below {{expected the source of copy to be specified}} %0 = sair.from_scalar %arg0 { diff --git a/test/normalize_loops.mlir b/test/normalize_loops.mlir index 307d7e6e..85cb6e74 100644 --- a/test/normalize_loops.mlir +++ b/test/normalize_loops.mlir @@ -3,7 +3,7 @@ // CHECK-LABEL: @identity -func @identity(%arg0: index, %arg1: f32) { +func.func @identity(%arg0: index, %arg1: f32) { sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar %{{.*}} : !sair.value<(), index> %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), index> @@ -38,7 +38,7 @@ func @identity(%arg0: index, %arg1: f32) { } // CHECK-LABEL: @stripe -func @stripe() { +func.func @stripe() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<62> // CHECK: %[[D0:.*]] = sair.static_range {instances = [{operands = []}]} : !sair.static_range<62, 4> @@ -84,7 +84,7 @@ func @stripe() { } // CHECK-LABEL: @unstripe -func @unstripe(%arg0: f32) { +func.func @unstripe(%arg0: f32) { %c4 = arith.constant 4 : index sair.program { %sc4 = sair.from_scalar %c4 { instances = [{}] } : !sair.value<(), index> @@ -114,7 +114,7 @@ func @unstripe(%arg0: f32) { } // CHECK-LABEL: @load_store_memref -func @load_store_memref(%arg0: index) { +func.func @load_store_memref(%arg0: index) { sair.program { // CHECK: %[[SIZE:.*]] = sair.from_scalar %size = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), index> @@ -188,7 +188,7 @@ func @load_store_memref(%arg0: index) { // GENERIC-LABEL: sym_name = "load_store_memref" // CHECK-LABEL: @remat -func @remat(%arg0: f32) { +func.func @remat(%arg0: f32) { sair.program { // CHECK: %[[INIT:.*]] = sair.from_scalar // GENERIC: %[[INIT:.*]] = "sair.from_scalar" @@ -230,10 +230,10 @@ func @remat(%arg0: f32) { // GENERIC-LABEL: sym_name = "remat" -func private @foo(index, f32) +func.func private @foo(index, f32) // CHECK-LABEL: @sequence_attr -func @sequence_attr(%arg0: f32) { +func.func @sequence_attr(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> // CHECK: %[[STATIC:.*]] = sair.static_range {instances = [{operands = []}]} : !sair.static_range<16, 4> @@ -302,7 +302,7 @@ func @sequence_attr(%arg0: f32) { } // CHECK-LABEL: @unroll_preserved -func @unroll_preserved(%arg0: index, %arg1: f32) { +func.func @unroll_preserved(%arg0: index, %arg1: f32) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), index> %1 = sair.from_scalar %arg1 { instances = [{}] } : !sair.value<(), f32> @@ -331,7 +331,7 @@ func @unroll_preserved(%arg0: index, %arg1: f32) { } // CHECK-LABEL: @unroll_propagated -func @unroll_propagated() { +func.func @unroll_propagated() { sair.program { %0 = sair.static_range { instances = [{}] } : !sair.static_range<62> // CHECK: %[[D0:.*]] = sair.static_range {instances = [{operands = []}]} : !sair.static_range<62, 4> diff --git a/test/normalize_loops_invalid.mlir b/test/normalize_loops_invalid.mlir index fba18275..5a26b897 100644 --- a/test/normalize_loops_invalid.mlir +++ b/test/normalize_loops_invalid.mlir @@ -1,7 +1,7 @@ // RUN: sair-opt -split-input-file -sair-normalize-loops -verify-diagnostics %s // CHECK-LABEL: @from_memref -func @from_memref(%arg0: index) { +func.func @from_memref(%arg0: index) { sair.program { %size = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), index> %0 = sair.static_range { instances = [{}] } : !sair.static_range<4> @@ -21,7 +21,7 @@ func @from_memref(%arg0: index) { // ----- -func @memrefs_must_be_introduced(%arg0: f32) { +func.func @memrefs_must_be_introduced(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 { instances = [{}] } : !sair.value<(), f32> %1 = sair.static_range { instances = [{}] } : !sair.static_range<8> @@ -34,7 +34,7 @@ func @memrefs_must_be_introduced(%arg0: f32) { // ----- -func @copies(%arg0: f32) { +func.func @copies(%arg0: f32) { sair.program { // expected-error @+1 {{operations must have exactly one instance when normalizing loop nests}} sair.from_scalar %arg0 { diff --git a/test/regression/matmul.mlir b/test/regression/matmul.mlir index 346c5b10..907148ad 100644 --- a/test/regression/matmul.mlir +++ b/test/regression/matmul.mlir @@ -1,6 +1,6 @@ // RUN: sair-opt %s -convert-sair-to-loop -func @main(%arg0: memref<512x512xf32>, %arg1: memref<512x512xf32>, %arg2: memref<512x512xf32>) { +func.func @main(%arg0: memref<512x512xf32>, %arg1: memref<512x512xf32>, %arg2: memref<512x512xf32>) { %c0 = arith.constant 0 : index %cst = arith.constant 0.000000e+00 : f32 diff --git a/test/roundtrip.mlir b/test/roundtrip.mlir index 7baad3ee..4f02a6a7 100644 --- a/test/roundtrip.mlir +++ b/test/roundtrip.mlir @@ -1,31 +1,31 @@ // RUN: sair-opt -allow-unregistered-dialect %s | sair-opt -allow-unregistered-dialect | FileCheck %s // CHECK: -> !sair.dyn_range -func private @dyn_range_type() -> !sair.dyn_range +func.func private @dyn_range_type() -> !sair.dyn_range // Make sure empty type-dependence list is dropped. // CHECK: -> !sair.dyn_range // CHECK-NOT: <()> -func private @independent_range_type() -> !sair.dyn_range<()> +func.func private @independent_range_type() -> !sair.dyn_range<()> // CHECK: -> !sair.dyn_range -func private @dependent_range_type_1() -> !sair.dyn_range +func.func private @dependent_range_type_1() -> !sair.dyn_range // CHECK: -> !sair.value<(), f32> -func private @value_type_empty_domain() -> !sair.value<(), f32> +func.func private @value_type_empty_domain() -> !sair.value<(), f32> // CHECK: -> !sair.value -func private @value_type() -> !sair.value +func.func private @value_type() -> !sair.value // CHECK: -> !sair.dyn_range -func private @dependent_dimensions() -> !sair.dyn_range +func.func private @dependent_dimensions() -> !sair.dyn_range // CHECK: -> !sair.dyn_range -func private @dependent_dimensions_2() +func.func private @dependent_dimensions_2() -> !sair.dyn_range // CHECK-LABEL: @sair_program -func @sair_program() { +func.func @sair_program() { // CHECK: sair.program sair.program { // CHECK: sair.exit @@ -35,7 +35,7 @@ func @sair_program() { } // CHECK-LABEL: @sair_program_return_values -func @sair_program_return_values() { +func.func @sair_program_return_values() { %c0 = arith.constant 1.0 : f32 %c1 = arith.constant 1 : i32 // CHECK: %{{.*}}:2 = sair.program @@ -52,7 +52,7 @@ func @sair_program_return_values() { } // CHECK-LABEL: @dyn_range_op -func @dyn_range_op() { +func.func @dyn_range_op() { %c0 = arith.constant 0 : index sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar @@ -65,7 +65,7 @@ func @dyn_range_op() { } // CHECK-LABEL: @dyn_range_with_step -func @dyn_range_with_step(%arg0: index, %arg1: index) { +func.func @dyn_range_with_step(%arg0: index, %arg1: index) { sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar %0 = sair.from_scalar %arg0 : !sair.value<(), index> @@ -79,7 +79,7 @@ func @dyn_range_with_step(%arg0: index, %arg1: index) { } // CHECK-LABEL: @static_range_op -func @static_range_op() { +func.func @static_range_op() { sair.program { // CHECK: %{{.*}} = sair.static_range : !sair.static_range<42> %0 = sair.static_range : !sair.static_range<42> @@ -89,7 +89,7 @@ func @static_range_op() { } // CHECK-LABEL: @static_range_with_step -func @static_range_with_step() { +func.func @static_range_with_step() { sair.program { // CHECK: %{{.*}} = sair.static_range : !sair.static_range<42, 2> %0 = sair.static_range : !sair.static_range<42, 2> @@ -99,7 +99,7 @@ func @static_range_with_step() { } // CHECK-LABEL: @dependent_range_op -func @dependent_range_op(%arg0 : index) { +func.func @dependent_range_op(%arg0 : index) { sair.program { // CHECK: %[[V0:.*]] = sair.from_scalar %0 = sair.from_scalar %arg0 : !sair.value<(), index> @@ -125,7 +125,7 @@ func @dependent_range_op(%arg0 : index) { } // CHECK-LABEL: @generic_mapping -func @generic_mapping() { +func.func @generic_mapping() { // CHECK: "foo"() {mapping = #sair.mapping<3 : d0, d2, d1, none>} "foo"() {mapping = #sair.mapping<3 : d0, d2, d1, none>} : () -> () // CHECK: "bar"() {mapping = #sair.mapping<4 : d0, d1, d2>} @@ -133,19 +133,19 @@ func @generic_mapping() { } // CHECK-LABEL: @generic_mapping_empty -func @generic_mapping_empty() { +func.func @generic_mapping_empty() { // CHECK: "foo"() {mapping = #sair.mapping<0>} "foo"() {mapping = #sair.mapping<0>} : () -> () } // CHECK-LABEL: @shape_attribute -func @shape_attribute() { +func.func @shape_attribute() { // CHECK: "foo"() {shape = #sair.shape} "foo"() {shape = #sair.shape} : () -> () } // CHECK-LABEL: @copy -func @copy(%arg0 : f32) { +func.func @copy(%arg0 : f32) { sair.program { // CHECK: %[[D0:.*]] = sair.static_range %0 = sair.static_range : !sair.static_range<8> @@ -165,7 +165,7 @@ func @copy(%arg0 : f32) { } // CHECK-LABEL: @copy_attributes -func @copy_attributes(%arg0 : f32) { +func.func @copy_attributes(%arg0 : f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> // CHECK: foo = 3 @@ -176,7 +176,7 @@ func @copy_attributes(%arg0 : f32) { } // CHECK-LABEL: @from_memref -func @from_memref(%arg0 : memref) { +func.func @from_memref(%arg0 : memref) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -195,7 +195,7 @@ func @from_memref(%arg0 : memref) { } // CHECK-LABEL: @to_memref -func @to_memref(%arg0 : f32, %arg1 : memref) { +func.func @to_memref(%arg0 : f32, %arg1 : memref) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -230,7 +230,7 @@ func @to_memref(%arg0 : f32, %arg1 : memref) { } // CHECK-LABEL: @load_from_memref -func @load_from_memref(%arg0 : memref) { +func.func @load_from_memref(%arg0 : memref) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -250,7 +250,7 @@ func @load_from_memref(%arg0 : memref) { } // CHECK-LABEL: @store_to_memref -func @store_to_memref(%arg0 : f32, %arg1 : memref) { +func.func @store_to_memref(%arg0 : f32, %arg1 : memref) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -272,7 +272,7 @@ func @store_to_memref(%arg0 : f32, %arg1 : memref) { } // CHECK-LABEL: @map -func @map(%arg0 : f32, %arg1: i32) { +func.func @map(%arg0 : f32, %arg1: i32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -299,7 +299,7 @@ func @map(%arg0 : f32, %arg1: i32) { } // CHECK-LABEL: @map_noargs -func @map_noargs() { +func.func @map_noargs() { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -321,7 +321,7 @@ func @map_noargs() { } // CHECK-LABEL: @return_noargs -func @return_noargs() { +func.func @return_noargs() { sair.program { sair.map { ^bb0: @@ -334,7 +334,7 @@ func @return_noargs() { } // CHECK-LABEL: @map_reduce -func @map_reduce(%arg0 : f32, %arg1 : i32, %arg2 : f64) { +func.func @map_reduce(%arg0 : f32, %arg1 : i32, %arg2 : f64) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -368,7 +368,7 @@ func @map_reduce(%arg0 : f32, %arg1 : i32, %arg2 : f64) { } // CHECK-LABEL: @from_scalar -func @from_scalar() { +func.func @from_scalar() { // CHECK: %[[V0:.*]] = arith.constant 1 : index %0 = arith.constant 1 : index sair.program { @@ -380,7 +380,7 @@ func @from_scalar() { } // CHECK-LABEL: @loop_nest_attr -func @loop_nest_attr(%arg0: f32) { +func.func @loop_nest_attr(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -411,7 +411,7 @@ func @loop_nest_attr(%arg0: f32) { } // CHECK-LABEL: @proj_any -func @proj_any(%arg0: f32) { +func.func @proj_any(%arg0: f32) { sair.program { // CHECK: %[[D0:.*]] = sair.static_range : !sair.static_range<4> %0 = sair.static_range : !sair.static_range<4> @@ -430,7 +430,7 @@ func @proj_any(%arg0: f32) { } // CHECK-LABEL: @proj_last -func @proj_last(%arg0: f32) { +func.func @proj_last(%arg0: f32) { sair.program { // CHECK: %[[D0:.*]] = sair.static_range : !sair.static_range<4> %0 = sair.static_range : !sair.static_range<4> @@ -449,7 +449,7 @@ func @proj_last(%arg0: f32) { } // CHECK-LABEL: @proj_last_different_shape -func @proj_last_different_shape(%arg0: f32) { +func.func @proj_last_different_shape(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.static_range : !sair.static_range<4> @@ -462,7 +462,7 @@ func @proj_last_different_shape(%arg0: f32) { // CHECK-LABEL: @fby -func @fby(%arg0: f32) { +func.func @fby(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -487,7 +487,7 @@ func @fby(%arg0: f32) { } // CHECK-LABEL: @undef -func @undef() { +func.func @undef() { // CHECK: %[[UNDEF:.*]] = sair.undef : f32 %0 = sair.undef : f32 sair.program { @@ -499,7 +499,7 @@ func @undef() { } // CHECK-LABEL: @mapping_expr_attr -func @mapping_expr_attr() { +func.func @mapping_expr_attr() { // CHECK: "foo"() {mapping_expr = #sair.mapping_expr} "foo"() {mapping_expr = #sair.mapping_expr} : () -> () // CHECK: "foo"() {mapping_expr = #sair.mapping_expr} @@ -512,7 +512,7 @@ func @mapping_expr_attr() { "foo"() {mapping_expr = #sair.mapping_expr} : () -> () } -func @stripe_mined_loop() { +func.func @stripe_mined_loop() { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -533,7 +533,7 @@ func @stripe_mined_loop() { return } -func @stripe_mapping(%arg0: f32) { +func.func @stripe_mapping(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -566,7 +566,7 @@ func @stripe_mapping(%arg0: f32) { } // CHECK-LABEL: @named_mapping -func @named_mapping() { +func.func @named_mapping() { // CHECK: #sair.named_mapping<[] -> ()> "foo"() { bar = #sair.named_mapping<[] -> ()>} : () -> () // CHECK: #sair.named_mapping<[d0:"A", d1:"B"] -> (d0, d1)> @@ -574,7 +574,7 @@ func @named_mapping() { } // CHECK-LABEL: @alloc_simple -func @alloc_simple() { +func.func @alloc_simple() { sair.program { // CHECK: = sair.alloc : !sair.value<(), memref<42x42xf32>> sair.alloc : !sair.value<(), memref<42x42xf32>> @@ -584,7 +584,7 @@ func @alloc_simple() { } // CHECK-LABEL: @alloc -func @alloc(%arg0: index) { +func.func @alloc(%arg0: index) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -601,7 +601,7 @@ func @alloc(%arg0: index) { } // CHECK-LABEL: @alloc_nosize -func @alloc_nosize(%arg0: index) { +func.func @alloc_nosize(%arg0: index) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -618,7 +618,7 @@ func @alloc_nosize(%arg0: index) { } // CHECK-LABEL: @free_simple -func @free_simple() { +func.func @free_simple() { sair.program { %0 = sair.alloc : !sair.value<(), memref<42x42xf32>> // CHECK: sair.free %{{.*}} : !sair.value<(), memref<42x42xf32>> @@ -629,7 +629,7 @@ func @free_simple() { } // CHECK-LABEL: @sair_free -func @sair_free(%arg0: index) { +func.func @sair_free(%arg0: index) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -647,7 +647,7 @@ func @sair_free(%arg0: index) { } // CHECK-LABEL: @free_nosize -func @free_nosize(%arg0: index) { +func.func @free_nosize(%arg0: index) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -665,7 +665,7 @@ func @free_nosize(%arg0: index) { } // CHECK-LABEL: @storage_stripe -func @storage_stripe(%arg0: f32) { +func.func @storage_stripe(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -689,7 +689,7 @@ func @storage_stripe(%arg0: f32) { } // CHECK-LABEL: @storage_no_layout -func @storage_no_layout(%arg0: f32) { +func.func @storage_no_layout(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -707,7 +707,7 @@ func @storage_no_layout(%arg0: f32) { } // CHECK-LABEL: @placeholder -func @placeholder(%arg0: f32) { +func.func @placeholder(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -721,7 +721,7 @@ func @placeholder(%arg0: f32) { } // CHECK-LABEL: @placeholder_with_loop_nest -func @placeholder_with_loop_nest(%arg0: f32) { +func.func @placeholder_with_loop_nest(%arg0: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -744,7 +744,7 @@ func @placeholder_with_loop_nest(%arg0: f32) { } // CHECK-LABEL: @free_with_mapping -func @free_with_mapping() { +func.func @free_with_mapping() { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index> @@ -760,14 +760,14 @@ func @free_with_mapping() { } // CHECK-LABEL: @mapping_any_expr -func @mapping_any_expr() { +func.func @mapping_any_expr() { // CHECK: "foo"() {bar = #sair.mapping_expr} : () -> () "foo"() {bar = #sair.mapping_expr} : () -> () return } // CHECK-LABEL: @sequence_attr -func @sequence_attr() { +func.func @sequence_attr() { sair.program { %0 = sair.static_range : !sair.static_range<42> // CHECK: sair.alloc @@ -786,7 +786,7 @@ func @sequence_attr() { // Should not error on fby's "then" operand having the same sequence number // as the user of "fby" result in case of use-def loop. // CHECK-LABEL: @sequence_same_fby_then -func @sequence_same_fby_then(%arg0: f32) { +func.func @sequence_same_fby_then(%arg0: f32) { sair.program { %0 = sair.static_range : !sair.static_range<42> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -804,7 +804,7 @@ func @sequence_same_fby_then(%arg0: f32) { } // CHECK-LABEL: @static_range_type -func @static_range_type() { +func.func @static_range_type() { // CHECK: !sair.static_range<8> "foo"() : () -> !sair.static_range<8> // CHECK: !sair.static_range<8> @@ -820,14 +820,14 @@ func @static_range_type() { // CHECK-LABEL: @copy_attr // CHECK: #sair.copy<42> -func private @copy_attr() attributes { foo = #sair.copy<42> } +func.func private @copy_attr() attributes { foo = #sair.copy<42> } // CHECK-LABEL: @instance_attr // CHECK: #sair.instance<42> -func private @instance_attr() attributes { foo = #sair.instance<42> } +func.func private @instance_attr() attributes { foo = #sair.instance<42> } // CHECK-LABEL: @attribute_printing -func @attribute_printing(%arg0: f32, %arg1: index) { +func.func @attribute_printing(%arg0: f32, %arg1: index) { sair.program { // CHECK: sair.static_range // CHECK-SAME: attr = "content" diff --git a/test/sequence.mlir b/test/sequence.mlir index f44f0678..fbfffb0a 100644 --- a/test/sequence.mlir +++ b/test/sequence.mlir @@ -2,7 +2,7 @@ // These shouldn't fail because Sair doesn't enforce use-def order. -func @dimension_use_before_def(%arg0 : f32) { +func.func @dimension_use_before_def(%arg0 : f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.copy[d0:%2] %0 : !sair.value, f32> @@ -14,7 +14,7 @@ func @dimension_use_before_def(%arg0 : f32) { // ----- -func @operand_use_before_def(%arg0 : f32) { +func.func @operand_use_before_def(%arg0 : f32) { sair.program { %0 = sair.copy %1 : !sair.value<(), f32> %1 = sair.from_scalar %arg0 : !sair.value<(), f32> @@ -28,7 +28,7 @@ func @operand_use_before_def(%arg0 : f32) { // It shouldn't be a problem to have a dynamic range for a rematerialized // dimension to be defined after its used as long as there is no circular // dependency introduced. -func @reordered_remat(%arg0: f32) { +func.func @reordered_remat(%arg0: f32) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %2 = sair.copy %0 { @@ -48,7 +48,7 @@ func @reordered_remat(%arg0: f32) { // Given explicit sequence attributes, we should take them into account in // buffer use-after-defined verification. In particular, even if the definition // of the buffer happens textually later, it is sequenced before in this case. -func @buffer_def_explicit_seq(%arg0: f32, %arg1: memref) { +func.func @buffer_def_explicit_seq(%arg0: f32, %arg1: memref) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> %1 = sair.copy %0 { @@ -71,7 +71,7 @@ func @buffer_def_explicit_seq(%arg0: f32, %arg1: memref) { // Implicit sequencing preserves textual order so we shouldn't complain about // buffer being used before it is defined. -func @buffer_def_implicit_seq(%arg0: f32, %arg1: memref) { +func.func @buffer_def_implicit_seq(%arg0: f32, %arg1: memref) { sair.program { %2 = sair.from_scalar %arg1 : !sair.value<(), memref> %copy = sair.copy %2 : !sair.value<(), memref> @@ -94,7 +94,7 @@ func @buffer_def_implicit_seq(%arg0: f32, %arg1: memref) { // Explicit sequencing makes this code verify - buffer dimension computation // (copy) is sequenced explicitly before the buffer is being first written into // - despite the inverted order of operations in the block. -func @buffer_dimension_def_seq(%arg0: f32, %arg1: index) { +func.func @buffer_dimension_def_seq(%arg0: f32, %arg1: index) { sair.program { %0 = sair.from_scalar %arg0 : !sair.value<(), f32> diff --git a/test/storage.mlir b/test/storage.mlir index 76582693..0b6b91d4 100644 --- a/test/storage.mlir +++ b/test/storage.mlir @@ -4,7 +4,7 @@ // it in memory. It is sufficient that we don't fail here due to mismatch in // map_reduce. // CHECK-LABEL: @from_memref_in_memory -func @from_memref_in_memory(%arg0: memref, %arg1: f32) { +func.func @from_memref_in_memory(%arg0: memref, %arg1: f32) { %n = arith.constant 8 : index sair.program { %sn = sair.from_scalar %n : !sair.value<(), index>