[PATCH] D152896: [update_mir_test_checks] Tolerate -simplify-mir output

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 03:50:02 PDT 2023


foad created this revision.
foad added reviewers: gbossu, arichardson, bogner, nhaehnle, arsenm.
Herald added a subscriber: StephenFan.
Herald added a project: All.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

D135579 <https://reviews.llvm.org/D135579> added support for fixedStack, but did not cope with the output
of -simplify-mir which does not include the fixedStack section by
default.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152896

Files:
  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
  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
@@ -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"^\.\.\.$",
Index: llvm/test/tools/UpdateTestChecks/update_mir_test_checks/x86-simplify-mir.test
===================================================================
--- /dev/null
+++ 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
Index: llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll.expected
===================================================================
--- /dev/null
+++ 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
+}
Index: llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll
===================================================================
--- /dev/null
+++ 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
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152896.531252.patch
Type: text/x-patch
Size: 1983 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230614/5cd9ffdd/attachment.bin>


More information about the llvm-commits mailing list