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

Conversation

klensy
Copy link
Contributor

@klensy klensy commented May 27, 2024

Few more fixes
previous: #92897 pr
Issues from #93154 unfixed.

@llvmbot
Copy link
Member

llvmbot commented May 27, 2024

@llvm/pr-subscribers-mlir-vector
@llvm/pr-subscribers-flang-openmp
@llvm/pr-subscribers-mlir-affine
@llvm/pr-subscribers-mlir-tensor
@llvm/pr-subscribers-mlir-sme
@llvm/pr-subscribers-mlir-llvm
@llvm/pr-subscribers-mlir-openmp
@llvm/pr-subscribers-mlir-tosa

@llvm/pr-subscribers-mlir-linalg

Author: klensy (klensy)

Changes

Few more fixes

Issues from #93154 unfixed.


Patch is 33.00 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/93476.diff

24 Files Affected:

  • (modified) mlir/test/Analysis/test-liveness.mlir (+4-4)
  • (modified) mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir (+1-1)
  • (modified) mlir/test/Conversion/MemRefToLLVM/convert-dynamic-memref-ops.mlir (+2-2)
  • (modified) mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir (+5-5)
  • (modified) mlir/test/Dialect/AMX/roundtrip.mlir (+1-1)
  • (modified) mlir/test/Dialect/Affine/loop-fusion-3.mlir (+1-1)
  • (modified) mlir/test/Dialect/Affine/unroll.mlir (+1-1)
  • (modified) mlir/test/Dialect/ArmSME/tile-allocation-liveness.mlir (+1-1)
  • (modified) mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir (+1-1)
  • (modified) mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir (+1-1)
  • (modified) mlir/test/Dialect/Linalg/transform-ops.mlir (+3-3)
  • (modified) mlir/test/Dialect/OpenMP/ops.mlir (+1-1)
  • (modified) mlir/test/Dialect/SparseTensor/sparse_reshape.mlir (+6-6)
  • (modified) mlir/test/Dialect/Tensor/canonicalize.mlir (+2-2)
  • (modified) mlir/test/Dialect/Tosa/canonicalize.mlir (+1-1)
  • (modified) mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir (+3-3)
  • (modified) mlir/test/Dialect/Vector/vector-dropleadunitdim-transforms.mlir (+1-1)
  • (modified) mlir/test/IR/parser.mlir (+15-15)
  • (modified) mlir/test/Target/LLVMIR/llvmir.mlir (+5-5)
  • (modified) mlir/test/Target/LLVMIR/openmp-llvm.mlir (+16-16)
  • (modified) mlir/test/Transforms/canonicalize.mlir (+1-1)
  • (modified) mlir/test/mlir-cpu-runner/copy.mlir (+1-1)
  • (modified) mlir/test/mlir-tblgen/bytecode-reserved.td (+1-1)
  • (modified) mlir/test/python/ir/attributes.py (+2-2)
diff --git a/mlir/test/Analysis/test-liveness.mlir b/mlir/test/Analysis/test-liveness.mlir
index 61a1e5fffa888..47805e5d95dae 100644
--- a/mlir/test/Analysis/test-liveness.mlir
+++ b/mlir/test/Analysis/test-liveness.mlir
@@ -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
 }
@@ -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
diff --git a/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir b/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
index 8877ee083286b..cd701095d8e64 100644
--- a/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
+++ b/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
@@ -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
   }
diff --git a/mlir/test/Conversion/MemRefToLLVM/convert-dynamic-memref-ops.mlir b/mlir/test/Conversion/MemRefToLLVM/convert-dynamic-memref-ops.mlir
index 609fcb10b992c..9d8f4266adf27 100644
--- a/mlir/test/Conversion/MemRefToLLVM/convert-dynamic-memref-ops.mlir
+++ b/mlir/test/Conversion/MemRefToLLVM/convert-dynamic-memref-ops.mlir
@@ -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>
diff --git a/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir b/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir
index 1b046d32f163a..73d2367915284 100644
--- a/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir
+++ b/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir
@@ -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>
@@ -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>
@@ -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
 
@@ -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
 
@@ -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
 
diff --git a/mlir/test/Dialect/AMX/roundtrip.mlir b/mlir/test/Dialect/AMX/roundtrip.mlir
index 8018962f1092d..f2ac5e47f6c35 100644
--- a/mlir/test/Dialect/AMX/roundtrip.mlir
+++ b/mlir/test/Dialect/AMX/roundtrip.mlir
@@ -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>
diff --git a/mlir/test/Dialect/Affine/loop-fusion-3.mlir b/mlir/test/Dialect/Affine/loop-fusion-3.mlir
index 37ad178235dc9..6bc4feadb8c98 100644
--- a/mlir/test/Dialect/Affine/loop-fusion-3.mlir
+++ b/mlir/test/Dialect/Affine/loop-fusion-3.mlir
@@ -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
 
 
 
