1 # RUN: llc -march=x86-64 -run-pass none -o - %s | FileCheck %s
2 # This test ensures that the MIR parser parses virtual register definitions and
3 # references correctly.
7 define i32 @bar(i32 %a) {
9 %0 = icmp sle i32 %a, 10
10 br i1 %0, label %less, label %exit
19 define i32 @foo(i32 %a) {
21 %0 = icmp sle i32 %a, 10
22 br i1 %0, label %less, label %exit
34 tracksRegLiveness: true
36 # CHECK-NEXT: - { id: 0, class: gr32, preferred-register: '' }
37 # CHECK-NEXT: - { id: 1, class: gr32, preferred-register: '' }
38 # CHECK-NEXT: - { id: 2, class: gr32, preferred-register: '' }
40 - { id: 0, class: gr32 }
41 - { id: 1, class: gr32 }
42 - { id: 2, class: gr32 }
45 successors: %bb.2.exit, %bb.1.less
47 ; CHECK: %0:gr32 = COPY $edi
48 ; CHECK-NEXT: %1:gr32 = SUB32ri8 %0, 10
50 %1 = SUB32ri8 %0, 10, implicit-def $eflags
51 JCC_1 %bb.2.exit, 15, implicit $eflags
55 ; CHECK: %2:gr32 = MOV32r0
56 ; CHECK-NEXT: $eax = COPY %2
57 %2 = MOV32r0 implicit-def $eflags
67 tracksRegLiveness: true
70 # CHECK-NEXT: - { id: 0, class: gr32, preferred-register: '' }
71 # CHECK-NEXT: - { id: 1, class: gr32, preferred-register: '' }
72 # CHECK-NEXT: - { id: 2, class: gr32, preferred-register: '' }
74 - { id: 2, class: gr32 }
75 - { id: 0, class: gr32 }
76 - { id: 10, class: gr32 }
79 successors: %bb.2.exit, %bb.1.less
81 ; CHECK: %0:gr32 = COPY $edi
82 ; CHECK-NEXT: %1:gr32 = SUB32ri8 %0, 10
84 %0 = SUB32ri8 %2, 10, implicit-def $eflags
85 JCC_1 %bb.2.exit, 15, implicit $eflags
89 ; CHECK: %2:gr32 = MOV32r0
90 ; CHECK-NEXT: $eax = COPY %2
91 %10 = MOV32r0 implicit-def $eflags
96 ; CHECK: $eax = COPY %0