[llvm] e829eb9 - [update_mir_test_checks] Tolerate -simplify-mir output

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 05:16:07 PDT 2023


Author: Jay Foad
Date: 2023-06-14T13:16:00+01:00
New Revision: e829eb9075c44ea708b8b6f95d7766f9681efc90

URL: https://github.com/llvm/llvm-project/commit/e829eb9075c44ea708b8b6f95d7766f9681efc90
DIFF: https://github.com/llvm/llvm-project/commit/e829eb9075c44ea708b8b6f95d7766f9681efc90.diff

LOG: [update_mir_test_checks] Tolerate -simplify-mir output

D135579 added support for fixedStack, but did not cope with the output
of -simplify-mir which does not include the fixedStack section by
default.

Differential Revision: https://reviews.llvm.org/D152896

Added: 
    llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll
    llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll.expected
    llvm/test/tools/UpdateTestChecks/update_mir_test_checks/x86-simplify-mir.test

Modified: 
    llvm/utils/update_mir_test_checks.py

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll
new file mode 100644
index 0000000000000..018e7bf9200bc
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll
@@ -0,0 +1,5 @@
+; RUN: llc < %s -mtriple=x86_64 -stop-after=finalize-isel -simplify-mir | FileCheck %s
+
+define void @f() {
+  ret void
+}

diff  --git a/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll.expected b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll.expected
new file mode 100644
index 0000000000000..026e1dbf7b236
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll.expected
@@ -0,0 +1,9 @@
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+; RUN: llc < %s -mtriple=x86_64 -stop-after=finalize-isel -simplify-mir | FileCheck %s
+
+define void @f() {
+  ; CHECK-LABEL: name: f
+  ; CHECK: bb.0 (%ir-block.0):
+  ; CHECK-NEXT:   RET 0
+  ret void
+}

diff  --git a/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/x86-simplify-mir.test b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/x86-simplify-mir.test
new file mode 100644
index 0000000000000..318b292bb918c
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/x86-simplify-mir.test
@@ -0,0 +1,5 @@
+# REQUIRES: x86-registered-target
+## Check that update_mir_test_checks handles -simplify-mir
+
+# RUN: cp -f %S/Inputs/x86-simplify-mir.ll %t.ll && %update_mir_test_checks %t.ll
+# RUN: 
diff  -u %S/Inputs/x86-simplify-mir.ll.expected %t.ll

diff  --git a/llvm/utils/update_mir_test_checks.py b/llvm/utils/update_mir_test_checks.py
index 66efce6c82165..96732bd5e08df 100755
--- a/llvm/utils/update_mir_test_checks.py
+++ b/llvm/utils/update_mir_test_checks.py
@@ -57,10 +57,10 @@
     r"\n"
     r"^ *name: *(?P<func>[A-Za-z0-9_.-]+)$"
     r".*?"
-    r"^ *fixedStack: *(\[\])? *\n"
+    r"(?:^ *fixedStack: *(\[\])? *\n"
     r"(?P<fixedStack>.*?)\n?"
     r"^ *stack:"
-    r".*?"
+    r".*?)?"
     r"^ *body: *\|\n"
     r"(?P<body>.*?)\n"
     r"^\.\.\.$",


        


More information about the llvm-commits mailing list