1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=xtensa -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=XTENSA %s
5 define i32 @jump(i1 %a) {
8 ; XTENSA-NEXT: and a8, a2, a8
9 ; XTENSA-NEXT: beqz a8, .LBB0_2
10 ; XTENSA-NEXT: # %bb.1: # %iftrue
12 ; XTENSA-NEXT: #NO_APP
14 ; XTENSA-NEXT: .space 1024
15 ; XTENSA-NEXT: #NO_APP
16 ; XTENSA-NEXT: movi a2, 1
18 ; XTENSA-NEXT: .LBB0_2: # %jmp
20 ; XTENSA-NEXT: #NO_APP
21 ; XTENSA-NEXT: movi a2, 1
23 br i1 %a, label %iftrue, label %jmp
26 call void asm sideeffect "", ""()
30 call void asm sideeffect "", ""()
34 call void asm sideeffect ".space 1024", ""()
41 define i32 @jx(i1 %a) {
43 ; XTENSA: addi a8, a1, -16
44 ; XTENSA-NEXT: or a1, a8, a8
45 ; XTENSA-NEXT: .cfi_def_cfa_offset 16
46 ; XTENSA-NEXT: movi a8, 1
47 ; XTENSA-NEXT: and a8, a2, a8
48 ; XTENSA-NEXT: bnez a8, .LBB1_1
49 ; XTENSA-NEXT: # %bb.4:
50 ; XTENSA-NEXT: l32r a8, .LCPI1_0
52 ; XTENSA-NEXT: .LBB1_1: # %iftrue
54 ; XTENSA-NEXT: #NO_APP
56 ; XTENSA-NEXT: .space 1048576
57 ; XTENSA-NEXT: #NO_APP
58 ; XTENSA-NEXT: j .LBB1_3
59 ; XTENSA-NEXT: .LBB1_2: # %jmp
61 ; XTENSA-NEXT: #NO_APP
62 ; XTENSA-NEXT: .LBB1_3: # %tail
63 ; XTENSA-NEXT: movi a2, 1
64 ; XTENSA-NEXT: addi a8, a1, 16
65 ; XTENSA-NEXT: or a1, a8, a8
67 br i1 %a, label %iftrue, label %jmp
70 call void asm sideeffect "", ""()
74 call void asm sideeffect "", ""()
78 call void asm sideeffect ".space 1048576", ""()
85 define void @relax_spill() {
86 ; XTENSA-LABEL: relax_spill:
87 ; XTENSA: addi a8, a1, -32
88 ; XTENSA-NEXT: or a1, a8, a8
89 ; XTENSA-NEXT: .cfi_def_cfa_offset 32
90 ; XTENSA-NEXT: s32i a12, a1, 16 # 4-byte Folded Spill
91 ; XTENSA-NEXT: s32i a13, a1, 12 # 4-byte Folded Spill
92 ; XTENSA-NEXT: s32i a14, a1, 8 # 4-byte Folded Spill
93 ; XTENSA-NEXT: s32i a15, a1, 4 # 4-byte Folded Spill
94 ; XTENSA-NEXT: .cfi_offset a12, -4
95 ; XTENSA-NEXT: .cfi_offset a13, -8
96 ; XTENSA-NEXT: .cfi_offset a14, -12
97 ; XTENSA-NEXT: .cfi_offset a15, -16
99 ; XTENSA-NEXT: #NO_APP
101 ; XTENSA-NEXT: addi a2, a3, 1
102 ; XTENSA-NEXT: #NO_APP
104 ; XTENSA-NEXT: addi a3, a3, 1
105 ; XTENSA-NEXT: #NO_APP
107 ; XTENSA-NEXT: addi a4, a3, 1
108 ; XTENSA-NEXT: #NO_APP
110 ; XTENSA-NEXT: addi a5, a3, 1
111 ; XTENSA-NEXT: #NO_APP
113 ; XTENSA-NEXT: addi a6, a3, 1
114 ; XTENSA-NEXT: #NO_APP
116 ; XTENSA-NEXT: addi a7, a3, 1
117 ; XTENSA-NEXT: #NO_APP
119 ; XTENSA-NEXT: addi a8, a3, 1
120 ; XTENSA-NEXT: #NO_APP
122 ; XTENSA-NEXT: addi a9, a3, 1
123 ; XTENSA-NEXT: #NO_APP
125 ; XTENSA-NEXT: addi a10, a3, 1
126 ; XTENSA-NEXT: #NO_APP
128 ; XTENSA-NEXT: addi a11, a3, 1
129 ; XTENSA-NEXT: #NO_APP
131 ; XTENSA-NEXT: addi a12, a3, 1
132 ; XTENSA-NEXT: #NO_APP
134 ; XTENSA-NEXT: addi a13, a3, 1
135 ; XTENSA-NEXT: #NO_APP
137 ; XTENSA-NEXT: addi a14, a3, 1
138 ; XTENSA-NEXT: #NO_APP
140 ; XTENSA-NEXT: addi a15, a3, 1
141 ; XTENSA-NEXT: #NO_APP
142 ; XTENSA-NEXT: beq a5, a6, .LBB2_1
143 ; XTENSA-NEXT: # %bb.3:
144 ; XTENSA-NEXT: s32i a12, a1, 0
145 ; XTENSA-NEXT: l32r a12, .LCPI2_0
146 ; XTENSA-NEXT: jx a12
147 ; XTENSA-NEXT: .LBB2_1: # %iftrue
149 ; XTENSA-NEXT: .space 536870912
150 ; XTENSA-NEXT: #NO_APP
151 ; XTENSA-NEXT: j .LBB2_2
152 ; XTENSA-NEXT: .LBB2_4: # %iffalse
153 ; XTENSA-NEXT: l32i a12, a1, 0
154 ; XTENSA-NEXT: .LBB2_2: # %iffalse
156 ; XTENSA-NEXT: #NO_APP
158 ; XTENSA-NEXT: # reg use a2
159 ; XTENSA-NEXT: #NO_APP
161 ; XTENSA-NEXT: # reg use a3
162 ; XTENSA-NEXT: #NO_APP
164 ; XTENSA-NEXT: # reg use a4
165 ; XTENSA-NEXT: #NO_APP
167 ; XTENSA-NEXT: # reg use a5
168 ; XTENSA-NEXT: #NO_APP
170 ; XTENSA-NEXT: # reg use a6
171 ; XTENSA-NEXT: #NO_APP
173 ; XTENSA-NEXT: # reg use a7
174 ; XTENSA-NEXT: #NO_APP
176 ; XTENSA-NEXT: # reg use a8
177 ; XTENSA-NEXT: #NO_APP
179 ; XTENSA-NEXT: # reg use a9
180 ; XTENSA-NEXT: #NO_APP
182 ; XTENSA-NEXT: # reg use a10
183 ; XTENSA-NEXT: #NO_APP
185 ; XTENSA-NEXT: # reg use a11
186 ; XTENSA-NEXT: #NO_APP
188 ; XTENSA-NEXT: # reg use a12
189 ; XTENSA-NEXT: #NO_APP
191 ; XTENSA-NEXT: # reg use a13
192 ; XTENSA-NEXT: #NO_APP
194 ; XTENSA-NEXT: # reg use a14
195 ; XTENSA-NEXT: #NO_APP
197 ; XTENSA-NEXT: # reg use a15
198 ; XTENSA-NEXT: #NO_APP
199 ; XTENSA-NEXT: l32i a15, a1, 4 # 4-byte Folded Reload
200 ; XTENSA-NEXT: l32i a14, a1, 8 # 4-byte Folded Reload
201 ; XTENSA-NEXT: l32i a13, a1, 12 # 4-byte Folded Reload
202 ; XTENSA-NEXT: l32i a12, a1, 16 # 4-byte Folded Reload
203 ; XTENSA-NEXT: addi a8, a1, 32
204 ; XTENSA-NEXT: or a1, a8, a8
206 call void asm sideeffect "", ""()
207 %a2 = call i32 asm sideeffect "addi a2, a3, 1", "={a2}"()
208 %a3 = call i32 asm sideeffect "addi a3, a3, 1", "={a3}"()
209 %a4 = call i32 asm sideeffect "addi a4, a3, 1", "={a4}"()
210 %a5 = call i32 asm sideeffect "addi a5, a3, 1", "={a5}"()
211 %a6 = call i32 asm sideeffect "addi a6, a3, 1", "={a6}"()
212 %a7 = call i32 asm sideeffect "addi a7, a3, 1", "={a7}"()
213 %a8 = call i32 asm sideeffect "addi a8, a3, 1", "={a8}"()
214 %a9 = call i32 asm sideeffect "addi a9, a3, 1", "={a9}"()
215 %a10 = call i32 asm sideeffect "addi a10, a3, 1", "={a10}"()
216 %a11 = call i32 asm sideeffect "addi a11, a3, 1", "={a11}"()
217 %a12 = call i32 asm sideeffect "addi a12, a3, 1", "={a12}"()
218 %a13 = call i32 asm sideeffect "addi a13, a3, 1", "={a13}"()
219 %a14 = call i32 asm sideeffect "addi a14, a3, 1", "={a14}"()
220 %a15 = call i32 asm sideeffect "addi a15, a3, 1", "={a15}"()
222 %cmp = icmp eq i32 %a5, %a6
223 br i1 %cmp, label %iftrue, label %iffalse
226 call void asm sideeffect ".space 536870912", ""()
230 call void asm sideeffect "", ""()
231 call void asm sideeffect "# reg use $0", "{a2}"(i32 %a2)
232 call void asm sideeffect "# reg use $0", "{a3}"(i32 %a3)
233 call void asm sideeffect "# reg use $0", "{a4}"(i32 %a4)
234 call void asm sideeffect "# reg use $0", "{a5}"(i32 %a5)
235 call void asm sideeffect "# reg use $0", "{a6}"(i32 %a6)
236 call void asm sideeffect "# reg use $0", "{a7}"(i32 %a7)
237 call void asm sideeffect "# reg use $0", "{a8}"(i32 %a8)
238 call void asm sideeffect "# reg use $0", "{a9}"(i32 %a9)
239 call void asm sideeffect "# reg use $0", "{a10}"(i32 %a10)
240 call void asm sideeffect "# reg use $0", "{a11}"(i32 %a11)
241 call void asm sideeffect "# reg use $0", "{a12}"(i32 %a12)
242 call void asm sideeffect "# reg use $0", "{a13}"(i32 %a13)
243 call void asm sideeffect "# reg use $0", "{a14}"(i32 %a14)
244 call void asm sideeffect "# reg use $0", "{a15}"(i32 %a15)