[llvm] update_mir_test_checks: keep commment embedded in MIR (PR #140016)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 00:23:28 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-testing-tools

Author: Ruiling, Song (ruiling)

<details>
<summary>Changes</summary>

We often add inline comment in mir. It is useful to keep them.

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


1 Files Affected:

- (modified) llvm/utils/update_mir_test_checks.py (+2-2) 


``````````diff
diff --git a/llvm/utils/update_mir_test_checks.py b/llvm/utils/update_mir_test_checks.py
index 86147034d946b..8deaec74f2777 100755
--- a/llvm/utils/update_mir_test_checks.py
+++ b/llvm/utils/update_mir_test_checks.py
@@ -339,9 +339,9 @@ def mangle_vreg(opcode, current_names):
 
 
 def should_add_line_to_output(input_line, prefix_set):
-    # Skip any check lines that we're handling as well as comments
+    # Skip any check lines that we're handling as well as blank comment.
     m = common.CHECK_RE.match(input_line)
-    if (m and m.group(1) in prefix_set) or re.search("^[ \t]*;", input_line):
+    if (m and m.group(1) in prefix_set) or input_line.strip() == ";":
         return False
     return True
 

``````````

</details>


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


More information about the llvm-commits mailing list