--- /dev/null
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=none -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK
+
+--- |
+
+ define void @test() {
+ unreachable
+ }
+
+...
+---
+name: test
+alignment: 16
+registers:
+ - { id: 0, class: gpr, preferred-register: '' }
+body: |
+ bb.1:
+ dead %0(s32) = G_CONSTANT i32 0
+
+...
--- /dev/null
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=none -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK
+
+--- |
+
+ define void @test() {
+ unreachable
+ }
+
+...
+---
+name: test
+alignment: 16
+registers:
+ - { id: 0, class: gpr, preferred-register: '' }
+body: |
+ bb.1:
+ ; CHECK-LABEL: name: test
+ ; CHECK: dead [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 0
+ dead %0(s32) = G_CONSTANT i32 0
+
+...
--- /dev/null
+# REQUIRES: x86-registered-target
+## Check that update_mir_test_checks replaces vregs in dead definitions
+
+# RUN: cp -f %S/Inputs/x86-dead-def.mir %t.mir && %update_mir_test_checks %t.mir
+# RUN: diff -u %S/Inputs/x86-dead-def.mir.expected %t.mir
MI_FLAGS_STR= (
r'(frame-setup |frame-destroy |nnan |ninf |nsz |arcp |contract |afn '
r'|reassoc |nuw |nsw |exact |nofpexcept |nomerge )*')
+VREG_DEF_FLAGS_STR = r'(?:dead )*'
VREG_DEF_RE = re.compile(
- r'^ *(?P<vregs>{0}(?:, {0})*) = '
- r'{1}(?P<opcode>[A-Zt][A-Za-z0-9_]+)'.format(VREG_RE.pattern, MI_FLAGS_STR))
+ r'^ *(?P<vregs>{2}{0}(?:, {2}{0})*) = '
+ r'{1}(?P<opcode>[A-Zt][A-Za-z0-9_]+)'.format(
+ VREG_RE.pattern, MI_FLAGS_STR, VREG_DEF_FLAGS_STR))
MIR_PREFIX_DATA_RE = re.compile(r'^ *(;|bb.[0-9].*: *$|[a-z]+:( |$)|$)')
IR_FUNC_NAME_RE = re.compile(