[X86] Pre-commit a test case for D110829
authorJay Foad <jay.foad@amd.com>
Tue, 5 Oct 2021 13:51:12 +0000 (14:51 +0100)
committerJay Foad <jay.foad@amd.com>
Thu, 7 Oct 2021 18:50:27 +0000 (19:50 +0100)
llvm/test/CodeGen/X86/twoaddr-mul2.mir [new file with mode: 0644]

diff --git a/llvm/test/CodeGen/X86/twoaddr-mul2.mir b/llvm/test/CodeGen/X86/twoaddr-mul2.mir
new file mode 100644 (file)
index 0000000..f8f2e06
--- /dev/null
@@ -0,0 +1,25 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=x86_64-unknown -mcpu=haswell -run-pass=twoaddressinstruction %s -o - | FileCheck %s
+
+# FIXME: The killed flag should be on the second COPY from [[COPY]], not the first one.
+---
+name: test_mul_by_2
+tracksRegLiveness: true
+body: |
+  bb.0:
+    liveins: $edi
+
+    ; CHECK-LABEL: name: test_mul_by_2
+    ; CHECK: liveins: $edi
+    ; CHECK-NEXT: {{  $}}
+    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY killed $edi
+    ; CHECK-NEXT: undef %2.sub_32bit:gr64 = COPY killed [[COPY]]
+    ; CHECK-NEXT: undef %3.sub_32bit:gr64_nosp = COPY [[COPY]]
+    ; CHECK-NEXT: [[LEA64_32r:%[0-9]+]]:gr32 = LEA64_32r killed %2, 1, killed %3, 0, $noreg
+    ; CHECK-NEXT: $eax = COPY killed [[LEA64_32r]]
+    ; CHECK-NEXT: RET 0, killed $eax
+    %0:gr32 = COPY killed $edi
+    %1:gr32 = ADD32rr killed %0, %0, implicit-def dead $eflags
+    $eax = COPY killed %1
+    RET 0, killed $eax
+...