1# RUN: llc -mtriple powerpc64le-unknown-linux-gnu -run-pass=ppc-early-ret -o \
2# RUN:   - %s -verify-machineinstrs | FileCheck %s
3
4---
5name:            testBLR
6body:             |
7  bb.0.entry:
8    successors: %bb.1(0x40000000), %bb.2(0x40000000)
9    liveins: $r3, $r4
10
11    renamable $cr0 = CMPWI renamable $r3, 0
12    BC killed renamable $cr0gt, %bb.1
13    B %bb.2
14
15  bb.1.entry:
16    successors: %bb.2(0x80000000)
17    liveins: $r4
18
19    renamable $r3 = ADDI killed renamable $r4, 0
20
21  bb.2.entry:
22    liveins: $r3, $r4, $cr0eq, $cr0lt, $cr0un, $cr0, $cr0gt, $r3, $r3, $r4, $r3, $cr0gt
23
24    BLR implicit $lr, implicit $rm, implicit killed $r3
25
26  ; CHECK-LABEL: name: testBLR
27  ; CHECK: bb.0.entry:
28  ; CHECK:   renamable $cr0 = CMPWI renamable $r3, 0
29  ; CHECK:   BC killed renamable $cr0gt, %bb.1
30  ; CHECK:   BLR implicit $lr, implicit $rm, implicit killed $r3
31  ; CHECK: bb.1.entry:
32  ; CHECK:   renamable $r3 = ADDI killed renamable $r4, 0
33  ; CHECK:   BLR implicit $lr, implicit $rm, implicit killed $r3
34...
35
36
37---
38name:            testBCLRn
39body:             |
40  bb.0.entry:
41    successors: %bb.3(0x20000000), %bb.1(0x60000000)
42    liveins: $f1, $f2, $f3, $f4, $v2, $v3
43
44    renamable $cr0 = FCMPUS killed renamable $f3, killed renamable $f4
45    BCn killed renamable $cr0eq, %bb.3
46
47  bb.1.entry:
48    successors: %bb.2(0x80000000)
49    liveins: $f1, $f2, $v2, $v3
50
51    renamable $cr0 = FCMPUS killed renamable $f1, killed renamable $f2
52    BCLR killed renamable $cr0eq, implicit $lr, implicit $rm, implicit killed $v2
53
54  bb.2:
55    successors: %bb.3(0x80000000)
56    liveins: $v3
57
58    $v2 = VOR killed $v3, $v3
59
60  bb.3:
61    liveins: $v2
62
63    BLR implicit $lr, implicit $rm, implicit killed $v2
64
65  ; CHECK-LABEL: name: testBCLRn
66  ; CHECK: bb.0.entry:
67  ; CHECK:   renamable $cr0 = FCMPUS killed renamable $f3, killed renamable $f4
68  ; CHECK:   BCLRn killed renamable $cr0eq, implicit $lr, implicit $rm, implicit killed $v2
69  ; CHECK: bb.1.entry:
70  ; CHECK:   renamable $cr0 = FCMPUS killed renamable $f1, killed renamable $f2
71  ; CHECK:   BCLR killed renamable $cr0eq, implicit $lr, implicit $rm, implicit killed $v2
72  ; CHECK: bb.2:
73  ; CHECK:   $v2 = VOR killed $v3, $v3
74  ; CHECK:   BLR implicit $lr, implicit $rm, implicit killed $v2
75...
76
77
78---
79name:            testBCLR
80body:             |
81  bb.0.entry:
82    successors: %bb.3(0x20000000), %bb.1(0x60000000)
83    liveins: $f1, $f2, $f3, $f4, $v2, $v3
84
85    renamable $cr0 = FCMPUS killed renamable $f3, killed renamable $f4
86    BC killed renamable $cr0eq, %bb.3
87
88  bb.1.entry:
89    successors: %bb.2(0x80000000)
90    liveins: $f1, $f2, $v2, $v3
91
92    renamable $cr0 = FCMPUS killed renamable $f1, killed renamable $f2
93    BCLRn killed renamable $cr0eq, implicit $lr, implicit $rm, implicit killed $v2
94
95  bb.2:
96    successors: %bb.3(0x80000000)
97    liveins: $v3
98
99    $v2 = VOR killed $v3, $v3
100
101  bb.3:
102    liveins: $v2
103
104    BLR implicit $lr, implicit $rm, implicit killed $v2
105
106  ; CHECK-LABEL: name: testBCLR
107  ; CHECK: bb.0.entry:
108  ; CHECK:   renamable $cr0 = FCMPUS killed renamable $f3, killed renamable $f4
109  ; CHECK:   BCLR killed renamable $cr0eq, implicit $lr, implicit $rm, implicit killed $v2
110  ; CHECK: bb.1.entry:
111  ; CHECK:   renamable $cr0 = FCMPUS killed renamable $f1, killed renamable $f2
112  ; CHECK:   BCLRn killed renamable $cr0eq, implicit $lr, implicit $rm, implicit killed $v2
113  ; CHECK: bb.2:
114  ; CHECK:   $v2 = VOR killed $v3, $v3
115  ; CHECK:   BLR implicit $lr, implicit $rm, implicit killed $v2
116...
117
118
119---
120name:            testBCCLR
121body:             |
122  bb.0.entry:
123    successors: %bb.2(0x40000000), %bb.1(0x40000000)
124
125    renamable $r4 = LI 0
126    renamable $cr0 = CMPLWI killed renamable $r4, 0
127    BCC 68, renamable $cr0, %bb.2
128
129  bb.1:
130    successors: %bb.2(0x40000000)
131    liveins: $cr0
132
133    BCC 68, killed renamable $cr0, %bb.2
134
135  bb.2:
136    BLR implicit $lr, implicit $rm
137
138  ; CHECK-LABEL: name: testBCCLR
139  ; CHECK: bb.0.entry:
140  ; CHECK:   renamable $r4 = LI 0
141  ; CHECK:   renamable $cr0 = CMPLWI killed renamable $r4, 0
142  ; CHECK:   BCCLR 68, renamable $cr0, implicit $lr, implicit $rm
143  ; CHECK: bb.1:
144  ; CHECK:   BCCLR 68, killed renamable $cr0, implicit $lr, implicit $rm
145  ; CHECK:   BLR implicit $lr, implicit $rm
146...
147