Skip to content

[mlir] fix filecheck prefixes in a dataflow test #75794

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 1 commit into from
Dec 18, 2023

Conversation

ftynse
Copy link
Member

@ftynse ftynse commented Dec 18, 2023

-SAME and -LITERAL do not compose in CHECK commands.

-SAME and -LITERAL do not compose in CHECK commands.
@ftynse ftynse requested a review from wsmoses December 18, 2023 13:50
@llvmbot llvmbot added the mlir label Dec 18, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 18, 2023

@llvm/pr-subscribers-mlir

Author: Oleksandr "Alex" Zinenko (ftynse)

Changes

-SAME and -LITERAL do not compose in CHECK commands.


Full diff: https://github.com/llvm/llvm-project/pull/75794.diff

1 Files Affected:

  • (modified) mlir/test/Analysis/DataFlow/test-next-access.mlir (+55-55)
diff --git a/mlir/test/Analysis/DataFlow/test-next-access.mlir b/mlir/test/Analysis/DataFlow/test-next-access.mlir
index de0788fb6a1768..70069b10a93983 100644
--- a/mlir/test/Analysis/DataFlow/test-next-access.mlir
+++ b/mlir/test/Analysis/DataFlow/test-next-access.mlir
@@ -398,29 +398,29 @@ func.func @conditonal_call(%arg0: memref<f32>, %cond: i1) {
 // "caller" -> "call" -> "callee" -> "post"
 
 func.func private @callee(%arg0: memref<f32>) {
-  // IP:              name = "callee"
-  // IP-SAME-LITERAL: next_access = [["post"]]
-  // LOCAL:           name = "callee"
-  // LOCAL-SAME:      next_access = ["unknown"]
+  // IP:         name = "callee"
+  // IP-SAME:    next_access = {{\[}}["post"]]
+  // LOCAL:      name = "callee"
+  // LOCAL-SAME: next_access = ["unknown"]
   memref.load %arg0[] {name = "callee"} : memref<f32>
   return
 }
 
 // CHECK-LABEL: @call_and_store_before
 func.func @call_and_store_before(%arg0: memref<f32>) {
-  // IP:              name = "caller"
-  // IP-SAME-LITERAL: next_access = [["call"]]
-  // LOCAL:           name = "caller"
-  // LOCAL-SAME:      next_access = ["unknown"]
-  // LC_AR:           name = "caller"
-  // LC_AR-SAME:      next_access = {{\[}}["call"]]
+  // IP:         name = "caller"
+  // IP-SAME:    next_access = {{\[}}["call"]]
+  // LOCAL:      name = "caller"
+  // LOCAL-SAME: next_access = ["unknown"]
+  // LC_AR:      name = "caller"
+  // LC_AR-SAME: next_access = {{\[}}["call"]]
   memref.load %arg0[] {name = "caller"} : memref<f32>
   // Note that the access after the entire call is "post".
-  // CHECK:              name = "call"
-  // CHECK-SAME-LITERAL: next_access = [["post"], ["post"]]
+  // CHECK:      name = "call"
+  // CHECK-SAME: next_access = {{\[}}["post"], ["post"]]
   test.call_and_store @callee(%arg0), %arg0 {name = "call", store_before_call = true} : (memref<f32>, memref<f32>) -> ()
-  // CHECK:              name = "post"
-  // CHECK-SAME-LITERAL: next_access = ["unknown"]
+  // CHECK:      name = "post"
+  // CHECK-SAME: next_access = ["unknown"]
   memref.load %arg0[] {name = "post"} : memref<f32>
   return
 }
@@ -432,28 +432,28 @@ func.func @call_and_store_before(%arg0: memref<f32>) {
 // "caller" -> "callee" -> "call" -> "post"
 
 func.func private @callee(%arg0: memref<f32>) {
-  // IP:              name = "callee"
-  // IP-SAME-LITERAL: next_access = [["call"]]
-  // LOCAL:           name = "callee"
-  // LOCAL-SAME:      next_access = ["unknown"]
+  // IP:         name = "callee"
+  // IP-SAME:    next_access = {{\[}}["call"]]
+  // LOCAL:      name = "callee"
+  // LOCAL-SAME: next_access = ["unknown"]
   memref.load %arg0[] {name = "callee"} : memref<f32>
   return
 }
 
 // CHECK-LABEL: @call_and_store_after
 func.func @call_and_store_after(%arg0: memref<f32>) {
-  // IP:              name = "caller"
-  // IP-SAME-LITERAL: next_access = [["callee"]]
-  // LOCAL:           name = "caller"
-  // LOCAL-SAME:      next_access = ["unknown"]
-  // LC_AR:           name = "caller"
-  // LC_AR-SAME:      next_access = {{\[}}["call"]]
+  // IP:         name = "caller"
+  // IP-SAME:    next_access = {{\[}}["callee"]]
+  // LOCAL:      name = "caller"
+  // LOCAL-SAME: next_access = ["unknown"]
+  // LC_AR:      name = "caller"
+  // LC_AR-SAME: next_access = {{\[}}["call"]]
   memref.load %arg0[] {name = "caller"} : memref<f32>
-  // CHECK:              name = "call"
-  // CHECK-SAME-LITERAL: next_access = [["post"], ["post"]]
+  // CHECK:      name = "call"
+  // CHECK-SAME: next_access = {{\[}}["post"], ["post"]]
   test.call_and_store @callee(%arg0), %arg0 {name = "call", store_before_call = false} : (memref<f32>, memref<f32>) -> ()
-  // CHECK:              name = "post"
-  // CHECK-SAME-LITERAL: next_access = ["unknown"]
+  // CHECK:      name = "post"
+  // CHECK-SAME: next_access = ["unknown"]
   memref.load %arg0[] {name = "post"} : memref<f32>
   return
 }
@@ -466,12 +466,12 @@ func.func @call_and_store_after(%arg0: memref<f32>) {
 //   - at the entry of the block, the next access is "post".
 // CHECK-LABEL: @store_with_a_region
 func.func @store_with_a_region_before(%arg0: memref<f32>) {
-  // CHECK:              name = "pre"
-  // CHECK-SAME-LITERAL: next_access = [["region"]]
+  // CHECK:      name = "pre"
+  // CHECK-SAME: next_access = {{\[}}["region"]]
   memref.load %arg0[] {name = "pre"} : memref<f32>
   // CHECK:              name = "region"
-  // CHECK-SAME-LITERAL: next_access = [["post"]]
-  // CHECK-SAME-LITERAL: next_at_entry_point = [[["post"]]]
+  // CHECK-SAME: next_access = {{\[}}["post"]]
+  // CHECK-SAME: next_at_entry_point = {{\[}}{{\[}}["post"]]]
   test.store_with_a_region %arg0 attributes { name = "region", store_before_region = true } {
     test.store_with_a_region_terminator
   } : memref<f32>
@@ -485,12 +485,12 @@ func.func @store_with_a_region_before(%arg0: memref<f32>) {
 //   - at the entry of the block, the next access is "region".
 // CHECK-LABEL: @store_with_a_region
 func.func @store_with_a_region_after(%arg0: memref<f32>) {
-  // CHECK:              name = "pre"
-  // CHECK-SAME-LITERAL: next_access = [["region"]]
+  // CHECK:      name = "pre"
+  // CHECK-SAME: next_access = {{\[}}["region"]]
   memref.load %arg0[] {name = "pre"} : memref<f32>
-  // CHECK:              name = "region"
-  // CHECK-SAME-LITERAL: next_access = [["post"]]
-  // CHECK-SAME-LITERAL: next_at_entry_point = [[["region"]]]
+  // CHECK:      name = "region"
+  // CHECK-SAME: next_access = {{\[}}["post"]]
+  // CHECK-SAME: next_at_entry_point = {{\[}}{{\[}}["region"]]]
   test.store_with_a_region %arg0 attributes { name = "region", store_before_region = false } {
     test.store_with_a_region_terminator
   } : memref<f32>
@@ -509,20 +509,20 @@ func.func @store_with_a_region_after(%arg0: memref<f32>) {
 // That is, the order of access is: "pre" -> "region" -> "inner" -> "post".
 // CHECK-LABEL: @store_with_a_region_before_containing_a_load
 func.func @store_with_a_region_before_containing_a_load(%arg0: memref<f32>) {
-  // CHECK:              name = "pre"
-  // CHECK-SAME-LITERAL: next_access = [["region"]]
+  // CHECK:      name = "pre"
+  // CHECK-SAME: next_access = {{\[}}["region"]]
   memref.load %arg0[] {name = "pre"} : memref<f32>
-  // CHECK:              name = "region"
-  // CHECK-SAME-LITERAL: next_access = [["post"]]
-  // CHECK-SAME-LITERAL: next_at_entry_point = [[["inner"]]]
+  // CHECK:      name = "region"
+  // CHECK-SAME: next_access = {{\[}}["post"]]
+  // CHECK-SAME: next_at_entry_point = {{\[}}{{\[}}["inner"]]]
   test.store_with_a_region %arg0 attributes { name = "region", store_before_region = true } {
-    // CHECK:              name = "inner"
-    // CHECK-SAME-LITERAL: next_access = [["post"]]
+    // CHECK:      name = "inner"
+    // CHECK-SAME: next_access = {{\[}}["post"]]
     memref.load %arg0[] {name = "inner"} : memref<f32>
     test.store_with_a_region_terminator
   } : memref<f32>
-  // CHECK:              name = "post"
-  // CHECK-SAME-LITERAL: next_access = ["unknown"]
+  // CHECK:      name = "post"
+  // CHECK-SAME: next_access = ["unknown"]
   memref.load %arg0[] {name = "post"} : memref<f32>
   return
 }
@@ -538,20 +538,20 @@ func.func @store_with_a_region_before_containing_a_load(%arg0: memref<f32>) {
 // That is, the order of access is "pre" -> "inner" -> "region" -> "post".
 // CHECK-LABEL: @store_with_a_region_after_containing_a_load
 func.func @store_with_a_region_after_containing_a_load(%arg0: memref<f32>) {
-  // CHECK:              name = "pre"
-  // CHECK-SAME-LITERAL: next_access = [["inner"]]
+  // CHECK:      name = "pre"
+  // CHECK-SAME: next_access = {{\[}}["inner"]]
   memref.load %arg0[] {name = "pre"} : memref<f32>
-  // CHECK:              name = "region"
-  // CHECK-SAME-LITERAL: next_access = [["post"]]
-  // CHECK-SAME-LITERAL: next_at_entry_point = [[["inner"]]]
+  // CHECK:      name = "region"
+  // CHECK-SAME: next_access = {{\[}}["post"]]
+  // CHECK-SAME: next_at_entry_point = {{\[}}{{\[}}["inner"]]]
   test.store_with_a_region %arg0 attributes { name = "region", store_before_region = false } {
-    // CHECK:              name = "inner"
-    // CHECK-SAME-LITERAL: next_access = [["region"]]
+    // CHECK:      name = "inner"
+    // CHECK-SAME: next_access = {{\[}}["region"]]
     memref.load %arg0[] {name = "inner"} : memref<f32>
     test.store_with_a_region_terminator
   } : memref<f32>
-  // CHECK:              name = "post"
-  // CHECK-SAME-LITERAL: next_access = ["unknown"]
+  // CHECK:      name = "post"
+  // CHECK-SAME: next_access = ["unknown"]
   memref.load %arg0[] {name = "post"} : memref<f32>
   return
 }

@ftynse ftynse merged commit 4d9d105 into llvm:main Dec 18, 2023
@ftynse ftynse deleted the fix-dataflow-test branch December 18, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants