1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs -no-integrated-as < %s \
3 ; RUN: | FileCheck -check-prefixes=RV32I %s
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs -no-integrated-as < %s \
5 ; RUN: | FileCheck -check-prefixes=RV64I %s
6 ; RUN: llc -mtriple=riscv32 -code-model=medium -verify-machineinstrs -no-integrated-as < %s \
7 ; RUN: | FileCheck -check-prefixes=RV32I-MEDIUM %s
8 ; RUN: llc -mtriple=riscv64 -code-model=medium -verify-machineinstrs -no-integrated-as < %s \
9 ; RUN: | FileCheck -check-prefixes=RV64I-MEDIUM %s
11 @eg = external global [4000 x i32], align 4
12 @ewg = extern_weak global [4000 x i32], align 4
14 define void @constraint_m_1(ptr %a) nounwind {
15 ; RV32I-LABEL: constraint_m_1:
21 ; RV64I-LABEL: constraint_m_1:
27 ; RV32I-MEDIUM-LABEL: constraint_m_1:
28 ; RV32I-MEDIUM: # %bb.0:
29 ; RV32I-MEDIUM-NEXT: #APP
30 ; RV32I-MEDIUM-NEXT: #NO_APP
31 ; RV32I-MEDIUM-NEXT: ret
33 ; RV64I-MEDIUM-LABEL: constraint_m_1:
34 ; RV64I-MEDIUM: # %bb.0:
35 ; RV64I-MEDIUM-NEXT: #APP
36 ; RV64I-MEDIUM-NEXT: #NO_APP
37 ; RV64I-MEDIUM-NEXT: ret
38 call void asm sideeffect "", "=*m"(ptr elementtype(i32) %a)
42 define i32 @constraint_m_2(ptr %a) nounwind {
43 ; RV32I-LABEL: constraint_m_2:
46 ; RV32I-NEXT: lw a0, 0(a0)
50 ; RV64I-LABEL: constraint_m_2:
53 ; RV64I-NEXT: lw a0, 0(a0)
57 ; RV32I-MEDIUM-LABEL: constraint_m_2:
58 ; RV32I-MEDIUM: # %bb.0:
59 ; RV32I-MEDIUM-NEXT: #APP
60 ; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
61 ; RV32I-MEDIUM-NEXT: #NO_APP
62 ; RV32I-MEDIUM-NEXT: ret
64 ; RV64I-MEDIUM-LABEL: constraint_m_2:
65 ; RV64I-MEDIUM: # %bb.0:
66 ; RV64I-MEDIUM-NEXT: #APP
67 ; RV64I-MEDIUM-NEXT: lw a0, 0(a0)
68 ; RV64I-MEDIUM-NEXT: #NO_APP
69 ; RV64I-MEDIUM-NEXT: ret
70 %1 = tail call i32 asm "lw $0, $1", "=r,*m"(ptr elementtype(i32) %a)
74 define i32 @constraint_m_with_offset(ptr %a) nounwind {
75 ; RV32I-LABEL: constraint_m_with_offset:
78 ; RV32I-NEXT: lw a0, 4(a0)
82 ; RV64I-LABEL: constraint_m_with_offset:
85 ; RV64I-NEXT: lw a0, 4(a0)
89 ; RV32I-MEDIUM-LABEL: constraint_m_with_offset:
90 ; RV32I-MEDIUM: # %bb.0:
91 ; RV32I-MEDIUM-NEXT: #APP
92 ; RV32I-MEDIUM-NEXT: lw a0, 4(a0)
93 ; RV32I-MEDIUM-NEXT: #NO_APP
94 ; RV32I-MEDIUM-NEXT: ret
96 ; RV64I-MEDIUM-LABEL: constraint_m_with_offset:
97 ; RV64I-MEDIUM: # %bb.0:
98 ; RV64I-MEDIUM-NEXT: #APP
99 ; RV64I-MEDIUM-NEXT: lw a0, 4(a0)
100 ; RV64I-MEDIUM-NEXT: #NO_APP
101 ; RV64I-MEDIUM-NEXT: ret
102 %1 = getelementptr i32, ptr %a, i32 1
103 %2 = tail call i32 asm "lw $0, $1", "=r,*m"(ptr elementtype(i32) %1)
107 define void @constraint_m_with_global_1() nounwind {
108 ; RV32I-LABEL: constraint_m_with_global_1:
110 ; RV32I-NEXT: lui a0, %hi(eg)
112 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
113 ; RV32I-NEXT: #NO_APP
116 ; RV64I-LABEL: constraint_m_with_global_1:
118 ; RV64I-NEXT: lui a0, %hi(eg)
120 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
121 ; RV64I-NEXT: #NO_APP
124 ; RV32I-MEDIUM-LABEL: constraint_m_with_global_1:
125 ; RV32I-MEDIUM: # %bb.0:
126 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi0:
127 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
128 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi0)
129 ; RV32I-MEDIUM-NEXT: #APP
130 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
131 ; RV32I-MEDIUM-NEXT: #NO_APP
132 ; RV32I-MEDIUM-NEXT: ret
134 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_1:
135 ; RV64I-MEDIUM: # %bb.0:
136 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi0:
137 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
138 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi0)
139 ; RV64I-MEDIUM-NEXT: #APP
140 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
141 ; RV64I-MEDIUM-NEXT: #NO_APP
142 ; RV64I-MEDIUM-NEXT: ret
143 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
147 define void @constraint_m_with_global_2() nounwind {
148 ; RV32I-LABEL: constraint_m_with_global_2:
150 ; RV32I-NEXT: lui a0, %hi(eg)
151 ; RV32I-NEXT: addi a0, a0, %lo(eg)
153 ; RV32I-NEXT: sw zero, 4(a0)
154 ; RV32I-NEXT: #NO_APP
157 ; RV64I-LABEL: constraint_m_with_global_2:
159 ; RV64I-NEXT: lui a0, %hi(eg)
160 ; RV64I-NEXT: addi a0, a0, %lo(eg)
162 ; RV64I-NEXT: sw zero, 4(a0)
163 ; RV64I-NEXT: #NO_APP
166 ; RV32I-MEDIUM-LABEL: constraint_m_with_global_2:
167 ; RV32I-MEDIUM: # %bb.0:
168 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi1:
169 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
170 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi1)
171 ; RV32I-MEDIUM-NEXT: #APP
172 ; RV32I-MEDIUM-NEXT: sw zero, 4(a0)
173 ; RV32I-MEDIUM-NEXT: #NO_APP
174 ; RV32I-MEDIUM-NEXT: ret
176 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_2:
177 ; RV64I-MEDIUM: # %bb.0:
178 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi1:
179 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
180 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi1)
181 ; RV64I-MEDIUM-NEXT: #APP
182 ; RV64I-MEDIUM-NEXT: sw zero, 4(a0)
183 ; RV64I-MEDIUM-NEXT: #NO_APP
184 ; RV64I-MEDIUM-NEXT: ret
185 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
189 define void @constraint_m_with_global_3() nounwind {
190 ; RV32I-LABEL: constraint_m_with_global_3:
192 ; RV32I-NEXT: lui a0, %hi(eg+8000)
193 ; RV32I-NEXT: addi a0, a0, %lo(eg+8000)
195 ; RV32I-NEXT: sw zero, 0(a0)
196 ; RV32I-NEXT: #NO_APP
199 ; RV64I-LABEL: constraint_m_with_global_3:
201 ; RV64I-NEXT: lui a0, %hi(eg+8000)
202 ; RV64I-NEXT: addi a0, a0, %lo(eg+8000)
204 ; RV64I-NEXT: sw zero, 0(a0)
205 ; RV64I-NEXT: #NO_APP
208 ; RV32I-MEDIUM-LABEL: constraint_m_with_global_3:
209 ; RV32I-MEDIUM: # %bb.0:
210 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi2:
211 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
212 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi2)
213 ; RV32I-MEDIUM-NEXT: #APP
214 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
215 ; RV32I-MEDIUM-NEXT: #NO_APP
216 ; RV32I-MEDIUM-NEXT: ret
218 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_3:
219 ; RV64I-MEDIUM: # %bb.0:
220 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi2:
221 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
222 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi2)
223 ; RV64I-MEDIUM-NEXT: #APP
224 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
225 ; RV64I-MEDIUM-NEXT: #NO_APP
226 ; RV64I-MEDIUM-NEXT: ret
227 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 2000))
231 define void @constraint_m_with_extern_weak_global_1() nounwind {
232 ; RV32I-LABEL: constraint_m_with_extern_weak_global_1:
234 ; RV32I-NEXT: lui a0, %hi(ewg)
236 ; RV32I-NEXT: sw zero, %lo(ewg)(a0)
237 ; RV32I-NEXT: #NO_APP
240 ; RV64I-LABEL: constraint_m_with_extern_weak_global_1:
242 ; RV64I-NEXT: lui a0, %hi(ewg)
244 ; RV64I-NEXT: sw zero, %lo(ewg)(a0)
245 ; RV64I-NEXT: #NO_APP
248 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_1:
249 ; RV32I-MEDIUM: # %bb.0:
250 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi3:
251 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
252 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi3)(a0)
253 ; RV32I-MEDIUM-NEXT: #APP
254 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
255 ; RV32I-MEDIUM-NEXT: #NO_APP
256 ; RV32I-MEDIUM-NEXT: ret
258 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_1:
259 ; RV64I-MEDIUM: # %bb.0:
260 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi3:
261 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
262 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi3)(a0)
263 ; RV64I-MEDIUM-NEXT: #APP
264 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
265 ; RV64I-MEDIUM-NEXT: #NO_APP
266 ; RV64I-MEDIUM-NEXT: ret
267 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @ewg)
271 define void @constraint_m_with_extern_weak_global_2() nounwind {
272 ; RV32I-LABEL: constraint_m_with_extern_weak_global_2:
274 ; RV32I-NEXT: lui a0, %hi(ewg)
275 ; RV32I-NEXT: addi a0, a0, %lo(ewg)
277 ; RV32I-NEXT: sw zero, 4(a0)
278 ; RV32I-NEXT: #NO_APP
281 ; RV64I-LABEL: constraint_m_with_extern_weak_global_2:
283 ; RV64I-NEXT: lui a0, %hi(ewg)
284 ; RV64I-NEXT: addi a0, a0, %lo(ewg)
286 ; RV64I-NEXT: sw zero, 4(a0)
287 ; RV64I-NEXT: #NO_APP
290 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_2:
291 ; RV32I-MEDIUM: # %bb.0:
292 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi4:
293 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
294 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi4)(a0)
295 ; RV32I-MEDIUM-NEXT: #APP
296 ; RV32I-MEDIUM-NEXT: sw zero, 4(a0)
297 ; RV32I-MEDIUM-NEXT: #NO_APP
298 ; RV32I-MEDIUM-NEXT: ret
300 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_2:
301 ; RV64I-MEDIUM: # %bb.0:
302 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi4:
303 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
304 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi4)(a0)
305 ; RV64I-MEDIUM-NEXT: #APP
306 ; RV64I-MEDIUM-NEXT: sw zero, 4(a0)
307 ; RV64I-MEDIUM-NEXT: #NO_APP
308 ; RV64I-MEDIUM-NEXT: ret
309 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
313 define void @constraint_m_with_extern_weak_global_3() nounwind {
314 ; RV32I-LABEL: constraint_m_with_extern_weak_global_3:
316 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
317 ; RV32I-NEXT: addi a0, a0, %lo(ewg+8000)
319 ; RV32I-NEXT: sw zero, 0(a0)
320 ; RV32I-NEXT: #NO_APP
323 ; RV64I-LABEL: constraint_m_with_extern_weak_global_3:
325 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
326 ; RV64I-NEXT: addi a0, a0, %lo(ewg+8000)
328 ; RV64I-NEXT: sw zero, 0(a0)
329 ; RV64I-NEXT: #NO_APP
332 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_3:
333 ; RV32I-MEDIUM: # %bb.0:
334 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi5:
335 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
336 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi5)(a0)
337 ; RV32I-MEDIUM-NEXT: lui a1, 2
338 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
339 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
340 ; RV32I-MEDIUM-NEXT: #APP
341 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
342 ; RV32I-MEDIUM-NEXT: #NO_APP
343 ; RV32I-MEDIUM-NEXT: ret
345 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_3:
346 ; RV64I-MEDIUM: # %bb.0:
347 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi5:
348 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
349 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi5)(a0)
350 ; RV64I-MEDIUM-NEXT: lui a1, 2
351 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
352 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
353 ; RV64I-MEDIUM-NEXT: #APP
354 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
355 ; RV64I-MEDIUM-NEXT: #NO_APP
356 ; RV64I-MEDIUM-NEXT: ret
357 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
361 define void @constraint_m_with_local_1() nounwind {
362 ; RV32I-LABEL: constraint_m_with_local_1:
363 ; RV32I: # %bb.0: # %entry
364 ; RV32I-NEXT: .Ltmp0: # Block address taken
365 ; RV32I-NEXT: # %bb.1: # %label
366 ; RV32I-NEXT: lui a0, %hi(.Ltmp0)
368 ; RV32I-NEXT: lw zero, %lo(.Ltmp0)(a0)
369 ; RV32I-NEXT: #NO_APP
372 ; RV64I-LABEL: constraint_m_with_local_1:
373 ; RV64I: # %bb.0: # %entry
374 ; RV64I-NEXT: .Ltmp0: # Block address taken
375 ; RV64I-NEXT: # %bb.1: # %label
376 ; RV64I-NEXT: lui a0, %hi(.Ltmp0)
378 ; RV64I-NEXT: lw zero, %lo(.Ltmp0)(a0)
379 ; RV64I-NEXT: #NO_APP
382 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_1:
383 ; RV32I-MEDIUM: # %bb.0: # %entry
384 ; RV32I-MEDIUM-NEXT: .Ltmp0: # Block address taken
385 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
386 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi6:
387 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp0)
388 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi6)
389 ; RV32I-MEDIUM-NEXT: #APP
390 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
391 ; RV32I-MEDIUM-NEXT: #NO_APP
392 ; RV32I-MEDIUM-NEXT: ret
394 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_1:
395 ; RV64I-MEDIUM: # %bb.0: # %entry
396 ; RV64I-MEDIUM-NEXT: .Ltmp0: # Block address taken
397 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
398 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi6:
399 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp0)
400 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi6)
401 ; RV64I-MEDIUM-NEXT: #APP
402 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
403 ; RV64I-MEDIUM-NEXT: #NO_APP
404 ; RV64I-MEDIUM-NEXT: ret
409 tail call void asm sideeffect "lw zero, $0", "*m"(ptr elementtype(ptr) blockaddress(@constraint_m_with_local_1, %label))
413 define void @constraint_m_with_local_2() nounwind {
414 ; RV32I-LABEL: constraint_m_with_local_2:
415 ; RV32I: # %bb.0: # %entry
416 ; RV32I-NEXT: .Ltmp1: # Block address taken
417 ; RV32I-NEXT: # %bb.1: # %label
418 ; RV32I-NEXT: lui a0, %hi(.Ltmp1)
419 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp1)
421 ; RV32I-NEXT: lw zero, 4(a0)
422 ; RV32I-NEXT: #NO_APP
425 ; RV64I-LABEL: constraint_m_with_local_2:
426 ; RV64I: # %bb.0: # %entry
427 ; RV64I-NEXT: .Ltmp1: # Block address taken
428 ; RV64I-NEXT: # %bb.1: # %label
429 ; RV64I-NEXT: lui a0, %hi(.Ltmp1)
430 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp1)
432 ; RV64I-NEXT: lw zero, 4(a0)
433 ; RV64I-NEXT: #NO_APP
436 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_2:
437 ; RV32I-MEDIUM: # %bb.0: # %entry
438 ; RV32I-MEDIUM-NEXT: .Ltmp1: # Block address taken
439 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
440 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi7:
441 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp1)
442 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi7)
443 ; RV32I-MEDIUM-NEXT: #APP
444 ; RV32I-MEDIUM-NEXT: lw zero, 4(a0)
445 ; RV32I-MEDIUM-NEXT: #NO_APP
446 ; RV32I-MEDIUM-NEXT: ret
448 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_2:
449 ; RV64I-MEDIUM: # %bb.0: # %entry
450 ; RV64I-MEDIUM-NEXT: .Ltmp1: # Block address taken
451 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
452 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi7:
453 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp1)
454 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi7)
455 ; RV64I-MEDIUM-NEXT: #APP
456 ; RV64I-MEDIUM-NEXT: lw zero, 4(a0)
457 ; RV64I-MEDIUM-NEXT: #NO_APP
458 ; RV64I-MEDIUM-NEXT: ret
463 call void asm "lw zero, $0", "*m"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_m_with_local_2, %label), i32 4))
467 define void @constraint_m_with_local_3() nounwind {
468 ; RV32I-LABEL: constraint_m_with_local_3:
469 ; RV32I: # %bb.0: # %entry
470 ; RV32I-NEXT: .Ltmp2: # Block address taken
471 ; RV32I-NEXT: # %bb.1: # %label
472 ; RV32I-NEXT: lui a0, %hi(.Ltmp2)
473 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp2)
475 ; RV32I-NEXT: lw zero, 2000(a0)
476 ; RV32I-NEXT: #NO_APP
479 ; RV64I-LABEL: constraint_m_with_local_3:
480 ; RV64I: # %bb.0: # %entry
481 ; RV64I-NEXT: .Ltmp2: # Block address taken
482 ; RV64I-NEXT: # %bb.1: # %label
483 ; RV64I-NEXT: lui a0, %hi(.Ltmp2)
484 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp2)
486 ; RV64I-NEXT: lw zero, 2000(a0)
487 ; RV64I-NEXT: #NO_APP
490 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_3:
491 ; RV32I-MEDIUM: # %bb.0: # %entry
492 ; RV32I-MEDIUM-NEXT: .Ltmp2: # Block address taken
493 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
494 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi8:
495 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp2)
496 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi8)
497 ; RV32I-MEDIUM-NEXT: #APP
498 ; RV32I-MEDIUM-NEXT: lw zero, 2000(a0)
499 ; RV32I-MEDIUM-NEXT: #NO_APP
500 ; RV32I-MEDIUM-NEXT: ret
502 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_3:
503 ; RV64I-MEDIUM: # %bb.0: # %entry
504 ; RV64I-MEDIUM-NEXT: .Ltmp2: # Block address taken
505 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
506 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi8:
507 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp2)
508 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi8)
509 ; RV64I-MEDIUM-NEXT: #APP
510 ; RV64I-MEDIUM-NEXT: lw zero, 2000(a0)
511 ; RV64I-MEDIUM-NEXT: #NO_APP
512 ; RV64I-MEDIUM-NEXT: ret
517 call void asm "lw zero, $0", "*m"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_m_with_local_3, %label), i32 2000))
521 define void @constraint_m_with_multi_operands() nounwind {
522 ; RV32I-LABEL: constraint_m_with_multi_operands:
524 ; RV32I-NEXT: lui a0, %hi(eg)
526 ; RV32I-NEXT: sw zero, %lo(eg)(a0); sw zero, %lo(eg)(a0)
527 ; RV32I-NEXT: #NO_APP
530 ; RV64I-LABEL: constraint_m_with_multi_operands:
532 ; RV64I-NEXT: lui a0, %hi(eg)
534 ; RV64I-NEXT: sw zero, %lo(eg)(a0); sw zero, %lo(eg)(a0)
535 ; RV64I-NEXT: #NO_APP
538 ; RV32I-MEDIUM-LABEL: constraint_m_with_multi_operands:
539 ; RV32I-MEDIUM: # %bb.0:
540 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi9:
541 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
542 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi9)
543 ; RV32I-MEDIUM-NEXT: #APP
544 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0); sw zero, 0(a0)
545 ; RV32I-MEDIUM-NEXT: #NO_APP
546 ; RV32I-MEDIUM-NEXT: ret
548 ; RV64I-MEDIUM-LABEL: constraint_m_with_multi_operands:
549 ; RV64I-MEDIUM: # %bb.0:
550 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi9:
551 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
552 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi9)
553 ; RV64I-MEDIUM-NEXT: #APP
554 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0); sw zero, 0(a0)
555 ; RV64I-MEDIUM-NEXT: #NO_APP
556 ; RV64I-MEDIUM-NEXT: ret
557 call void asm "sw zero, $0; sw zero, $1", "=*m,=*m"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
561 define void @constraint_m_with_multi_asm() nounwind {
562 ; RV32I-LABEL: constraint_m_with_multi_asm:
564 ; RV32I-NEXT: lui a0, %hi(eg)
566 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
567 ; RV32I-NEXT: #NO_APP
569 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
570 ; RV32I-NEXT: #NO_APP
573 ; RV64I-LABEL: constraint_m_with_multi_asm:
575 ; RV64I-NEXT: lui a0, %hi(eg)
577 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
578 ; RV64I-NEXT: #NO_APP
580 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
581 ; RV64I-NEXT: #NO_APP
584 ; RV32I-MEDIUM-LABEL: constraint_m_with_multi_asm:
585 ; RV32I-MEDIUM: # %bb.0:
586 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi10:
587 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
588 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi10)
589 ; RV32I-MEDIUM-NEXT: #APP
590 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
591 ; RV32I-MEDIUM-NEXT: #NO_APP
592 ; RV32I-MEDIUM-NEXT: #APP
593 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
594 ; RV32I-MEDIUM-NEXT: #NO_APP
595 ; RV32I-MEDIUM-NEXT: ret
597 ; RV64I-MEDIUM-LABEL: constraint_m_with_multi_asm:
598 ; RV64I-MEDIUM: # %bb.0:
599 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi10:
600 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
601 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi10)
602 ; RV64I-MEDIUM-NEXT: #APP
603 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
604 ; RV64I-MEDIUM-NEXT: #NO_APP
605 ; RV64I-MEDIUM-NEXT: #APP
606 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
607 ; RV64I-MEDIUM-NEXT: #NO_APP
608 ; RV64I-MEDIUM-NEXT: ret
609 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
610 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
614 define i32 @constraint_m_with_callbr_multi_operands(i32 %a) {
615 ; RV32I-LABEL: constraint_m_with_callbr_multi_operands:
616 ; RV32I: # %bb.0: # %entry
617 ; RV32I-NEXT: lui a1, %hi(eg)
619 ; RV32I-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB14_2
620 ; RV32I-NEXT: #NO_APP
621 ; RV32I-NEXT: # %bb.1: # %normal
622 ; RV32I-NEXT: li a0, 0
624 ; RV32I-NEXT: .LBB14_2: # Block address taken
625 ; RV32I-NEXT: # %fail
626 ; RV32I-NEXT: # Label of block must be emitted
627 ; RV32I-NEXT: li a0, 1
630 ; RV64I-LABEL: constraint_m_with_callbr_multi_operands:
631 ; RV64I: # %bb.0: # %entry
632 ; RV64I-NEXT: lui a1, %hi(eg)
634 ; RV64I-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB14_2
635 ; RV64I-NEXT: #NO_APP
636 ; RV64I-NEXT: # %bb.1: # %normal
637 ; RV64I-NEXT: li a0, 0
639 ; RV64I-NEXT: .LBB14_2: # Block address taken
640 ; RV64I-NEXT: # %fail
641 ; RV64I-NEXT: # Label of block must be emitted
642 ; RV64I-NEXT: li a0, 1
645 ; RV32I-MEDIUM-LABEL: constraint_m_with_callbr_multi_operands:
646 ; RV32I-MEDIUM: # %bb.0: # %entry
647 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi11:
648 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
649 ; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi11)
650 ; RV32I-MEDIUM-NEXT: #APP
651 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB14_2
652 ; RV32I-MEDIUM-NEXT: #NO_APP
653 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal
654 ; RV32I-MEDIUM-NEXT: li a0, 0
655 ; RV32I-MEDIUM-NEXT: ret
656 ; RV32I-MEDIUM-NEXT: .LBB14_2: # Block address taken
657 ; RV32I-MEDIUM-NEXT: # %fail
658 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
659 ; RV32I-MEDIUM-NEXT: li a0, 1
660 ; RV32I-MEDIUM-NEXT: ret
662 ; RV64I-MEDIUM-LABEL: constraint_m_with_callbr_multi_operands:
663 ; RV64I-MEDIUM: # %bb.0: # %entry
664 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi11:
665 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
666 ; RV64I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi11)
667 ; RV64I-MEDIUM-NEXT: #APP
668 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB14_2
669 ; RV64I-MEDIUM-NEXT: #NO_APP
670 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal
671 ; RV64I-MEDIUM-NEXT: li a0, 0
672 ; RV64I-MEDIUM-NEXT: ret
673 ; RV64I-MEDIUM-NEXT: .LBB14_2: # Block address taken
674 ; RV64I-MEDIUM-NEXT: # %fail
675 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
676 ; RV64I-MEDIUM-NEXT: li a0, 1
677 ; RV64I-MEDIUM-NEXT: ret
679 callbr void asm "sw zero, $0; sw zero, $1; beqz $2, $3", "=*m,=*m,r,!i"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg, i32 %a) to label %normal [label %fail]
688 define i32 @constraint_m_with_multi_callbr_asm(i32 %a) {
689 ; RV32I-LABEL: constraint_m_with_multi_callbr_asm:
690 ; RV32I: # %bb.0: # %entry
691 ; RV32I-NEXT: lui a1, %hi(eg)
693 ; RV32I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
694 ; RV32I-NEXT: #NO_APP
695 ; RV32I-NEXT: # %bb.1: # %normal0
697 ; RV32I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
698 ; RV32I-NEXT: #NO_APP
699 ; RV32I-NEXT: # %bb.2: # %normal1
700 ; RV32I-NEXT: li a0, 0
702 ; RV32I-NEXT: .LBB15_3: # Block address taken
703 ; RV32I-NEXT: # %fail
704 ; RV32I-NEXT: # Label of block must be emitted
705 ; RV32I-NEXT: li a0, 1
708 ; RV64I-LABEL: constraint_m_with_multi_callbr_asm:
709 ; RV64I: # %bb.0: # %entry
710 ; RV64I-NEXT: lui a1, %hi(eg)
712 ; RV64I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
713 ; RV64I-NEXT: #NO_APP
714 ; RV64I-NEXT: # %bb.1: # %normal0
716 ; RV64I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
717 ; RV64I-NEXT: #NO_APP
718 ; RV64I-NEXT: # %bb.2: # %normal1
719 ; RV64I-NEXT: li a0, 0
721 ; RV64I-NEXT: .LBB15_3: # Block address taken
722 ; RV64I-NEXT: # %fail
723 ; RV64I-NEXT: # Label of block must be emitted
724 ; RV64I-NEXT: li a0, 1
727 ; RV32I-MEDIUM-LABEL: constraint_m_with_multi_callbr_asm:
728 ; RV32I-MEDIUM: # %bb.0: # %entry
729 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi12:
730 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
731 ; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi12)
732 ; RV32I-MEDIUM-NEXT: #APP
733 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB15_3
734 ; RV32I-MEDIUM-NEXT: #NO_APP
735 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal0
736 ; RV32I-MEDIUM-NEXT: #APP
737 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB15_3
738 ; RV32I-MEDIUM-NEXT: #NO_APP
739 ; RV32I-MEDIUM-NEXT: # %bb.2: # %normal1
740 ; RV32I-MEDIUM-NEXT: li a0, 0
741 ; RV32I-MEDIUM-NEXT: ret
742 ; RV32I-MEDIUM-NEXT: .LBB15_3: # Block address taken
743 ; RV32I-MEDIUM-NEXT: # %fail
744 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
745 ; RV32I-MEDIUM-NEXT: li a0, 1
746 ; RV32I-MEDIUM-NEXT: ret
748 ; RV64I-MEDIUM-LABEL: constraint_m_with_multi_callbr_asm:
749 ; RV64I-MEDIUM: # %bb.0: # %entry
750 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi12:
751 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
752 ; RV64I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi12)
753 ; RV64I-MEDIUM-NEXT: #APP
754 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB15_3
755 ; RV64I-MEDIUM-NEXT: #NO_APP
756 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal0
757 ; RV64I-MEDIUM-NEXT: #APP
758 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB15_3
759 ; RV64I-MEDIUM-NEXT: #NO_APP
760 ; RV64I-MEDIUM-NEXT: # %bb.2: # %normal1
761 ; RV64I-MEDIUM-NEXT: li a0, 0
762 ; RV64I-MEDIUM-NEXT: ret
763 ; RV64I-MEDIUM-NEXT: .LBB15_3: # Block address taken
764 ; RV64I-MEDIUM-NEXT: # %fail
765 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
766 ; RV64I-MEDIUM-NEXT: li a0, 1
767 ; RV64I-MEDIUM-NEXT: ret
769 callbr void asm "sw zero, $0; beqz $1, $2", "=*m,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
772 callbr void asm "sw zero, $0; beqz $1, $2", "=*m,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
781 define void @constraint_o_1(ptr %a) nounwind {
782 ; RV32I-LABEL: constraint_o_1:
785 ; RV32I-NEXT: #NO_APP
788 ; RV64I-LABEL: constraint_o_1:
791 ; RV64I-NEXT: #NO_APP
794 ; RV32I-MEDIUM-LABEL: constraint_o_1:
795 ; RV32I-MEDIUM: # %bb.0:
796 ; RV32I-MEDIUM-NEXT: #APP
797 ; RV32I-MEDIUM-NEXT: #NO_APP
798 ; RV32I-MEDIUM-NEXT: ret
800 ; RV64I-MEDIUM-LABEL: constraint_o_1:
801 ; RV64I-MEDIUM: # %bb.0:
802 ; RV64I-MEDIUM-NEXT: #APP
803 ; RV64I-MEDIUM-NEXT: #NO_APP
804 ; RV64I-MEDIUM-NEXT: ret
805 call void asm sideeffect "", "=*o"(ptr elementtype(i32) %a)
809 define i32 @constraint_o_2(ptr %a) nounwind {
810 ; RV32I-LABEL: constraint_o_2:
813 ; RV32I-NEXT: lw a0, 0(a0)
814 ; RV32I-NEXT: #NO_APP
817 ; RV64I-LABEL: constraint_o_2:
820 ; RV64I-NEXT: lw a0, 0(a0)
821 ; RV64I-NEXT: #NO_APP
824 ; RV32I-MEDIUM-LABEL: constraint_o_2:
825 ; RV32I-MEDIUM: # %bb.0:
826 ; RV32I-MEDIUM-NEXT: #APP
827 ; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
828 ; RV32I-MEDIUM-NEXT: #NO_APP
829 ; RV32I-MEDIUM-NEXT: ret
831 ; RV64I-MEDIUM-LABEL: constraint_o_2:
832 ; RV64I-MEDIUM: # %bb.0:
833 ; RV64I-MEDIUM-NEXT: #APP
834 ; RV64I-MEDIUM-NEXT: lw a0, 0(a0)
835 ; RV64I-MEDIUM-NEXT: #NO_APP
836 ; RV64I-MEDIUM-NEXT: ret
837 %1 = tail call i32 asm "lw $0, $1", "=r,*o"(ptr elementtype(i32) %a)
841 define i32 @constraint_o_with_offset(ptr %a) nounwind {
842 ; RV32I-LABEL: constraint_o_with_offset:
845 ; RV32I-NEXT: lw a0, 4(a0)
846 ; RV32I-NEXT: #NO_APP
849 ; RV64I-LABEL: constraint_o_with_offset:
852 ; RV64I-NEXT: lw a0, 4(a0)
853 ; RV64I-NEXT: #NO_APP
856 ; RV32I-MEDIUM-LABEL: constraint_o_with_offset:
857 ; RV32I-MEDIUM: # %bb.0:
858 ; RV32I-MEDIUM-NEXT: #APP
859 ; RV32I-MEDIUM-NEXT: lw a0, 4(a0)
860 ; RV32I-MEDIUM-NEXT: #NO_APP
861 ; RV32I-MEDIUM-NEXT: ret
863 ; RV64I-MEDIUM-LABEL: constraint_o_with_offset:
864 ; RV64I-MEDIUM: # %bb.0:
865 ; RV64I-MEDIUM-NEXT: #APP
866 ; RV64I-MEDIUM-NEXT: lw a0, 4(a0)
867 ; RV64I-MEDIUM-NEXT: #NO_APP
868 ; RV64I-MEDIUM-NEXT: ret
869 %1 = getelementptr i32, ptr %a, i32 1
870 %2 = tail call i32 asm "lw $0, $1", "=r,*o"(ptr elementtype(i32) %1)
874 define void @constraint_o_with_global_1() nounwind {
875 ; RV32I-LABEL: constraint_o_with_global_1:
877 ; RV32I-NEXT: lui a0, %hi(eg)
879 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
880 ; RV32I-NEXT: #NO_APP
883 ; RV64I-LABEL: constraint_o_with_global_1:
885 ; RV64I-NEXT: lui a0, %hi(eg)
887 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
888 ; RV64I-NEXT: #NO_APP
891 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_1:
892 ; RV32I-MEDIUM: # %bb.0:
893 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi13:
894 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
895 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi13)
896 ; RV32I-MEDIUM-NEXT: #APP
897 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
898 ; RV32I-MEDIUM-NEXT: #NO_APP
899 ; RV32I-MEDIUM-NEXT: ret
901 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_1:
902 ; RV64I-MEDIUM: # %bb.0:
903 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi13:
904 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
905 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi13)
906 ; RV64I-MEDIUM-NEXT: #APP
907 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
908 ; RV64I-MEDIUM-NEXT: #NO_APP
909 ; RV64I-MEDIUM-NEXT: ret
910 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
914 define void @constraint_o_with_global_2() nounwind {
915 ; RV32I-LABEL: constraint_o_with_global_2:
917 ; RV32I-NEXT: lui a0, %hi(eg)
918 ; RV32I-NEXT: addi a0, a0, %lo(eg)
920 ; RV32I-NEXT: sw zero, 4(a0)
921 ; RV32I-NEXT: #NO_APP
924 ; RV64I-LABEL: constraint_o_with_global_2:
926 ; RV64I-NEXT: lui a0, %hi(eg)
927 ; RV64I-NEXT: addi a0, a0, %lo(eg)
929 ; RV64I-NEXT: sw zero, 4(a0)
930 ; RV64I-NEXT: #NO_APP
933 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_2:
934 ; RV32I-MEDIUM: # %bb.0:
935 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi14:
936 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
937 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi14)
938 ; RV32I-MEDIUM-NEXT: #APP
939 ; RV32I-MEDIUM-NEXT: sw zero, 4(a0)
940 ; RV32I-MEDIUM-NEXT: #NO_APP
941 ; RV32I-MEDIUM-NEXT: ret
943 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_2:
944 ; RV64I-MEDIUM: # %bb.0:
945 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi14:
946 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
947 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi14)
948 ; RV64I-MEDIUM-NEXT: #APP
949 ; RV64I-MEDIUM-NEXT: sw zero, 4(a0)
950 ; RV64I-MEDIUM-NEXT: #NO_APP
951 ; RV64I-MEDIUM-NEXT: ret
952 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
956 define void @constraint_o_with_global_3() nounwind {
957 ; RV32I-LABEL: constraint_o_with_global_3:
959 ; RV32I-NEXT: lui a0, %hi(eg+8000)
960 ; RV32I-NEXT: addi a0, a0, %lo(eg+8000)
962 ; RV32I-NEXT: sw zero, 0(a0)
963 ; RV32I-NEXT: #NO_APP
966 ; RV64I-LABEL: constraint_o_with_global_3:
968 ; RV64I-NEXT: lui a0, %hi(eg+8000)
969 ; RV64I-NEXT: addi a0, a0, %lo(eg+8000)
971 ; RV64I-NEXT: sw zero, 0(a0)
972 ; RV64I-NEXT: #NO_APP
975 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_3:
976 ; RV32I-MEDIUM: # %bb.0:
977 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi15:
978 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
979 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi15)
980 ; RV32I-MEDIUM-NEXT: #APP
981 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
982 ; RV32I-MEDIUM-NEXT: #NO_APP
983 ; RV32I-MEDIUM-NEXT: ret
985 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_3:
986 ; RV64I-MEDIUM: # %bb.0:
987 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi15:
988 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
989 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi15)
990 ; RV64I-MEDIUM-NEXT: #APP
991 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
992 ; RV64I-MEDIUM-NEXT: #NO_APP
993 ; RV64I-MEDIUM-NEXT: ret
994 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 2000))
998 define void @constraint_o_with_extern_weak_global_1() nounwind {
999 ; RV32I-LABEL: constraint_o_with_extern_weak_global_1:
1001 ; RV32I-NEXT: lui a0, %hi(ewg)
1003 ; RV32I-NEXT: sw zero, %lo(ewg)(a0)
1004 ; RV32I-NEXT: #NO_APP
1007 ; RV64I-LABEL: constraint_o_with_extern_weak_global_1:
1009 ; RV64I-NEXT: lui a0, %hi(ewg)
1011 ; RV64I-NEXT: sw zero, %lo(ewg)(a0)
1012 ; RV64I-NEXT: #NO_APP
1015 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_1:
1016 ; RV32I-MEDIUM: # %bb.0:
1017 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi16:
1018 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1019 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi16)(a0)
1020 ; RV32I-MEDIUM-NEXT: #APP
1021 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1022 ; RV32I-MEDIUM-NEXT: #NO_APP
1023 ; RV32I-MEDIUM-NEXT: ret
1025 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_1:
1026 ; RV64I-MEDIUM: # %bb.0:
1027 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi16:
1028 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1029 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi16)(a0)
1030 ; RV64I-MEDIUM-NEXT: #APP
1031 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1032 ; RV64I-MEDIUM-NEXT: #NO_APP
1033 ; RV64I-MEDIUM-NEXT: ret
1034 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @ewg)
1038 define void @constraint_o_with_extern_weak_global_2() nounwind {
1039 ; RV32I-LABEL: constraint_o_with_extern_weak_global_2:
1041 ; RV32I-NEXT: lui a0, %hi(ewg)
1042 ; RV32I-NEXT: addi a0, a0, %lo(ewg)
1044 ; RV32I-NEXT: sw zero, 4(a0)
1045 ; RV32I-NEXT: #NO_APP
1048 ; RV64I-LABEL: constraint_o_with_extern_weak_global_2:
1050 ; RV64I-NEXT: lui a0, %hi(ewg)
1051 ; RV64I-NEXT: addi a0, a0, %lo(ewg)
1053 ; RV64I-NEXT: sw zero, 4(a0)
1054 ; RV64I-NEXT: #NO_APP
1057 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_2:
1058 ; RV32I-MEDIUM: # %bb.0:
1059 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi17:
1060 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1061 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi17)(a0)
1062 ; RV32I-MEDIUM-NEXT: #APP
1063 ; RV32I-MEDIUM-NEXT: sw zero, 4(a0)
1064 ; RV32I-MEDIUM-NEXT: #NO_APP
1065 ; RV32I-MEDIUM-NEXT: ret
1067 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_2:
1068 ; RV64I-MEDIUM: # %bb.0:
1069 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi17:
1070 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1071 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi17)(a0)
1072 ; RV64I-MEDIUM-NEXT: #APP
1073 ; RV64I-MEDIUM-NEXT: sw zero, 4(a0)
1074 ; RV64I-MEDIUM-NEXT: #NO_APP
1075 ; RV64I-MEDIUM-NEXT: ret
1076 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
1080 define void @constraint_o_with_extern_weak_global_3() nounwind {
1081 ; RV32I-LABEL: constraint_o_with_extern_weak_global_3:
1083 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
1084 ; RV32I-NEXT: addi a0, a0, %lo(ewg+8000)
1086 ; RV32I-NEXT: sw zero, 0(a0)
1087 ; RV32I-NEXT: #NO_APP
1090 ; RV64I-LABEL: constraint_o_with_extern_weak_global_3:
1092 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
1093 ; RV64I-NEXT: addi a0, a0, %lo(ewg+8000)
1095 ; RV64I-NEXT: sw zero, 0(a0)
1096 ; RV64I-NEXT: #NO_APP
1099 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_3:
1100 ; RV32I-MEDIUM: # %bb.0:
1101 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi18:
1102 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1103 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi18)(a0)
1104 ; RV32I-MEDIUM-NEXT: lui a1, 2
1105 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
1106 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
1107 ; RV32I-MEDIUM-NEXT: #APP
1108 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1109 ; RV32I-MEDIUM-NEXT: #NO_APP
1110 ; RV32I-MEDIUM-NEXT: ret
1112 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_3:
1113 ; RV64I-MEDIUM: # %bb.0:
1114 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi18:
1115 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1116 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi18)(a0)
1117 ; RV64I-MEDIUM-NEXT: lui a1, 2
1118 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
1119 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
1120 ; RV64I-MEDIUM-NEXT: #APP
1121 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1122 ; RV64I-MEDIUM-NEXT: #NO_APP
1123 ; RV64I-MEDIUM-NEXT: ret
1124 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
1128 define void @constraint_o_with_multi_operands() nounwind {
1129 ; RV32I-LABEL: constraint_o_with_multi_operands:
1131 ; RV32I-NEXT: lui a0, %hi(eg)
1133 ; RV32I-NEXT: sw zero, %lo(eg)(a0) \n sw zero, %lo(eg)(a0)
1134 ; RV32I-NEXT: #NO_APP
1137 ; RV64I-LABEL: constraint_o_with_multi_operands:
1139 ; RV64I-NEXT: lui a0, %hi(eg)
1141 ; RV64I-NEXT: sw zero, %lo(eg)(a0) \n sw zero, %lo(eg)(a0)
1142 ; RV64I-NEXT: #NO_APP
1145 ; RV32I-MEDIUM-LABEL: constraint_o_with_multi_operands:
1146 ; RV32I-MEDIUM: # %bb.0:
1147 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi19:
1148 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1149 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi19)
1150 ; RV32I-MEDIUM-NEXT: #APP
1151 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1152 ; RV32I-MEDIUM-NEXT: #NO_APP
1153 ; RV32I-MEDIUM-NEXT: ret
1155 ; RV64I-MEDIUM-LABEL: constraint_o_with_multi_operands:
1156 ; RV64I-MEDIUM: # %bb.0:
1157 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi19:
1158 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1159 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi19)
1160 ; RV64I-MEDIUM-NEXT: #APP
1161 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1162 ; RV64I-MEDIUM-NEXT: #NO_APP
1163 ; RV64I-MEDIUM-NEXT: ret
1164 call void asm "sw zero, $0 \n sw zero, $1", "=*o,=*o"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
1168 define void @constraint_o_with_multi_asm() nounwind {
1169 ; RV32I-LABEL: constraint_o_with_multi_asm:
1171 ; RV32I-NEXT: lui a0, %hi(eg)
1173 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
1174 ; RV32I-NEXT: #NO_APP
1176 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
1177 ; RV32I-NEXT: #NO_APP
1180 ; RV64I-LABEL: constraint_o_with_multi_asm:
1182 ; RV64I-NEXT: lui a0, %hi(eg)
1184 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
1185 ; RV64I-NEXT: #NO_APP
1187 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
1188 ; RV64I-NEXT: #NO_APP
1191 ; RV32I-MEDIUM-LABEL: constraint_o_with_multi_asm:
1192 ; RV32I-MEDIUM: # %bb.0:
1193 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi20:
1194 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1195 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi20)
1196 ; RV32I-MEDIUM-NEXT: #APP
1197 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1198 ; RV32I-MEDIUM-NEXT: #NO_APP
1199 ; RV32I-MEDIUM-NEXT: #APP
1200 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1201 ; RV32I-MEDIUM-NEXT: #NO_APP
1202 ; RV32I-MEDIUM-NEXT: ret
1204 ; RV64I-MEDIUM-LABEL: constraint_o_with_multi_asm:
1205 ; RV64I-MEDIUM: # %bb.0:
1206 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi20:
1207 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1208 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi20)
1209 ; RV64I-MEDIUM-NEXT: #APP
1210 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1211 ; RV64I-MEDIUM-NEXT: #NO_APP
1212 ; RV64I-MEDIUM-NEXT: #APP
1213 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1214 ; RV64I-MEDIUM-NEXT: #NO_APP
1215 ; RV64I-MEDIUM-NEXT: ret
1216 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
1217 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
1221 define i32 @constraint_o_with_callbr_multi_operands(i32 %a) {
1222 ; RV32I-LABEL: constraint_o_with_callbr_multi_operands:
1223 ; RV32I: # %bb.0: # %entry
1224 ; RV32I-NEXT: lui a1, %hi(eg)
1226 ; RV32I-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB27_2
1227 ; RV32I-NEXT: #NO_APP
1228 ; RV32I-NEXT: # %bb.1: # %normal
1229 ; RV32I-NEXT: li a0, 0
1231 ; RV32I-NEXT: .LBB27_2: # Block address taken
1232 ; RV32I-NEXT: # %fail
1233 ; RV32I-NEXT: # Label of block must be emitted
1234 ; RV32I-NEXT: li a0, 1
1237 ; RV64I-LABEL: constraint_o_with_callbr_multi_operands:
1238 ; RV64I: # %bb.0: # %entry
1239 ; RV64I-NEXT: lui a1, %hi(eg)
1241 ; RV64I-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB27_2
1242 ; RV64I-NEXT: #NO_APP
1243 ; RV64I-NEXT: # %bb.1: # %normal
1244 ; RV64I-NEXT: li a0, 0
1246 ; RV64I-NEXT: .LBB27_2: # Block address taken
1247 ; RV64I-NEXT: # %fail
1248 ; RV64I-NEXT: # Label of block must be emitted
1249 ; RV64I-NEXT: li a0, 1
1252 ; RV32I-MEDIUM-LABEL: constraint_o_with_callbr_multi_operands:
1253 ; RV32I-MEDIUM: # %bb.0: # %entry
1254 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi21:
1255 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1256 ; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi21)
1257 ; RV32I-MEDIUM-NEXT: #APP
1258 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB27_2
1259 ; RV32I-MEDIUM-NEXT: #NO_APP
1260 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal
1261 ; RV32I-MEDIUM-NEXT: li a0, 0
1262 ; RV32I-MEDIUM-NEXT: ret
1263 ; RV32I-MEDIUM-NEXT: .LBB27_2: # Block address taken
1264 ; RV32I-MEDIUM-NEXT: # %fail
1265 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
1266 ; RV32I-MEDIUM-NEXT: li a0, 1
1267 ; RV32I-MEDIUM-NEXT: ret
1269 ; RV64I-MEDIUM-LABEL: constraint_o_with_callbr_multi_operands:
1270 ; RV64I-MEDIUM: # %bb.0: # %entry
1271 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi21:
1272 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1273 ; RV64I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi21)
1274 ; RV64I-MEDIUM-NEXT: #APP
1275 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB27_2
1276 ; RV64I-MEDIUM-NEXT: #NO_APP
1277 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal
1278 ; RV64I-MEDIUM-NEXT: li a0, 0
1279 ; RV64I-MEDIUM-NEXT: ret
1280 ; RV64I-MEDIUM-NEXT: .LBB27_2: # Block address taken
1281 ; RV64I-MEDIUM-NEXT: # %fail
1282 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
1283 ; RV64I-MEDIUM-NEXT: li a0, 1
1284 ; RV64I-MEDIUM-NEXT: ret
1286 callbr void asm "sw zero, $0; sw zero, $1; beqz $2, $3", "=*m,=*m,r,!i"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg, i32 %a) to label %normal [label %fail]
1295 define i32 @constraint_o_with_multi_callbr_asm(i32 %a) {
1296 ; RV32I-LABEL: constraint_o_with_multi_callbr_asm:
1297 ; RV32I: # %bb.0: # %entry
1298 ; RV32I-NEXT: lui a1, %hi(eg)
1300 ; RV32I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB28_3
1301 ; RV32I-NEXT: #NO_APP
1302 ; RV32I-NEXT: # %bb.1: # %normal0
1304 ; RV32I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB28_3
1305 ; RV32I-NEXT: #NO_APP
1306 ; RV32I-NEXT: # %bb.2: # %normal1
1307 ; RV32I-NEXT: li a0, 0
1309 ; RV32I-NEXT: .LBB28_3: # Block address taken
1310 ; RV32I-NEXT: # %fail
1311 ; RV32I-NEXT: # Label of block must be emitted
1312 ; RV32I-NEXT: li a0, 1
1315 ; RV64I-LABEL: constraint_o_with_multi_callbr_asm:
1316 ; RV64I: # %bb.0: # %entry
1317 ; RV64I-NEXT: lui a1, %hi(eg)
1319 ; RV64I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB28_3
1320 ; RV64I-NEXT: #NO_APP
1321 ; RV64I-NEXT: # %bb.1: # %normal0
1323 ; RV64I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB28_3
1324 ; RV64I-NEXT: #NO_APP
1325 ; RV64I-NEXT: # %bb.2: # %normal1
1326 ; RV64I-NEXT: li a0, 0
1328 ; RV64I-NEXT: .LBB28_3: # Block address taken
1329 ; RV64I-NEXT: # %fail
1330 ; RV64I-NEXT: # Label of block must be emitted
1331 ; RV64I-NEXT: li a0, 1
1334 ; RV32I-MEDIUM-LABEL: constraint_o_with_multi_callbr_asm:
1335 ; RV32I-MEDIUM: # %bb.0: # %entry
1336 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi22:
1337 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1338 ; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi22)
1339 ; RV32I-MEDIUM-NEXT: #APP
1340 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB28_3
1341 ; RV32I-MEDIUM-NEXT: #NO_APP
1342 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal0
1343 ; RV32I-MEDIUM-NEXT: #APP
1344 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB28_3
1345 ; RV32I-MEDIUM-NEXT: #NO_APP
1346 ; RV32I-MEDIUM-NEXT: # %bb.2: # %normal1
1347 ; RV32I-MEDIUM-NEXT: li a0, 0
1348 ; RV32I-MEDIUM-NEXT: ret
1349 ; RV32I-MEDIUM-NEXT: .LBB28_3: # Block address taken
1350 ; RV32I-MEDIUM-NEXT: # %fail
1351 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
1352 ; RV32I-MEDIUM-NEXT: li a0, 1
1353 ; RV32I-MEDIUM-NEXT: ret
1355 ; RV64I-MEDIUM-LABEL: constraint_o_with_multi_callbr_asm:
1356 ; RV64I-MEDIUM: # %bb.0: # %entry
1357 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi22:
1358 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1359 ; RV64I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi22)
1360 ; RV64I-MEDIUM-NEXT: #APP
1361 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB28_3
1362 ; RV64I-MEDIUM-NEXT: #NO_APP
1363 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal0
1364 ; RV64I-MEDIUM-NEXT: #APP
1365 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB28_3
1366 ; RV64I-MEDIUM-NEXT: #NO_APP
1367 ; RV64I-MEDIUM-NEXT: # %bb.2: # %normal1
1368 ; RV64I-MEDIUM-NEXT: li a0, 0
1369 ; RV64I-MEDIUM-NEXT: ret
1370 ; RV64I-MEDIUM-NEXT: .LBB28_3: # Block address taken
1371 ; RV64I-MEDIUM-NEXT: # %fail
1372 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
1373 ; RV64I-MEDIUM-NEXT: li a0, 1
1374 ; RV64I-MEDIUM-NEXT: ret
1376 callbr void asm "sw zero, $0; beqz $1, $2", "=*o,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
1379 callbr void asm "sw zero, $0; beqz $1, $2", "=*o,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
1388 define void @constraint_o_with_local_1() nounwind {
1389 ; RV32I-LABEL: constraint_o_with_local_1:
1390 ; RV32I: # %bb.0: # %entry
1391 ; RV32I-NEXT: .Ltmp3: # Block address taken
1392 ; RV32I-NEXT: # %bb.1: # %label
1393 ; RV32I-NEXT: lui a0, %hi(.Ltmp3)
1395 ; RV32I-NEXT: lw zero, %lo(.Ltmp3)(a0)
1396 ; RV32I-NEXT: #NO_APP
1399 ; RV64I-LABEL: constraint_o_with_local_1:
1400 ; RV64I: # %bb.0: # %entry
1401 ; RV64I-NEXT: .Ltmp3: # Block address taken
1402 ; RV64I-NEXT: # %bb.1: # %label
1403 ; RV64I-NEXT: lui a0, %hi(.Ltmp3)
1405 ; RV64I-NEXT: lw zero, %lo(.Ltmp3)(a0)
1406 ; RV64I-NEXT: #NO_APP
1409 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_1:
1410 ; RV32I-MEDIUM: # %bb.0: # %entry
1411 ; RV32I-MEDIUM-NEXT: .Ltmp3: # Block address taken
1412 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
1413 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi23:
1414 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp3)
1415 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi23)
1416 ; RV32I-MEDIUM-NEXT: #APP
1417 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
1418 ; RV32I-MEDIUM-NEXT: #NO_APP
1419 ; RV32I-MEDIUM-NEXT: ret
1421 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_1:
1422 ; RV64I-MEDIUM: # %bb.0: # %entry
1423 ; RV64I-MEDIUM-NEXT: .Ltmp3: # Block address taken
1424 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
1425 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi23:
1426 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp3)
1427 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi23)
1428 ; RV64I-MEDIUM-NEXT: #APP
1429 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
1430 ; RV64I-MEDIUM-NEXT: #NO_APP
1431 ; RV64I-MEDIUM-NEXT: ret
1436 tail call void asm sideeffect "lw zero, $0", "*o"(ptr elementtype(ptr) blockaddress(@constraint_o_with_local_1, %label))
1440 define void @constraint_o_with_local_2() nounwind {
1441 ; RV32I-LABEL: constraint_o_with_local_2:
1442 ; RV32I: # %bb.0: # %entry
1443 ; RV32I-NEXT: .Ltmp4: # Block address taken
1444 ; RV32I-NEXT: # %bb.1: # %label
1445 ; RV32I-NEXT: lui a0, %hi(.Ltmp4)
1446 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp4)
1448 ; RV32I-NEXT: lw zero, 4(a0)
1449 ; RV32I-NEXT: #NO_APP
1452 ; RV64I-LABEL: constraint_o_with_local_2:
1453 ; RV64I: # %bb.0: # %entry
1454 ; RV64I-NEXT: .Ltmp4: # Block address taken
1455 ; RV64I-NEXT: # %bb.1: # %label
1456 ; RV64I-NEXT: lui a0, %hi(.Ltmp4)
1457 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp4)
1459 ; RV64I-NEXT: lw zero, 4(a0)
1460 ; RV64I-NEXT: #NO_APP
1463 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_2:
1464 ; RV32I-MEDIUM: # %bb.0: # %entry
1465 ; RV32I-MEDIUM-NEXT: .Ltmp4: # Block address taken
1466 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
1467 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi24:
1468 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp4)
1469 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi24)
1470 ; RV32I-MEDIUM-NEXT: #APP
1471 ; RV32I-MEDIUM-NEXT: lw zero, 4(a0)
1472 ; RV32I-MEDIUM-NEXT: #NO_APP
1473 ; RV32I-MEDIUM-NEXT: ret
1475 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_2:
1476 ; RV64I-MEDIUM: # %bb.0: # %entry
1477 ; RV64I-MEDIUM-NEXT: .Ltmp4: # Block address taken
1478 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
1479 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi24:
1480 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp4)
1481 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi24)
1482 ; RV64I-MEDIUM-NEXT: #APP
1483 ; RV64I-MEDIUM-NEXT: lw zero, 4(a0)
1484 ; RV64I-MEDIUM-NEXT: #NO_APP
1485 ; RV64I-MEDIUM-NEXT: ret
1490 call void asm "lw zero, $0", "*o"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_o_with_local_2, %label), i32 4))
1494 define void @constraint_o_with_local_3() nounwind {
1495 ; RV32I-LABEL: constraint_o_with_local_3:
1496 ; RV32I: # %bb.0: # %entry
1497 ; RV32I-NEXT: .Ltmp5: # Block address taken
1498 ; RV32I-NEXT: # %bb.1: # %label
1499 ; RV32I-NEXT: lui a0, %hi(.Ltmp5)
1500 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp5)
1502 ; RV32I-NEXT: lw zero, 2000(a0)
1503 ; RV32I-NEXT: #NO_APP
1506 ; RV64I-LABEL: constraint_o_with_local_3:
1507 ; RV64I: # %bb.0: # %entry
1508 ; RV64I-NEXT: .Ltmp5: # Block address taken
1509 ; RV64I-NEXT: # %bb.1: # %label
1510 ; RV64I-NEXT: lui a0, %hi(.Ltmp5)
1511 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp5)
1513 ; RV64I-NEXT: lw zero, 2000(a0)
1514 ; RV64I-NEXT: #NO_APP
1517 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_3:
1518 ; RV32I-MEDIUM: # %bb.0: # %entry
1519 ; RV32I-MEDIUM-NEXT: .Ltmp5: # Block address taken
1520 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
1521 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi25:
1522 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp5)
1523 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi25)
1524 ; RV32I-MEDIUM-NEXT: #APP
1525 ; RV32I-MEDIUM-NEXT: lw zero, 2000(a0)
1526 ; RV32I-MEDIUM-NEXT: #NO_APP
1527 ; RV32I-MEDIUM-NEXT: ret
1529 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_3:
1530 ; RV64I-MEDIUM: # %bb.0: # %entry
1531 ; RV64I-MEDIUM-NEXT: .Ltmp5: # Block address taken
1532 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
1533 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi25:
1534 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp5)
1535 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi25)
1536 ; RV64I-MEDIUM-NEXT: #APP
1537 ; RV64I-MEDIUM-NEXT: lw zero, 2000(a0)
1538 ; RV64I-MEDIUM-NEXT: #NO_APP
1539 ; RV64I-MEDIUM-NEXT: ret
1544 call void asm "lw zero, $0", "*o"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_o_with_local_3, %label), i32 2000))
1548 define void @constraint_A(ptr %a) nounwind {
1549 ; RV32I-LABEL: constraint_A:
1552 ; RV32I-NEXT: sb s0, 0(a0)
1553 ; RV32I-NEXT: #NO_APP
1555 ; RV32I-NEXT: lb s1, 0(a0)
1556 ; RV32I-NEXT: #NO_APP
1559 ; RV64I-LABEL: constraint_A:
1562 ; RV64I-NEXT: sb s0, 0(a0)
1563 ; RV64I-NEXT: #NO_APP
1565 ; RV64I-NEXT: lb s1, 0(a0)
1566 ; RV64I-NEXT: #NO_APP
1569 ; RV32I-MEDIUM-LABEL: constraint_A:
1570 ; RV32I-MEDIUM: # %bb.0:
1571 ; RV32I-MEDIUM-NEXT: #APP
1572 ; RV32I-MEDIUM-NEXT: sb s0, 0(a0)
1573 ; RV32I-MEDIUM-NEXT: #NO_APP
1574 ; RV32I-MEDIUM-NEXT: #APP
1575 ; RV32I-MEDIUM-NEXT: lb s1, 0(a0)
1576 ; RV32I-MEDIUM-NEXT: #NO_APP
1577 ; RV32I-MEDIUM-NEXT: ret
1579 ; RV64I-MEDIUM-LABEL: constraint_A:
1580 ; RV64I-MEDIUM: # %bb.0:
1581 ; RV64I-MEDIUM-NEXT: #APP
1582 ; RV64I-MEDIUM-NEXT: sb s0, 0(a0)
1583 ; RV64I-MEDIUM-NEXT: #NO_APP
1584 ; RV64I-MEDIUM-NEXT: #APP
1585 ; RV64I-MEDIUM-NEXT: lb s1, 0(a0)
1586 ; RV64I-MEDIUM-NEXT: #NO_APP
1587 ; RV64I-MEDIUM-NEXT: ret
1588 tail call void asm sideeffect "sb s0, $0", "*A"(ptr elementtype(i8) %a)
1589 tail call void asm sideeffect "lb s1, $0", "*A"(ptr elementtype(i8) %a)
1593 define i32 @constraint_A_with_offset(ptr %a) nounwind {
1594 ; RV32I-LABEL: constraint_A_with_offset:
1596 ; RV32I-NEXT: addi a0, a0, 4
1598 ; RV32I-NEXT: lw a0, 0(a0)
1599 ; RV32I-NEXT: #NO_APP
1602 ; RV64I-LABEL: constraint_A_with_offset:
1604 ; RV64I-NEXT: addi a0, a0, 4
1606 ; RV64I-NEXT: lw a0, 0(a0)
1607 ; RV64I-NEXT: #NO_APP
1610 ; RV32I-MEDIUM-LABEL: constraint_A_with_offset:
1611 ; RV32I-MEDIUM: # %bb.0:
1612 ; RV32I-MEDIUM-NEXT: addi a0, a0, 4
1613 ; RV32I-MEDIUM-NEXT: #APP
1614 ; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
1615 ; RV32I-MEDIUM-NEXT: #NO_APP
1616 ; RV32I-MEDIUM-NEXT: ret
1618 ; RV64I-MEDIUM-LABEL: constraint_A_with_offset:
1619 ; RV64I-MEDIUM: # %bb.0:
1620 ; RV64I-MEDIUM-NEXT: addi a0, a0, 4
1621 ; RV64I-MEDIUM-NEXT: #APP
1622 ; RV64I-MEDIUM-NEXT: lw a0, 0(a0)
1623 ; RV64I-MEDIUM-NEXT: #NO_APP
1624 ; RV64I-MEDIUM-NEXT: ret
1625 %1 = getelementptr i32, ptr %a, i32 1
1626 %2 = tail call i32 asm "lw $0, $1", "=r,*A"(ptr elementtype(i32) %1)
1630 define void @constraint_A_with_global_1() nounwind {
1631 ; RV32I-LABEL: constraint_A_with_global_1:
1633 ; RV32I-NEXT: lui a0, %hi(eg)
1634 ; RV32I-NEXT: addi a0, a0, %lo(eg)
1636 ; RV32I-NEXT: sw zero, 0(a0)
1637 ; RV32I-NEXT: #NO_APP
1640 ; RV64I-LABEL: constraint_A_with_global_1:
1642 ; RV64I-NEXT: lui a0, %hi(eg)
1643 ; RV64I-NEXT: addi a0, a0, %lo(eg)
1645 ; RV64I-NEXT: sw zero, 0(a0)
1646 ; RV64I-NEXT: #NO_APP
1649 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_1:
1650 ; RV32I-MEDIUM: # %bb.0:
1651 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi26:
1652 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1653 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi26)
1654 ; RV32I-MEDIUM-NEXT: #APP
1655 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1656 ; RV32I-MEDIUM-NEXT: #NO_APP
1657 ; RV32I-MEDIUM-NEXT: ret
1659 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_1:
1660 ; RV64I-MEDIUM: # %bb.0:
1661 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi26:
1662 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1663 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi26)
1664 ; RV64I-MEDIUM-NEXT: #APP
1665 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1666 ; RV64I-MEDIUM-NEXT: #NO_APP
1667 ; RV64I-MEDIUM-NEXT: ret
1668 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
1672 define void @constraint_A_with_global_2() nounwind {
1673 ; RV32I-LABEL: constraint_A_with_global_2:
1675 ; RV32I-NEXT: lui a0, %hi(eg+4)
1676 ; RV32I-NEXT: addi a0, a0, %lo(eg+4)
1678 ; RV32I-NEXT: sw zero, 0(a0)
1679 ; RV32I-NEXT: #NO_APP
1682 ; RV64I-LABEL: constraint_A_with_global_2:
1684 ; RV64I-NEXT: lui a0, %hi(eg+4)
1685 ; RV64I-NEXT: addi a0, a0, %lo(eg+4)
1687 ; RV64I-NEXT: sw zero, 0(a0)
1688 ; RV64I-NEXT: #NO_APP
1691 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_2:
1692 ; RV32I-MEDIUM: # %bb.0:
1693 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi27:
1694 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
1695 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi27)
1696 ; RV32I-MEDIUM-NEXT: #APP
1697 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1698 ; RV32I-MEDIUM-NEXT: #NO_APP
1699 ; RV32I-MEDIUM-NEXT: ret
1701 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_2:
1702 ; RV64I-MEDIUM: # %bb.0:
1703 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi27:
1704 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
1705 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi27)
1706 ; RV64I-MEDIUM-NEXT: #APP
1707 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1708 ; RV64I-MEDIUM-NEXT: #NO_APP
1709 ; RV64I-MEDIUM-NEXT: ret
1710 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
1714 define void @constraint_A_with_global_3() nounwind {
1715 ; RV32I-LABEL: constraint_A_with_global_3:
1717 ; RV32I-NEXT: lui a0, %hi(eg+8000)
1718 ; RV32I-NEXT: addi a0, a0, %lo(eg+8000)
1720 ; RV32I-NEXT: sw zero, 0(a0)
1721 ; RV32I-NEXT: #NO_APP
1724 ; RV64I-LABEL: constraint_A_with_global_3:
1726 ; RV64I-NEXT: lui a0, %hi(eg+8000)
1727 ; RV64I-NEXT: addi a0, a0, %lo(eg+8000)
1729 ; RV64I-NEXT: sw zero, 0(a0)
1730 ; RV64I-NEXT: #NO_APP
1733 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_3:
1734 ; RV32I-MEDIUM: # %bb.0:
1735 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi28:
1736 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
1737 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi28)
1738 ; RV32I-MEDIUM-NEXT: #APP
1739 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1740 ; RV32I-MEDIUM-NEXT: #NO_APP
1741 ; RV32I-MEDIUM-NEXT: ret
1743 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_3:
1744 ; RV64I-MEDIUM: # %bb.0:
1745 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi28:
1746 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
1747 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi28)
1748 ; RV64I-MEDIUM-NEXT: #APP
1749 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1750 ; RV64I-MEDIUM-NEXT: #NO_APP
1751 ; RV64I-MEDIUM-NEXT: ret
1752 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 2000))
1756 define void @constraint_A_with_extern_weak_global_1() nounwind {
1757 ; RV32I-LABEL: constraint_A_with_extern_weak_global_1:
1759 ; RV32I-NEXT: lui a0, %hi(ewg)
1760 ; RV32I-NEXT: addi a0, a0, %lo(ewg)
1762 ; RV32I-NEXT: sw zero, 0(a0)
1763 ; RV32I-NEXT: #NO_APP
1766 ; RV64I-LABEL: constraint_A_with_extern_weak_global_1:
1768 ; RV64I-NEXT: lui a0, %hi(ewg)
1769 ; RV64I-NEXT: addi a0, a0, %lo(ewg)
1771 ; RV64I-NEXT: sw zero, 0(a0)
1772 ; RV64I-NEXT: #NO_APP
1775 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_1:
1776 ; RV32I-MEDIUM: # %bb.0:
1777 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi29:
1778 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1779 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi29)(a0)
1780 ; RV32I-MEDIUM-NEXT: #APP
1781 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1782 ; RV32I-MEDIUM-NEXT: #NO_APP
1783 ; RV32I-MEDIUM-NEXT: ret
1785 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_1:
1786 ; RV64I-MEDIUM: # %bb.0:
1787 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi29:
1788 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1789 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi29)(a0)
1790 ; RV64I-MEDIUM-NEXT: #APP
1791 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1792 ; RV64I-MEDIUM-NEXT: #NO_APP
1793 ; RV64I-MEDIUM-NEXT: ret
1794 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @ewg)
1798 define void @constraint_A_with_extern_weak_global_2() nounwind {
1799 ; RV32I-LABEL: constraint_A_with_extern_weak_global_2:
1801 ; RV32I-NEXT: lui a0, %hi(ewg+4)
1802 ; RV32I-NEXT: addi a0, a0, %lo(ewg+4)
1804 ; RV32I-NEXT: sw zero, 0(a0)
1805 ; RV32I-NEXT: #NO_APP
1808 ; RV64I-LABEL: constraint_A_with_extern_weak_global_2:
1810 ; RV64I-NEXT: lui a0, %hi(ewg+4)
1811 ; RV64I-NEXT: addi a0, a0, %lo(ewg+4)
1813 ; RV64I-NEXT: sw zero, 0(a0)
1814 ; RV64I-NEXT: #NO_APP
1817 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_2:
1818 ; RV32I-MEDIUM: # %bb.0:
1819 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi30:
1820 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1821 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi30)(a0)
1822 ; RV32I-MEDIUM-NEXT: addi a0, a0, 4
1823 ; RV32I-MEDIUM-NEXT: #APP
1824 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1825 ; RV32I-MEDIUM-NEXT: #NO_APP
1826 ; RV32I-MEDIUM-NEXT: ret
1828 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_2:
1829 ; RV64I-MEDIUM: # %bb.0:
1830 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi30:
1831 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1832 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi30)(a0)
1833 ; RV64I-MEDIUM-NEXT: addi a0, a0, 4
1834 ; RV64I-MEDIUM-NEXT: #APP
1835 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1836 ; RV64I-MEDIUM-NEXT: #NO_APP
1837 ; RV64I-MEDIUM-NEXT: ret
1838 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
1842 define void @constraint_A_with_extern_weak_global_3() nounwind {
1843 ; RV32I-LABEL: constraint_A_with_extern_weak_global_3:
1845 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
1846 ; RV32I-NEXT: addi a0, a0, %lo(ewg+8000)
1848 ; RV32I-NEXT: sw zero, 0(a0)
1849 ; RV32I-NEXT: #NO_APP
1852 ; RV64I-LABEL: constraint_A_with_extern_weak_global_3:
1854 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
1855 ; RV64I-NEXT: addi a0, a0, %lo(ewg+8000)
1857 ; RV64I-NEXT: sw zero, 0(a0)
1858 ; RV64I-NEXT: #NO_APP
1861 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_3:
1862 ; RV32I-MEDIUM: # %bb.0:
1863 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi31:
1864 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1865 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi31)(a0)
1866 ; RV32I-MEDIUM-NEXT: lui a1, 2
1867 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
1868 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
1869 ; RV32I-MEDIUM-NEXT: #APP
1870 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1871 ; RV32I-MEDIUM-NEXT: #NO_APP
1872 ; RV32I-MEDIUM-NEXT: ret
1874 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_3:
1875 ; RV64I-MEDIUM: # %bb.0:
1876 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi31:
1877 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1878 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi31)(a0)
1879 ; RV64I-MEDIUM-NEXT: lui a1, 2
1880 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
1881 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
1882 ; RV64I-MEDIUM-NEXT: #APP
1883 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1884 ; RV64I-MEDIUM-NEXT: #NO_APP
1885 ; RV64I-MEDIUM-NEXT: ret
1886 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
1890 define void @constraint_A_with_multi_operands() nounwind {
1891 ; RV32I-LABEL: constraint_A_with_multi_operands:
1893 ; RV32I-NEXT: lui a0, %hi(eg)
1894 ; RV32I-NEXT: addi a0, a0, %lo(eg)
1896 ; RV32I-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1897 ; RV32I-NEXT: #NO_APP
1900 ; RV64I-LABEL: constraint_A_with_multi_operands:
1902 ; RV64I-NEXT: lui a0, %hi(eg)
1903 ; RV64I-NEXT: addi a0, a0, %lo(eg)
1905 ; RV64I-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1906 ; RV64I-NEXT: #NO_APP
1909 ; RV32I-MEDIUM-LABEL: constraint_A_with_multi_operands:
1910 ; RV32I-MEDIUM: # %bb.0:
1911 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi32:
1912 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1913 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi32)
1914 ; RV32I-MEDIUM-NEXT: #APP
1915 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1916 ; RV32I-MEDIUM-NEXT: #NO_APP
1917 ; RV32I-MEDIUM-NEXT: ret
1919 ; RV64I-MEDIUM-LABEL: constraint_A_with_multi_operands:
1920 ; RV64I-MEDIUM: # %bb.0:
1921 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi32:
1922 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1923 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi32)
1924 ; RV64I-MEDIUM-NEXT: #APP
1925 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1926 ; RV64I-MEDIUM-NEXT: #NO_APP
1927 ; RV64I-MEDIUM-NEXT: ret
1928 call void asm "sw zero, $0 \n sw zero, $1", "=*A,=*A"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
1932 define void @constraint_A_with_multi_asm() nounwind {
1933 ; RV32I-LABEL: constraint_A_with_multi_asm:
1935 ; RV32I-NEXT: lui a0, %hi(eg)
1936 ; RV32I-NEXT: addi a0, a0, %lo(eg)
1938 ; RV32I-NEXT: sw zero, 0(a0)
1939 ; RV32I-NEXT: #NO_APP
1941 ; RV32I-NEXT: sw zero, 0(a0)
1942 ; RV32I-NEXT: #NO_APP
1945 ; RV64I-LABEL: constraint_A_with_multi_asm:
1947 ; RV64I-NEXT: lui a0, %hi(eg)
1948 ; RV64I-NEXT: addi a0, a0, %lo(eg)
1950 ; RV64I-NEXT: sw zero, 0(a0)
1951 ; RV64I-NEXT: #NO_APP
1953 ; RV64I-NEXT: sw zero, 0(a0)
1954 ; RV64I-NEXT: #NO_APP
1957 ; RV32I-MEDIUM-LABEL: constraint_A_with_multi_asm:
1958 ; RV32I-MEDIUM: # %bb.0:
1959 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi33:
1960 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1961 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi33)
1962 ; RV32I-MEDIUM-NEXT: #APP
1963 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1964 ; RV32I-MEDIUM-NEXT: #NO_APP
1965 ; RV32I-MEDIUM-NEXT: #APP
1966 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1967 ; RV32I-MEDIUM-NEXT: #NO_APP
1968 ; RV32I-MEDIUM-NEXT: ret
1970 ; RV64I-MEDIUM-LABEL: constraint_A_with_multi_asm:
1971 ; RV64I-MEDIUM: # %bb.0:
1972 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi33:
1973 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1974 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi33)
1975 ; RV64I-MEDIUM-NEXT: #APP
1976 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1977 ; RV64I-MEDIUM-NEXT: #NO_APP
1978 ; RV64I-MEDIUM-NEXT: #APP
1979 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1980 ; RV64I-MEDIUM-NEXT: #NO_APP
1981 ; RV64I-MEDIUM-NEXT: ret
1982 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
1983 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
1987 define i32 @constraint_A_with_callbr_multi_operands(i32 %a) {
1988 ; RV32I-LABEL: constraint_A_with_callbr_multi_operands:
1989 ; RV32I: # %bb.0: # %entry
1990 ; RV32I-NEXT: lui a1, %hi(eg)
1991 ; RV32I-NEXT: addi a1, a1, %lo(eg)
1993 ; RV32I-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB42_2
1994 ; RV32I-NEXT: #NO_APP
1995 ; RV32I-NEXT: # %bb.1: # %normal
1996 ; RV32I-NEXT: li a0, 0
1998 ; RV32I-NEXT: .LBB42_2: # Block address taken
1999 ; RV32I-NEXT: # %fail
2000 ; RV32I-NEXT: # Label of block must be emitted
2001 ; RV32I-NEXT: li a0, 1
2004 ; RV64I-LABEL: constraint_A_with_callbr_multi_operands:
2005 ; RV64I: # %bb.0: # %entry
2006 ; RV64I-NEXT: lui a1, %hi(eg)
2007 ; RV64I-NEXT: addi a1, a1, %lo(eg)
2009 ; RV64I-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB42_2
2010 ; RV64I-NEXT: #NO_APP
2011 ; RV64I-NEXT: # %bb.1: # %normal
2012 ; RV64I-NEXT: li a0, 0
2014 ; RV64I-NEXT: .LBB42_2: # Block address taken
2015 ; RV64I-NEXT: # %fail
2016 ; RV64I-NEXT: # Label of block must be emitted
2017 ; RV64I-NEXT: li a0, 1
2020 ; RV32I-MEDIUM-LABEL: constraint_A_with_callbr_multi_operands:
2021 ; RV32I-MEDIUM: # %bb.0: # %entry
2022 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi34:
2023 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
2024 ; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi34)
2025 ; RV32I-MEDIUM-NEXT: #APP
2026 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB42_2
2027 ; RV32I-MEDIUM-NEXT: #NO_APP
2028 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal
2029 ; RV32I-MEDIUM-NEXT: li a0, 0
2030 ; RV32I-MEDIUM-NEXT: ret
2031 ; RV32I-MEDIUM-NEXT: .LBB42_2: # Block address taken
2032 ; RV32I-MEDIUM-NEXT: # %fail
2033 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
2034 ; RV32I-MEDIUM-NEXT: li a0, 1
2035 ; RV32I-MEDIUM-NEXT: ret
2037 ; RV64I-MEDIUM-LABEL: constraint_A_with_callbr_multi_operands:
2038 ; RV64I-MEDIUM: # %bb.0: # %entry
2039 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi34:
2040 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
2041 ; RV64I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi34)
2042 ; RV64I-MEDIUM-NEXT: #APP
2043 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB42_2
2044 ; RV64I-MEDIUM-NEXT: #NO_APP
2045 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal
2046 ; RV64I-MEDIUM-NEXT: li a0, 0
2047 ; RV64I-MEDIUM-NEXT: ret
2048 ; RV64I-MEDIUM-NEXT: .LBB42_2: # Block address taken
2049 ; RV64I-MEDIUM-NEXT: # %fail
2050 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
2051 ; RV64I-MEDIUM-NEXT: li a0, 1
2052 ; RV64I-MEDIUM-NEXT: ret
2054 callbr void asm "sw zero, $0; sw zero, $1; beqz $2, $3", "*A,*A,r,!i"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg, i32 %a) to label %normal [label %fail]
2063 define i32 @constraint_A_with_multi_callbr_asm(i32 %a) {
2064 ; RV32I-LABEL: constraint_A_with_multi_callbr_asm:
2065 ; RV32I: # %bb.0: # %entry
2066 ; RV32I-NEXT: lui a1, %hi(eg)
2067 ; RV32I-NEXT: addi a1, a1, %lo(eg)
2069 ; RV32I-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2070 ; RV32I-NEXT: #NO_APP
2071 ; RV32I-NEXT: # %bb.1: # %normal0
2073 ; RV32I-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2074 ; RV32I-NEXT: #NO_APP
2075 ; RV32I-NEXT: # %bb.2: # %normal1
2076 ; RV32I-NEXT: li a0, 0
2078 ; RV32I-NEXT: .LBB43_3: # Block address taken
2079 ; RV32I-NEXT: # %fail
2080 ; RV32I-NEXT: # Label of block must be emitted
2081 ; RV32I-NEXT: li a0, 1
2084 ; RV64I-LABEL: constraint_A_with_multi_callbr_asm:
2085 ; RV64I: # %bb.0: # %entry
2086 ; RV64I-NEXT: lui a1, %hi(eg)
2087 ; RV64I-NEXT: addi a1, a1, %lo(eg)
2089 ; RV64I-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2090 ; RV64I-NEXT: #NO_APP
2091 ; RV64I-NEXT: # %bb.1: # %normal0
2093 ; RV64I-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2094 ; RV64I-NEXT: #NO_APP
2095 ; RV64I-NEXT: # %bb.2: # %normal1
2096 ; RV64I-NEXT: li a0, 0
2098 ; RV64I-NEXT: .LBB43_3: # Block address taken
2099 ; RV64I-NEXT: # %fail
2100 ; RV64I-NEXT: # Label of block must be emitted
2101 ; RV64I-NEXT: li a0, 1
2104 ; RV32I-MEDIUM-LABEL: constraint_A_with_multi_callbr_asm:
2105 ; RV32I-MEDIUM: # %bb.0: # %entry
2106 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi35:
2107 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
2108 ; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi35)
2109 ; RV32I-MEDIUM-NEXT: #APP
2110 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2111 ; RV32I-MEDIUM-NEXT: #NO_APP
2112 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal0
2113 ; RV32I-MEDIUM-NEXT: #APP
2114 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2115 ; RV32I-MEDIUM-NEXT: #NO_APP
2116 ; RV32I-MEDIUM-NEXT: # %bb.2: # %normal1
2117 ; RV32I-MEDIUM-NEXT: li a0, 0
2118 ; RV32I-MEDIUM-NEXT: ret
2119 ; RV32I-MEDIUM-NEXT: .LBB43_3: # Block address taken
2120 ; RV32I-MEDIUM-NEXT: # %fail
2121 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
2122 ; RV32I-MEDIUM-NEXT: li a0, 1
2123 ; RV32I-MEDIUM-NEXT: ret
2125 ; RV64I-MEDIUM-LABEL: constraint_A_with_multi_callbr_asm:
2126 ; RV64I-MEDIUM: # %bb.0: # %entry
2127 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi35:
2128 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
2129 ; RV64I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi35)
2130 ; RV64I-MEDIUM-NEXT: #APP
2131 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2132 ; RV64I-MEDIUM-NEXT: #NO_APP
2133 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal0
2134 ; RV64I-MEDIUM-NEXT: #APP
2135 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2136 ; RV64I-MEDIUM-NEXT: #NO_APP
2137 ; RV64I-MEDIUM-NEXT: # %bb.2: # %normal1
2138 ; RV64I-MEDIUM-NEXT: li a0, 0
2139 ; RV64I-MEDIUM-NEXT: ret
2140 ; RV64I-MEDIUM-NEXT: .LBB43_3: # Block address taken
2141 ; RV64I-MEDIUM-NEXT: # %fail
2142 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
2143 ; RV64I-MEDIUM-NEXT: li a0, 1
2144 ; RV64I-MEDIUM-NEXT: ret
2146 callbr void asm "sw zero, $0; beqz $1, $2", "=*A,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
2149 callbr void asm "sw zero, $0; beqz $1, $2", "=*A,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
2158 define void @constraint_A_with_local_1() nounwind {
2159 ; RV32I-LABEL: constraint_A_with_local_1:
2160 ; RV32I: # %bb.0: # %entry
2161 ; RV32I-NEXT: .Ltmp6: # Block address taken
2162 ; RV32I-NEXT: # %bb.1: # %label
2163 ; RV32I-NEXT: lui a0, %hi(.Ltmp6)
2164 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp6)
2166 ; RV32I-NEXT: lw zero, 0(a0)
2167 ; RV32I-NEXT: #NO_APP
2170 ; RV64I-LABEL: constraint_A_with_local_1:
2171 ; RV64I: # %bb.0: # %entry
2172 ; RV64I-NEXT: .Ltmp6: # Block address taken
2173 ; RV64I-NEXT: # %bb.1: # %label
2174 ; RV64I-NEXT: lui a0, %hi(.Ltmp6)
2175 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp6)
2177 ; RV64I-NEXT: lw zero, 0(a0)
2178 ; RV64I-NEXT: #NO_APP
2181 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_1:
2182 ; RV32I-MEDIUM: # %bb.0: # %entry
2183 ; RV32I-MEDIUM-NEXT: .Ltmp6: # Block address taken
2184 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2185 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi36:
2186 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp6)
2187 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi36)
2188 ; RV32I-MEDIUM-NEXT: #APP
2189 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
2190 ; RV32I-MEDIUM-NEXT: #NO_APP
2191 ; RV32I-MEDIUM-NEXT: ret
2193 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_1:
2194 ; RV64I-MEDIUM: # %bb.0: # %entry
2195 ; RV64I-MEDIUM-NEXT: .Ltmp6: # Block address taken
2196 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2197 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi36:
2198 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp6)
2199 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi36)
2200 ; RV64I-MEDIUM-NEXT: #APP
2201 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
2202 ; RV64I-MEDIUM-NEXT: #NO_APP
2203 ; RV64I-MEDIUM-NEXT: ret
2208 tail call void asm sideeffect "lw zero, $0", "*A"(ptr elementtype(ptr) blockaddress(@constraint_A_with_local_1, %label))
2212 define void @constraint_A_with_local_2() nounwind {
2213 ; RV32I-LABEL: constraint_A_with_local_2:
2214 ; RV32I: # %bb.0: # %entry
2215 ; RV32I-NEXT: .Ltmp7: # Block address taken
2216 ; RV32I-NEXT: # %bb.1: # %label
2217 ; RV32I-NEXT: lui a0, %hi(.Ltmp7+4)
2218 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp7+4)
2220 ; RV32I-NEXT: lw zero, 0(a0)
2221 ; RV32I-NEXT: #NO_APP
2224 ; RV64I-LABEL: constraint_A_with_local_2:
2225 ; RV64I: # %bb.0: # %entry
2226 ; RV64I-NEXT: .Ltmp7: # Block address taken
2227 ; RV64I-NEXT: # %bb.1: # %label
2228 ; RV64I-NEXT: lui a0, %hi(.Ltmp7+4)
2229 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp7+4)
2231 ; RV64I-NEXT: lw zero, 0(a0)
2232 ; RV64I-NEXT: #NO_APP
2235 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_2:
2236 ; RV32I-MEDIUM: # %bb.0: # %entry
2237 ; RV32I-MEDIUM-NEXT: .Ltmp7: # Block address taken
2238 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2239 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi37:
2240 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp7+4)
2241 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi37)
2242 ; RV32I-MEDIUM-NEXT: #APP
2243 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
2244 ; RV32I-MEDIUM-NEXT: #NO_APP
2245 ; RV32I-MEDIUM-NEXT: ret
2247 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_2:
2248 ; RV64I-MEDIUM: # %bb.0: # %entry
2249 ; RV64I-MEDIUM-NEXT: .Ltmp7: # Block address taken
2250 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2251 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi37:
2252 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp7+4)
2253 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi37)
2254 ; RV64I-MEDIUM-NEXT: #APP
2255 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
2256 ; RV64I-MEDIUM-NEXT: #NO_APP
2257 ; RV64I-MEDIUM-NEXT: ret
2262 call void asm "lw zero, $0", "*A"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_A_with_local_2, %label), i32 4))
2266 define void @constraint_A_with_local_3() nounwind {
2267 ; RV32I-LABEL: constraint_A_with_local_3:
2268 ; RV32I: # %bb.0: # %entry
2269 ; RV32I-NEXT: .Ltmp8: # Block address taken
2270 ; RV32I-NEXT: # %bb.1: # %label
2271 ; RV32I-NEXT: lui a0, %hi(.Ltmp8+2000)
2272 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp8+2000)
2274 ; RV32I-NEXT: lw zero, 0(a0)
2275 ; RV32I-NEXT: #NO_APP
2278 ; RV64I-LABEL: constraint_A_with_local_3:
2279 ; RV64I: # %bb.0: # %entry
2280 ; RV64I-NEXT: .Ltmp8: # Block address taken
2281 ; RV64I-NEXT: # %bb.1: # %label
2282 ; RV64I-NEXT: lui a0, %hi(.Ltmp8+2000)
2283 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp8+2000)
2285 ; RV64I-NEXT: lw zero, 0(a0)
2286 ; RV64I-NEXT: #NO_APP
2289 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_3:
2290 ; RV32I-MEDIUM: # %bb.0: # %entry
2291 ; RV32I-MEDIUM-NEXT: .Ltmp8: # Block address taken
2292 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2293 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi38:
2294 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp8+2000)
2295 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi38)
2296 ; RV32I-MEDIUM-NEXT: #APP
2297 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
2298 ; RV32I-MEDIUM-NEXT: #NO_APP
2299 ; RV32I-MEDIUM-NEXT: ret
2301 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_3:
2302 ; RV64I-MEDIUM: # %bb.0: # %entry
2303 ; RV64I-MEDIUM-NEXT: .Ltmp8: # Block address taken
2304 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2305 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi38:
2306 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp8+2000)
2307 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi38)
2308 ; RV64I-MEDIUM-NEXT: #APP
2309 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
2310 ; RV64I-MEDIUM-NEXT: #NO_APP
2311 ; RV64I-MEDIUM-NEXT: ret
2316 call void asm "lw zero, $0", "*A"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_A_with_local_3, %label), i32 2000))