[llvm] 948375f - update_mir_test_checks.py - separate different prefix checks
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 03:51:16 PDT 2023
Author: Eddie Phillips
Date: 2023-07-06T11:49:52+01:00
New Revision: 948375f0a62ae1887d5a8dea84048606435116a2
URL: https://github.com/llvm/llvm-project/commit/948375f0a62ae1887d5a8dea84048606435116a2
DIFF: https://github.com/llvm/llvm-project/commit/948375f0a62ae1887d5a8dea84048606435116a2.diff
LOG: update_mir_test_checks.py - separate different prefix checks
Matches behaviour in update_llc_test_checks.py etc.
Fixes #63112
Differential Revision: https://reviews.llvm.org/D152333
Added:
Modified:
llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
llvm/utils/update_mir_test_checks.py
Removed:
################################################################################
diff --git a/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
index 1f51a861a28620..32ea0961e46b2f 100644
--- a/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
@@ -22,6 +22,7 @@ define void @zero128() nounwind ssp {
; 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
diff --git a/llvm/utils/update_mir_test_checks.py b/llvm/utils/update_mir_test_checks.py
index 96732bd5e08df4..815738b2340231 100755
--- a/llvm/utils/update_mir_test_checks.py
+++ b/llvm/utils/update_mir_test_checks.py
@@ -235,9 +235,10 @@ def add_checks_for_function(
break
if not func_dict[prefix][func_name]:
continue
- # if printed_prefixes:
- # # Add some space between
diff erent check prefixes.
- # output_lines.append('')
+ if printed_prefixes:
+ # Add some space between
diff erent 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 mangle_vreg(opcode, current_names):
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
More information about the llvm-commits
mailing list