Skip to content

[mlir][test] Fix filecheck annotation typos [2/n] #93476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mlir/test/Analysis/test-liveness.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func.func @func_simpleBranch(%arg0: i32, %arg1 : i32) -> i32 {
// CHECK-SAME: arg0@0 arg1@0 val_2
// CHECK: return
// CHECK-SAME: val_2
// CHECK-NEXT EndCurrentlyLive
// CHECK-NEXT:EndCurrentlyLive
%result = arith.addi %arg0, %arg1 : i32
return %result : i32
}
Expand Down Expand Up @@ -197,9 +197,9 @@ func.func @func_ranges(%cond : i1, %arg1 : i32, %arg2 : i32, %arg3 : i32) -> i32
// CHECK-NEXT: %2 = arith.addi
// CHECK-NEXT: %3 = arith.muli
// CHECK-NEXT: val_7
// CHECK-NEXT %2 = arith.addi
// CHECK-NEXT %3 = arith.muli
// CHECK-NEXT %4 = arith.muli
// CHECK-NEXT: %2 = arith.addi
// CHECK-NEXT: %3 = arith.muli
// CHECK-NEXT: %4 = arith.muli
// CHECK: val_8
// CHECK-NEXT: %3 = arith.muli
// CHECK-NEXT: %4 = arith.muli
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ gpu.module @test_module_30 {
}
// CHECK-LABEL: @subgroup_reduce_xor
gpu.func @subgroup_reduce_xor(%arg0 : i32) {
// CHECK nvvm.redux.sync xor {{.*}}
// CHECK: nvvm.redux.sync xor {{.*}}
%result = gpu.subgroup_reduce xor %arg0 uniform {} : (i32) -> (i32)
gpu.return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,14 @@ func.func @memref_cast_ranked_to_unranked(%arg : memref<42x2x?xf32>) {
// CHECK-DAG: %[[p:.*]] = llvm.alloca %[[c]] x !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> : (i64) -> !llvm.ptr
// CHECK-DAG: llvm.store %{{.*}}, %[[p]] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)>, !llvm.ptr
// CHECK-DAG: %[[r:.*]] = llvm.mlir.constant(3 : index) : i64
// CHECK : llvm.mlir.undef : !llvm.struct<(i64, ptr)>
// CHECK: llvm.mlir.undef : !llvm.struct<(i64, ptr)>
// CHECK-DAG: llvm.insertvalue %[[r]], %{{.*}}[0] : !llvm.struct<(i64, ptr)>
// CHECK-DAG: llvm.insertvalue %[[p]], %{{.*}}[1] : !llvm.struct<(i64, ptr)>
// CHECK32-DAG: %[[c:.*]] = llvm.mlir.constant(1 : index) : i64
// CHECK32-DAG: %[[p:.*]] = llvm.alloca %[[c]] x !llvm.struct<(ptr, ptr, i32, array<3 x i32>, array<3 x i32>)> : (i64) -> !llvm.ptr
// CHECK32-DAG: llvm.store %{{.*}}, %[[p]] : !llvm.struct<(ptr, ptr, i32, array<3 x i32>, array<3 x i32>)>, !llvm.ptr
// CHECK32-DAG: %[[r:.*]] = llvm.mlir.constant(3 : index) : i32
// CHECK32 : llvm.mlir.undef : !llvm.struct<(i32, ptr)>
// CHECK32: llvm.mlir.undef : !llvm.struct<(i32, ptr)>
// CHECK32-DAG: llvm.insertvalue %[[r]], %{{.*}}[0] : !llvm.struct<(i32, ptr)>
// CHECK32-DAG: llvm.insertvalue %[[p]], %{{.*}}[1] : !llvm.struct<(i32, ptr)>
%0 = memref.cast %arg : memref<42x2x?xf32> to memref<*xf32>
Expand Down
10 changes: 5 additions & 5 deletions mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func.func @m16n8k16_fp16(%arg0: vector<4x2xf16>, %arg1: vector<2x2xf16>, %arg2:
// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.array<2 x vector<2xf16>>
// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.array<2 x vector<2xf16>>
// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.array<2 x vector<2xf16>>
// CHECK-NOT llvm.extractvalue
// CHECK-NOT: llvm.extractvalue
// CHECK: [[d:%.+]] = nvvm.mma.sync
// CHECK-SAME: shape = #nvvm.shape<m = 16, n = 8, k = 16>
%d = nvgpu.mma.sync (%arg0, %arg1, %arg2) {mmaShape = [16, 8, 16]} : (vector<4x2xf16>, vector<2x2xf16>, vector<2x2xf16>) -> vector<2x2xf16>
Expand Down Expand Up @@ -56,7 +56,7 @@ func.func @m16n8k8_fp16(%arg0: vector<2x2xf16>, %arg1: vector<1x2xf16>, %arg2: v
// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.array<1 x vector<2xf16>>
// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.array<2 x vector<2xf16>>
// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.array<2 x vector<2xf16>>
// CHECK-NOT llvm.extractvalue
// CHECK-NOT: llvm.extractvalue
// CHECK: [[d:%.+]] = nvvm.mma.sync
// CHECK-SAME: shape = #nvvm.shape<m = 16, n = 8, k = 8>
%d = nvgpu.mma.sync (%arg0, %arg1, %arg2) {mmaShape = [16, 8, 8]} : (vector<2x2xf16>, vector<1x2xf16>, vector<2x2xf16>) -> vector<2x2xf16>
Expand Down Expand Up @@ -360,7 +360,7 @@ func.func @mma_sp_sync_f16_16832(%arg0: vector<4x2xf16>,
// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.array<2 x vector<2xf16>>
// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.array<2 x vector<2xf16>>

// CHECK-NOT llvm.extractvalue
// CHECK-NOT: llvm.extractvalue

// CHECK: %[[sparseMetadata:.+]] = llvm.bitcast %{{.+}} : vector<2xi16> to i32

Expand Down Expand Up @@ -396,7 +396,7 @@ func.func @mma_sp_sync_f16_16816(%arg0: vector<2x2xf16>,
// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.array<2 x vector<2xf16>>
// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.array<2 x vector<2xf16>>

// CHECK-NOT llvm.extractvalue
// CHECK-NOT: llvm.extractvalue

// CHECK: %[[sparseMetadata:.+]] = llvm.bitcast %{{.+}} : vector<2xi16> to i32

Expand Down Expand Up @@ -455,7 +455,7 @@ func.func @mma_sp_sync_i8_16864(%arg0: vector<4x4xi8>,
// CHECK: llvm.extractvalue %{{.*}}[{{.*}}] : !llvm.array<2 x vector<2xi32>>
// CHECK: llvm.extractvalue %{{.*}}[{{.*}}] : !llvm.array<2 x vector<2xi32>>

// CHECK-NOT llvm.extractvalue
// CHECK-NOT: llvm.extractvalue

// CHECK: %[[sparseMetadata:.+]] = llvm.bitcast %{{.+}} : vector<2xi16> to i32

Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/AMX/roundtrip.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// CHECK-LABEL: tzero
// CHECK: amx.tile_zero : vector<16x16xbf16>
// CHECK amx.tile_store %{{.*}}[%{{.*}}, %{{.*}}], %{{.*}} : memref<?x?xbf16>, vector<16x16xbf16>
// CHECK: amx.tile_store %{{.*}}[%{{.*}}, %{{.*}}], %{{.*}} : memref<?x?xbf16>, vector<16x16xbf16>
func.func @tzero(%arg0: memref<?x?xbf16>) {
%0 = arith.constant 0 : index
%1 = amx.tile_zero : vector<16x16xbf16>
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/Affine/loop-fusion-3.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ func.func @reduce_add_non_innermost(%arg0: memref<64x64xf32, 1>, %arg1: memref<1
// CHECK: affine.for
// CHECK-NEXT: affine.for
// CHECK-NEXT: affine.for
// CHECK affine.for
// CHECK: affine.for



Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/Affine/unroll.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ func.func @loop_nest_non_trivial_multiple_upper_bound_alt(%M : index, %N : index
// UNROLL-BY-4-NEXT: "foo"
// UNROLL-BY-4-NEXT: "foo"
// UNROLL-BY-4-NEXT: "foo"
// UNROLL-BY-4-NOT for
// UNROLL-BY-4-NOT: for
// UNROLL-BY-4: return
return
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/ArmSME/tile-allocation-liveness.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func.func @avoidable_spill(%a: vector<[4]xf32>, %b: vector<[4]xf32>, %c: vector<
// CHECK: arm_sme.get_tile {tile_id = 2 : i32} : vector<[4]x[4]xf32>
// CHECK: arm_sme.get_tile {tile_id = 3 : i32} : vector<[4]x[4]xf32>
// CHECK: arm_sme.move_vector_to_tile_slice {{.*}} {tile_id = 0 : i32} : vector<[4]xf32> into vector<[4]x[4]xf32>
// CHECK-NOT tile_id = 16
// CHECK-NOT: tile_id = 16
func.func @cond_branch_with_backedge(%slice: vector<[4]xf32>) {
%tileA = arm_sme.get_tile : vector<[4]x[4]xf32>
%tileB = arm_sme.get_tile : vector<[4]x[4]xf32>
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ func.func @input_stays_same(%arg0 : memref<?x1x?xf32, strided<[?, 1, 1]>>, %arg1
// CHECK: func @input_stays_same(
// CHECK-SAME: %[[ARG0:.*]]: memref<?x1x?xf32, strided<[?, 1, 1]>>,
// CHECK-SAME: %[[ARG1:.*]]: f32, %[[ARG2:.*]]: memref<?x1x?x1x?xf32>)
// CHECK-SAME -> memref<?x1x?x1x?xf32> {
// CHECK-SAME: -> memref<?x1x?x1x?xf32> {
// CHECK: %[[OUT:.*]] = memref.collapse_shape %[[ARG2]] {{\[}}[0, 1], [2, 3], [4]]
// CHECK-SAME: : memref<?x1x?x1x?xf32> into memref<?x?x?xf32>
// CHECK: linalg.generic
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ func.func @scalar_generic_fusion
// CHECK-SAME: ins(%[[ARG1]] : tensor<i32>)
// CHECK: tensor.extract %[[ARG0]]
// CHECK: linalg.yield
// CHECK return %[[T0]]
// CHECK: return %[[T0]]

// -----

Expand Down
6 changes: 3 additions & 3 deletions mlir/test/Dialect/Linalg/transform-ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

transform.sequence failures(propagate) {
^bb1(%arg0: !transform.any_op):
// CHECK %{{.*}}, %{{.*}}:2 = transform.structured.tile
// CHECK: %{{.*}}, %{{.*}}:2 = transform.structured.tile
%0, %1:2 = transform.structured.tile_using_for %arg0 tile_sizes [2, 0, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}

// check that the Attributes of `tile_using_for` are preserved through printing
// and parsing with and without use of the optional `interchange` Attribute.
transform.sequence failures(propagate) {
^bb1(%arg0: !transform.any_op):
// CHECK %{{.*}}, %{{.*}}:2 = transform.structured.tile %arg0 [2, 0, 3] interchange = [2, 1] {test_attr1 = 1 : i64, test_attr2}
// CHECK: %{{.*}}, %{{.*}}:2 = transform.structured.tile_using_for %arg0 tile_sizes [2, 0, 3] interchange = [2, 1] {test_attr1 = 1 : i64, test_attr2}
%0, %1:2 = transform.structured.tile_using_for %arg0 tile_sizes [2, 0, 3] interchange = [2, 1] {test_attr1 = 1 : i64, test_attr2}: (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
// CHECK %{{.*}}, %{{.*}}:2 = transform.structured.tile %arg0 [4, 5, 3] {test_attr3 = 1 : i64, test_attr4}
// CHECK: %{{.*}}, %{{.*}}:2 = transform.structured.tile_using_for %tiled_linalg_op tile_sizes [0, 5, 3] {test_attr3 = 1 : i64, test_attr4}
%2, %3:2 = transform.structured.tile_using_for %0 tile_sizes [0, 5, 3] {test_attr3 = 1 : i64, test_attr4}: (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}

Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/OpenMP/ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func.func @omp_parallel_pretty(%data_var : memref<i32>, %if_cond : i1, %num_thre
omp.terminator
}

// CHECK omp.parallel if(%{{.*}}) num_threads(%{{.*}} : i32) private(%{{.*}} : memref<i32>) proc_bind(close)
// CHECK: omp.parallel if(%{{.*}}) num_threads(%{{.*}} : i32) proc_bind(close)
omp.parallel num_threads(%num_threads : i32) if(%if_cond: i1) proc_bind(close) {
omp.terminator
}
Expand Down
12 changes: 6 additions & 6 deletions mlir/test/Dialect/SparseTensor/sparse_reshape.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ func.func @sparse_expand(%arg0: tensor<100xf64, #SparseVector>) -> tensor<10x10x
// CHECK: %[[T:.*]] = arith.muli %[[SI0]], %[[C10]] : index
// CHECK: %[[DI:.*]] = arith.addi %[[T]], %[[SI1]] : index
// CHECK: %[[R1:.*]] = tensor.insert %[[SV]] into %[[A1]]{{\[}}%[[DI]]]
// CHECK scf.yield %[[R1]]
// CHECK }
// CHECK scf.yield %[[RET_1]]
// CHECK: scf.yield %[[R1]]
// CHECK: }
// CHECK: scf.yield %[[RET_1]]
// CHECK: }
// CHECK: %[[NT1:.*]] = sparse_tensor.load %[[RET]] hasInserts
// CHECK-NOT: sparse_tensor.convert
Expand Down Expand Up @@ -170,9 +170,9 @@ func.func @dynamic_sparse_expand(%arg0: tensor<?xf64, #SparseVector>, %sz0: inde
// CHECK: %[[T4:.*]] = arith.muli %[[SI1]], %[[T3]] : index
// CHECK: %[[DI:.*]] = arith.addi %[[T2]], %[[T4]] : index
// CHECK: %[[NT:.*]] = tensor.insert %[[SV]] into %[[R1]]{{\[}}%[[DI]]]
// CHECK scf.yield %[[NT]]
// CHECK }
// CHECK scf.yield %[[RET_1]]
// CHECK: scf.yield %[[NT]]
// CHECK: }
// CHECK: scf.yield %[[RET_1]]
// CHECK: }
// CHECK: %[[NT1:.*]] = sparse_tensor.load %[[RET]] hasInserts
// CHECK-NOT: sparse_tensor.convert
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Dialect/Tensor/canonicalize.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,8 @@ func.func @compose_expand_of_expand_of_zero_dim(%arg0 : tensor<f32>)
// CHECK-LABEL: func.func @collapse_of_cast(
// CHECK-SAME: %[[IN:.*]]: tensor<8x12x32xf32>) -> tensor<?x32xf32> {
// CHECK-NEXT: %[[COLLAPSE:.*]] = tensor.collapse_shape %[[IN]] {{\[}}[0, 1], [2]] : tensor<8x12x32xf32> into tensor<96x32xf32>
// CHECK-NEXT %[[CAST:.*]] = tensor.cast %[[COLLAPSE]] : tensor<96x32xf32> to tensor<?x32xf32>
// CHECK-NEXT return %[[CAST]] : tensor<?x32xf32>
// CHECK-NEXT: %[[CAST:.*]] = tensor.cast %[[COLLAPSE]] : tensor<96x32xf32> to tensor<?x32xf32>
// CHECK-NEXT: return %[[CAST]] : tensor<?x32xf32>
func.func @collapse_of_cast(%t: tensor<8x12x32xf32>) -> tensor<?x32xf32> {
%0 = tensor.cast %t : tensor<8x12x32xf32> to tensor<?x?x?xf32>
%1 = tensor.collapse_shape %0 [[0, 1], [2]] : tensor<?x?x?xf32> into tensor<?x?xf32>
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/Tosa/canonicalize.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ func.func @canonicalize_concat_slice_on_non_concat_axis(%arg0 : tensor<1x12x12xf

// -----

// CHECK-LABEL
// CHECK-LABEL: @fold_log_exp
func.func @fold_log_exp(%arg0: tensor<?x1xf32>) -> tensor<?x1xf32> {
// CHECK: return %arg{{.*}} : tensor<?x1xf32>
%0 = tosa.exp %arg0 : (tensor<?x1xf32>) -> tensor<?x1xf32>
Expand Down
6 changes: 3 additions & 3 deletions mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ func.func @test_binary_i32(%arg0 : tensor<4xi32>, %arg1 : tensor<i32>) -> () {

// CHECK-LABEL: @test_binary_i1
func.func @test_binary_i1(%arg0 : tensor<4xi1>, %arg1 : tensor<i1>) -> () {
// CHECK tosa.logical_and %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<4xi1>
// CHECK: tosa.logical_and %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<4xi1>
%0 = tosa.logical_and %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<*xi1>

// CHECK tosa.logical_or %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<4xi1>
// CHECK: tosa.logical_or %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<4xi1>
%1 = tosa.logical_or %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<*xi1>

// CHECK tosa.logical_xor %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<*4i1>
// CHECK: tosa.logical_xor %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<4xi1>
%2 = tosa.logical_xor %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<*xi1>

return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func.func @cast_away_contraction_leading_one_dims_nonleadingunitdim_rank4_acctra
// -----

// CHECK-LABEL: func.func @cast_away_contraction_does_not_transpose_leading_unit_dims
// CHECK-NOT vector.transpose
// CHECK-NOT: vector.transpose
// CHECK: vector.contract
func.func @cast_away_contraction_does_not_transpose_leading_unit_dims(%lhs: vector<1x1x8xi32>,
%rhs: vector<1x8x8xi32>,
Expand Down
30 changes: 15 additions & 15 deletions mlir/test/IR/parser.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -342,40 +342,40 @@ func.func @loop_bounds(%N : index) {

// CHECK-LABEL: func @ifinst(%{{.*}}: index) {
func.func @ifinst(%N: index) {
%c = arith.constant 200 : index // CHECK %{{.*}} = arith.constant 200
affine.for %i = 1 to 10 { // CHECK affine.for %{{.*}} = 1 to 10 {
affine.if #set0(%i)[%N, %c] { // CHECK affine.if #set0(%{{.*}})[%{{.*}}, %{{.*}}] {
%c = arith.constant 200 : index // CHECK: %{{.*}} = arith.constant 200
affine.for %i = 1 to 10 { // CHECK: affine.for %{{.*}} = 1 to 10 {
affine.if #set0(%i)[%N, %c] { // CHECK: affine.if #set(%{{.*}})[%{{.*}}, %{{.*}}] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't hardcode transient names after #, same as variable and block names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this looks weird, but there won't any better suggestions, so i've done what i've done.

%x = arith.constant 1 : i32
// CHECK: %{{.*}} = arith.constant 1 : i32
%y = "add"(%x, %i) : (i32, index) -> i32 // CHECK: %{{.*}} = "add"(%{{.*}}, %{{.*}}) : (i32, index) -> i32
%z = "mul"(%y, %y) : (i32, i32) -> i32 // CHECK: %{{.*}} = "mul"(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
} else { // CHECK } else {
affine.if affine_set<(i)[N] : (i - 2 >= 0, 4 - i >= 0)>(%i)[%N] { // CHECK affine.if (#set1(%{{.*}})[%{{.*}}]) {
affine.if affine_set<(i)[N] : (i - 2 >= 0, 4 - i >= 0)>(%i)[%N] { // CHECK: affine.if #set1(%{{.*}})[%{{.*}}] {
// CHECK: %{{.*}} = arith.constant 1 : index
%u = arith.constant 1 : index
// CHECK: %{{.*}} = affine.apply #map{{.*}}(%{{.*}}, %{{.*}})[%{{.*}}]
%w = affine.apply affine_map<(d0,d1)[s0] -> (d0+d1+s0)> (%i, %i) [%u]
} else { // CHECK } else {
%v = arith.constant 3 : i32 // %c3_i32 = arith.constant 3 : i32
}
} // CHECK }
} // CHECK }
return // CHECK return
} // CHECK }
} // CHECK: }
} // CHECK: }
return // CHECK: return
} // CHECK:}

// CHECK-LABEL: func @simple_ifinst(%{{.*}}: index) {
func.func @simple_ifinst(%N: index) {
%c = arith.constant 200 : index // CHECK %{{.*}} = arith.constant 200
affine.for %i = 1 to 10 { // CHECK affine.for %{{.*}} = 1 to 10 {
affine.if #set0(%i)[%N, %c] { // CHECK affine.if #set0(%{{.*}})[%{{.*}}, %{{.*}}] {
%c = arith.constant 200 : index // CHECK: %{{.*}} = arith.constant 200
affine.for %i = 1 to 10 { // CHECK: affine.for %{{.*}} = 1 to 10 {
affine.if #set0(%i)[%N, %c] { // CHECK: affine.if #set(%{{.*}})[%{{.*}}, %{{.*}}] {
%x = arith.constant 1 : i32
// CHECK: %{{.*}} = arith.constant 1 : i32
%y = "add"(%x, %i) : (i32, index) -> i32 // CHECK: %{{.*}} = "add"(%{{.*}}, %{{.*}}) : (i32, index) -> i32
%z = "mul"(%y, %y) : (i32, i32) -> i32 // CHECK: %{{.*}} = "mul"(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
} // CHECK }
} // CHECK }
return // CHECK return
} // CHECK }
} // CHECK: }
} // CHECK: }
return // CHECK: return
} // CHECK:}

// CHECK-LABEL: func @attributes() {
func.func @attributes() {
Expand Down
28 changes: 18 additions & 10 deletions mlir/test/Target/LLVMIR/llvmir.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -2331,39 +2331,47 @@ llvm.func @streaming_compatible_func() attributes {arm_streaming_compatible} {
// -----

// CHECK-LABEL: @new_za_func
// CHECK: #[[ATTR:[0-9]*]]
// CHECK-SAME: #[[ATTR:[0-9]*]]
llvm.func @new_za_func() attributes {arm_new_za} {
llvm.return
}
// CHECK #[[ATTR]] = { "aarch64_new_za" }
// CHECK: #[[ATTR]] = { "aarch64_new_za" }

// -----

// CHECK-LABEL: @in_za_func
// CHECK: #[[ATTR:[0-9]*]]
// CHECK-SAME: #[[ATTR:[0-9]*]]
llvm.func @in_za_func() attributes {arm_in_za } {
llvm.return
}
// CHECK #[[ATTR]] = { "aarch64_in_za" }
// CHECK: #[[ATTR]] = { "aarch64_in_za" }

// -----

// CHECK-LABEL: @out_za_func
// CHECK: #[[ATTR:[0-9]*]]
// CHECK-SAME: #[[ATTR:[0-9]*]]
llvm.func @out_za_func() attributes {arm_out_za } {
llvm.return
}
// CHECK #[[ATTR]] = { "aarch64_out_za" }
// CHECK: #[[ATTR]] = { "aarch64_out_za" }

// -----

// CHECK-LABEL: @inout_za_func
// CHECK: #[[ATTR:[0-9]*]]
// CHECK-SAME: #[[ATTR:[0-9]*]]
llvm.func @inout_za_func() attributes {arm_inout_za } {
llvm.return
}
// CHECK #[[ATTR]] = { "aarch64_inout_za" }
// CHECK: #[[ATTR]] = { "aarch64_inout_za" }

// -----

// CHECK-LABEL: @preserves_za_func
// CHECK: #[[ATTR:[0-9]*]]
// CHECK-SAME: #[[ATTR:[0-9]*]]
llvm.func @preserves_za_func() attributes {arm_preserves_za} {
llvm.return
}
// CHECK #[[ATTR]] = { "aarch64_preserves_za" }
// CHECK: #[[ATTR]] = { "aarch64_preserves_za" }

// -----

Expand Down
Loading
Loading