[Mlir-commits] [mlir] [MLIR] When generating tests explicitly match only valid SSA var names (PR #67279)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Sep 24 19:46:35 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

<details>
<summary>Changes</summary>

Matching everything for variable names causes problems when there are
multiple variables of the same type in a function definition. The match
greedily assigned everything up to the second value definition to the
name of the first value.


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


1 Files Affected:

- (modified) mlir/utils/generate-test-checks.py (+1-1) 


``````````diff
diff --git a/mlir/utils/generate-test-checks.py b/mlir/utils/generate-test-checks.py
index 8faa425beace1d7..e912be44cf95a1a 100755
--- a/mlir/utils/generate-test-checks.py
+++ b/mlir/utils/generate-test-checks.py
@@ -180,7 +180,7 @@ def process_line(line_chunks, variable_namer):
         else:
             # Otherwise, generate a new variable.
             variable = variable_namer.generate_name(ssa_name)
-            output_line += "%[[" + variable + ":.*]]"
+            output_line += "%[[" + variable + ":" + SSA_RE_STR + "]]"
 
         # Append the non named group.
         output_line += chunk[len(ssa_name) :]

``````````

</details>


https://github.com/llvm/llvm-project/pull/67279


More information about the Mlir-commits mailing list