diff --git a/mlir/test/Dialect/Affine/unroll.mlir b/mlir/test/Dialect/Affine/unroll.mlir
index eb90d10362f9b..e398c3fe2011d 100644
--- a/mlir/test/Dialect/Affine/unroll.mlir
+++ b/mlir/test/Dialect/Affine/unroll.mlir
@@ -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
 }
diff --git a/mlir/test/Dialect/ArmSME/tile-allocation-liveness.mlir b/mlir/test/Dialect/ArmSME/tile-allocation-liveness.mlir
index fe4c005c7c42f..9c22b29ac22e7 100644
--- a/mlir/test/Dialect/ArmSME/tile-allocation-liveness.mlir
+++ b/mlir/test/Dialect/ArmSME/tile-allocation-liveness.mlir
@@ -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>
diff --git a/mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir b/mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir
index a9cbaaf7fdc48..c72a676b3f37e 100644
--- a/mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir
+++ b/mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir
@@ -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
diff --git a/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir b/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir
index 15a4f6cdd3bbe..898070b2e61fc 100644
--- a/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir
+++ b/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir
@@ -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]]
 
 // -----
 
diff --git a/mlir/test/Dialect/Linalg/transform-ops.mlir b/mlir/test/Dialect/Linalg/transform-ops.mlir
index 733f305f850c6..e626b52981cf8 100644
--- a/mlir/test/Dialect/Linalg/transform-ops.mlir
+++ b/mlir/test/Dialect/Linalg/transform-ops.mlir
@@ -2,7 +2,7 @@
 
 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)
 }
 
@@ -10,9 +10,9 @@ transform.sequence failures(propagate) {
 // 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 %arg0 [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 %arg0 [4, 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)
 }
 
diff --git a/mlir/test/Dialect/OpenMP/ops.mlir b/mlir/test/Dialect/OpenMP/ops.mlir
index caf25a3cb59f0..2e43d6306ac80 100644
--- a/mlir/test/Dialect/OpenMP/ops.mlir
+++ b/mlir/test/Dialect/OpenMP/ops.mlir
@@ -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) private(%{{.*}} : memref<i32>) proc_bind(close)
  omp.parallel num_threads(%num_threads : i32) if(%if_cond: i1) proc_bind(close) {
    omp.terminator
  }
diff --git a/mlir/test/Dialect/SparseTensor/sparse_reshape.mlir b/mlir/test/Dialect/SparseTensor/sparse_reshape.mlir
index c96f9c31443db..492dcd05dc909 100644
--- a/mlir/test/Dialect/SparseTensor/sparse_reshape.mlir
+++ b/mlir/test/Dialect/SparseTensor/sparse_reshape.mlir
@@ -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
@@ -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
diff --git a/mlir/test/Dialect/Tensor/canonicalize.mlir b/mlir/test/Dialect/Tensor/canonicalize.mlir
index f7fbd3834288b..b378a4b410e09 100644
--- a/mlir/test/Dialect/Tensor/canonicalize.mlir
+++ b/mlir/test/Dialect/Tensor/canonicalize.mlir
@@ -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>
diff --git a/mlir/test/Dialect/Tosa/canonicalize.mlir b/mlir/test/Dialect/Tosa/canonicalize.mlir
index 6eac759a08364..862b1c3245791 100644
--- a/mlir/test/Dialect/Tosa/canonicalize.mlir
+++ b/mlir/test/Dialect/Tosa/canonicalize.mlir
@@ -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>
diff --git a/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir b/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
index 2be120439ed68..de0214f698698 100644
--- a/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
@@ -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<*4i1>
   %2 = tosa.logical_xor %arg0, %arg1 : (tensor<4xi1>, tensor<i1>) -> tensor<*xi1>
 
   return
diff --git a/mlir/test/Dialect/Vector/vector-dropleadunitdim-transforms.mlir b/mlir/test/Dialect/Vector/vector-dropleadunitdim-transforms.mlir
index 252aeb0c15cbe..9526d610e490e 100644
--- a/mlir/test/Dialect/Vector/vector-dropleadunitdim-transforms.mlir
+++ b/mlir/test/Dialect/Vector/vector-dropleadunitdim-transforms.mlir
@@ -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>,
diff --git a/mlir/test/IR/parser.mlir b/mlir/test/IR/parser.mlir
index bcc146ea0101b..964838adb6088 100644
--- a/mlir/test/IR/parser.mlir
+++ b/mlir/test/IR/parser.mlir
@@ -342,15 +342,15 @@ 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 #set0(%{{.*}})[%{{.*}}, %{{.*}}] {
       %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{{.*}}(%{{.*}}, %{{.*}})[%{{.*}}]
@@ -358,24 +358,24 @@ func.func @ifinst(%N: index) {
       } 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 #set0(%{{.*}})[%{{.*}}, %{{.*}}] {
       %x = arith.constant 1 : i32
        // CHECK: %{{.*}} = arith.constant 1 : i32
       %y = "add"(%x, %i) : (i32, index) -> i32 // CHECK: %{{.*}} = "add"(%{{.*}}, %{{.*}}) : (i32, in...
