[PATCH] D152333: update_mir_test_checks.py doesn't separate different prefix checks #63112

Eddie Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 06:06:57 PDT 2023


eddiep24 updated this revision to Diff 537329.
Herald added a subscriber: arichardson.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152333/new/

https://reviews.llvm.org/D152333

Files:
  llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
  llvm/utils/update_mir_test_checks.py


Index: llvm/utils/update_mir_test_checks.py
===================================================================
--- llvm/utils/update_mir_test_checks.py
+++ llvm/utils/update_mir_test_checks.py
@@ -235,9 +235,10 @@
                 break
             if not func_dict[prefix][func_name]:
                 continue
-            # if printed_prefixes:
-            #     # Add some space between different check prefixes.
-            #     output_lines.append('')
+            if printed_prefixes:
+                # Add some space between different check prefixes.
+                indent = len(output_lines[-1]) - len(output_lines[-1].lstrip(" "))
+                output_lines.append(" "*indent + ";")
             printed_prefixes.add(prefix)
             log("Adding {} lines for {}".format(prefix, func_name), args.verbose)
             add_check_lines(
@@ -333,9 +334,9 @@
 
 
 def should_add_line_to_output(input_line, prefix_set):
-    # Skip any check lines that we're handling.
+    # Skip any check lines that we're handling as well as comments
     m = common.CHECK_RE.match(input_line)
-    if m and m.group(1) in prefix_set:
+    if (m and m.group(1) in prefix_set) or re.search("^[ \t]*;", input_line):
         return False
     return True
 
Index: llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
===================================================================
--- llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
+++ llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
@@ -22,6 +22,7 @@
   ; NOAVX-NEXT:   [[MOV64rm:%[0-9]+]]:gr64 = MOV64rm $rip, 1, $noreg, target-flags(x86-gotpcrel) @z, $noreg :: (load (s64) from got, align 16)
   ; NOAVX-NEXT:   MOVAPSmr killed [[MOV64rm]], 1, $noreg, 0, $noreg, killed [[V_SET0_]] :: (store (s128) into @z)
   ; NOAVX-NEXT:   RET 0
+  ;
   ; AVX-LABEL: name: zero128
   ; AVX: bb.0 (%ir-block.0):
   ; AVX-NEXT:   [[V_SET0_:%[0-9]+]]:vr128 = V_SET0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152333.537329.patch
Type: text/x-patch
Size: 2052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230705/21c11589/attachment-0001.bin>


More information about the llvm-commits mailing list