1 ; RUN: llc -mtriple=xtensa -disable-block-placement -verify-machineinstrs < %s \
4 define i32 @brcc_sgt(i32 %a, i32 %b) nounwind {
5 ; CHECK-LABEL: brcc_sgt:
6 ; CHECK: bge a3, a2, .LBB0_2
7 ; CHECK-NEXT: j .LBB0_1
8 ; CHECK-NEXT: .LBB0_1: # %t1
9 ; CHECK-NEXT: addi a2, a2, 4
10 ; CHECK-NEXT: j .LBB0_3
11 ; CHECK-NEXT: .LBB0_2: # %t2
12 ; CHECK-NEXT: addi a2, a3, 8
13 ; CHECK-NEXT: .LBB0_3: # %exit
15 %wb = icmp sgt i32 %a, %b
16 br i1 %wb, label %t1, label %t2
24 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
28 define i32 @brcc_ugt(i32 %a, i32 %b) nounwind {
29 ; CHECK-LABEL: brcc_ugt:
30 ; CHECK: bgeu a3, a2, .LBB1_2
31 ; CHECK-NEXT: j .LBB1_1
32 ; CHECK-NEXT: .LBB1_1: # %t1
33 ; CHECK-NEXT: addi a2, a2, 4
34 ; CHECK-NEXT: j .LBB1_3
35 ; CHECK-NEXT: .LBB1_2: # %t2
36 ; CHECK-NEXT: addi a2, a3, 8
37 ; CHECK-NEXT: .LBB1_3: # %exit
39 %wb = icmp ugt i32 %a, %b
40 br i1 %wb, label %t1, label %t2
48 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
52 define i32 @brcc_sle(i32 %a, i32 %b) nounwind {
53 ; CHECK-LABEL: brcc_sle:
54 ; CHECK: blt a3, a2, .LBB2_2
55 ; CHECK-NEXT: j .LBB2_1
56 ; CHECK-NEXT: .LBB2_1: # %t1
57 ; CHECK-NEXT: addi a2, a2, 4
58 ; CHECK-NEXT: j .LBB2_3
59 ; CHECK-NEXT: .LBB2_2: # %t2
60 ; CHECK-NEXT: addi a2, a3, 8
61 ; CHECK-NEXT: .LBB2_3: # %exit
63 %wb = icmp sle i32 %a, %b
64 br i1 %wb, label %t1, label %t2
72 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
76 define i32 @brcc_ule(i32 %a, i32 %b) nounwind {
77 ; CHECK-LABEL: brcc_ule:
78 ; CHECK: bltu a3, a2, .LBB3_2
79 ; CHECK-NEXT: j .LBB3_1
80 ; CHECK-NEXT: .LBB3_1: # %t1
81 ; CHECK-NEXT: addi a2, a2, 4
82 ; CHECK-NEXT: j .LBB3_3
83 ; CHECK-NEXT: .LBB3_2: # %t2
84 ; CHECK-NEXT: addi a2, a3, 8
85 ; CHECK-NEXT: .LBB3_3: # %exit
87 %wb = icmp ule i32 %a, %b
88 br i1 %wb, label %t1, label %t2
96 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
100 define i32 @brcc_eq(i32 %a, i32 %b) nounwind {
101 ; CHECK-LABEL: brcc_eq:
102 ; CHECK: bne a2, a3, .LBB4_2
103 ; CHECK-NEXT: j .LBB4_1
104 ; CHECK-NEXT: .LBB4_1: # %t1
105 ; CHECK-NEXT: addi a2, a2, 4
106 ; CHECK-NEXT: j .LBB4_3
107 ; CHECK-NEXT: .LBB4_2: # %t2
108 ; CHECK-NEXT: addi a2, a3, 8
109 ; CHECK-NEXT: .LBB4_3: # %exit
111 %wb = icmp eq i32 %a, %b
112 br i1 %wb, label %t1, label %t2
120 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
124 define i32 @brcc_ne(i32 %a, i32 %b) nounwind {
125 ; CHECK-LABEL: brcc_ne:
126 ; CHECK: beq a2, a3, .LBB5_2
127 ; CHECK-NEXT: j .LBB5_1
128 ; CHECK-NEXT: .LBB5_1: # %t1
129 ; CHECK-NEXT: addi a2, a2, 4
130 ; CHECK-NEXT: j .LBB5_3
131 ; CHECK-NEXT: .LBB5_2: # %t2
132 ; CHECK-NEXT: addi a2, a3, 8
133 ; CHECK-NEXT: .LBB5_3: # %exit
135 %wb = icmp ne i32 %a, %b
136 br i1 %wb, label %t1, label %t2
144 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
148 define i32 @brcc_ge(i32 %a, i32 %b) nounwind {
149 ; CHECK-LABEL: brcc_ge:
150 ; CHECK: blt a2, a3, .LBB6_2
151 ; CHECK-NEXT: j .LBB6_1
152 ; CHECK-NEXT: .LBB6_1: # %t1
153 ; CHECK-NEXT: addi a2, a2, 4
154 ; CHECK-NEXT: j .LBB6_3
155 ; CHECK-NEXT: .LBB6_2: # %t2
156 ; CHECK-NEXT: addi a2, a3, 8
157 ; CHECK-NEXT: .LBB6_3: # %exit
159 %wb = icmp sge i32 %a, %b
160 br i1 %wb, label %t1, label %t2
168 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
172 define i32 @brcc_lt(i32 %a, i32 %b) nounwind {
173 ; CHECK-LABEL: brcc_lt:
174 ; CHECK: bge a2, a3, .LBB7_2
175 ; CHECK-NEXT: j .LBB7_1
176 ; CHECK-NEXT: .LBB7_1: # %t1
177 ; CHECK-NEXT: addi a2, a2, 4
178 ; CHECK-NEXT: j .LBB7_3
179 ; CHECK-NEXT: .LBB7_2: # %t2
180 ; CHECK-NEXT: addi a2, a3, 8
181 ; CHECK-NEXT: .LBB7_3: # %exit
183 %wb = icmp slt i32 %a, %b
184 br i1 %wb, label %t1, label %t2
192 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
196 define i32 @brcc_uge(i32 %a, i32 %b) nounwind {
197 ; CHECK-LABEL: brcc_uge:
198 ; CHECK: bltu a2, a3, .LBB8_2
199 ; CHECK-NEXT: j .LBB8_1
200 ; CHECK-NEXT: .LBB8_1: # %t1
201 ; CHECK-NEXT: addi a2, a2, 4
202 ; CHECK-NEXT: j .LBB8_3
203 ; CHECK-NEXT: .LBB8_2: # %t2
204 ; CHECK-NEXT: addi a2, a3, 8
205 ; CHECK-NEXT: .LBB8_3: # %exit
207 %wb = icmp uge i32 %a, %b
208 br i1 %wb, label %t1, label %t2
216 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]
220 define i32 @brcc_ult(i32 %a, i32 %b) nounwind {
221 ; CHECK-LABEL: brcc_ult:
222 ; CHECK: bgeu a2, a3, .LBB9_2
223 ; CHECK-NEXT: j .LBB9_1
224 ; CHECK-NEXT: .LBB9_1: # %t1
225 ; CHECK-NEXT: addi a2, a2, 4
226 ; CHECK-NEXT: j .LBB9_3
227 ; CHECK-NEXT: .LBB9_2: # %t2
228 ; CHECK-NEXT: addi a2, a3, 8
229 ; CHECK-NEXT: .LBB9_3: # %exit
231 %wb = icmp ult i32 %a, %b
232 br i1 %wb, label %t1, label %t2
240 %v = phi i32 [ %t1v, %t1 ], [ %t2v, %t2 ]