[truncated]

@banach-space
Copy link
Contributor

LG, thanks!

If this is patch K (e.g. 2 or 3) in a series of N patches, could you add a link to the previous patches in the summary? Also, could you and add sth like (patch K/N) to the title? This way it will be very obvious that this is a part of a multi-PR refactor. Otherwise that's not that clear.

@klensy
Copy link
Contributor Author

klensy commented May 27, 2024

Added link to previous PR.
I didn't intended this be series of PRs, but just found new pattern of typos which revealed new errors.

@banach-space
Copy link
Contributor

banach-space commented May 27, 2024

Added link to previous PR.

Thanks!

I didn't intended this be series of PRs, but just found new pattern of typos which revealed new errors.

This happens to me quite regularly :) Still, IMHO it's good to add a note like (patch 2/N) to indicate that this is 2nd patch in a series of similar patches (makes the context much clear). Note that there's no need to specify N if you don't know how many similar patches you'll end up sending (this is fairly common).

EDIT

I see that there are some CI failures - these need to be addressed before landing :)

@klensy klensy force-pushed the filecheck-mlir2 branch from f85a457 to f90b17f Compare May 28, 2024 09:18
@klensy klensy force-pushed the filecheck-mlir2 branch from f90b17f to 8f2619a Compare May 28, 2024 09:46
@klensy
Copy link
Contributor Author

klensy commented May 28, 2024

I see that there are some CI failures - these need to be addressed before landing :)

I need help resolving these CI errors, as not all of them trivial.

@klensy klensy changed the title [mlir][test] Fix filecheck annotation typos [mlir][test] Fix filecheck annotation typos [2/n] May 28, 2024
@MacDue
Copy link
Member

MacDue commented May 28, 2024

Fix for the arm streaming attributes:

diff --git a/mlir/test/Target/LLVMIR/llvmir.mlir b/mlir/test/Target/LLVMIR/llvmir.mlir
index 97f37939551d..c83641a57537 100644
--- a/mlir/test/Target/LLVMIR/llvmir.mlir
+++ b/mlir/test/Target/LLVMIR/llvmir.mlir
@@ -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" }
 
 // -----

@klensy klensy force-pushed the filecheck-mlir2 branch from 8f2619a to b01e04e Compare May 28, 2024 19:40
@klensy
Copy link
Contributor Author

klensy commented May 28, 2024

Fix for the arm streaming attributes:

done

@MacDue
Copy link
Member

MacDue commented May 28, 2024

Here's a fix for attributes.py too:

diff --git a/mlir/test/python/ir/attributes.py b/mlir/test/python/ir/attributes.py
index dbd6bad05e01..6c1ac88f3226 100644
--- a/mlir/test/python/ir/attributes.py
+++ b/mlir/test/python/ir/attributes.py
@@ -514,7 +514,7 @@ def testDictAttr():
 
         a = DictAttr.get(dict_attr)
 
-        # CHECK attr: {integerattr = 42 : i32, stringattr = "string"}
+        # CHECK: attr: {integerattr = 42 : i32, stringattr = "string"}
         print("attr:", a)
 
         assert len(a) == 2
@@ -546,7 +546,7 @@ def testDictAttr():
         else:
             assert False, "expected IndexError on accessing an out-of-bounds attribute"
 
-        # CHECK "empty: {}"
+        # CHECK: empty: {}
         print("empty: ", DictAttr.get())

@klensy
Copy link
Contributor Author

klensy commented May 28, 2024

> -        # CHECK "empty: {}"
> +        # CHECK: empty: {}

ahh, quotes.

Copy link
Member

@MacDue MacDue left a comment

Choose a reason for hiding this comment

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

Arm related changes look good 👍

Copy link
Contributor

@banach-space banach-space left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Contributor

@Dinistro Dinistro left a comment

Choose a reason for hiding this comment

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

LLVM dialect related changes LGTM!
Thank you very much for pushing this cleanup effort 🙂

@aartbik
Copy link
Contributor

aartbik commented Jun 10, 2024

sparse changes LGTM, thanks for fixing!

@MacDue
Copy link
Member

MacDue commented Jun 10, 2024

Can we land this soon (and keep an eye on the buildbots for any extra failures)?

@Dinistro
Copy link
Contributor

I'm pro landing this

@Dinistro Dinistro mentioned this pull request Jun 11, 2024
@klensy
Copy link
Contributor Author

klensy commented Jun 11, 2024

NB: there still exist #93154 with few more wrong tests.

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.

@ftynse
Copy link
Member

ftynse commented Jun 14, 2024

I'm going to just land this. Revert of fix-forward if something breaks.

@ftynse ftynse merged commit a5985ca into llvm:main Jun 14, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants