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: #APP
129 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi0)(a0)
130 ; RV32I-MEDIUM-NEXT: #NO_APP
131 ; RV32I-MEDIUM-NEXT: ret
133 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_1:
134 ; RV64I-MEDIUM: # %bb.0:
135 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi0:
136 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
137 ; RV64I-MEDIUM-NEXT: #APP
138 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi0)(a0)
139 ; RV64I-MEDIUM-NEXT: #NO_APP
140 ; RV64I-MEDIUM-NEXT: ret
141 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
145 define void @constraint_m_with_global_2() nounwind {
146 ; RV32I-LABEL: constraint_m_with_global_2:
148 ; RV32I-NEXT: lui a0, %hi(eg+4)
150 ; RV32I-NEXT: sw zero, %lo(eg+4)(a0)
151 ; RV32I-NEXT: #NO_APP
154 ; RV64I-LABEL: constraint_m_with_global_2:
156 ; RV64I-NEXT: lui a0, %hi(eg+4)
158 ; RV64I-NEXT: sw zero, %lo(eg+4)(a0)
159 ; RV64I-NEXT: #NO_APP
162 ; RV32I-MEDIUM-LABEL: constraint_m_with_global_2:
163 ; RV32I-MEDIUM: # %bb.0:
164 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi1:
165 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
166 ; RV32I-MEDIUM-NEXT: #APP
167 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi1)(a0)
168 ; RV32I-MEDIUM-NEXT: #NO_APP
169 ; RV32I-MEDIUM-NEXT: ret
171 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_2:
172 ; RV64I-MEDIUM: # %bb.0:
173 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi1:
174 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
175 ; RV64I-MEDIUM-NEXT: #APP
176 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi1)(a0)
177 ; RV64I-MEDIUM-NEXT: #NO_APP
178 ; RV64I-MEDIUM-NEXT: ret
179 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
183 define void @constraint_m_with_global_3() nounwind {
184 ; RV32I-LABEL: constraint_m_with_global_3:
186 ; RV32I-NEXT: lui a0, %hi(eg+8000)
188 ; RV32I-NEXT: sw zero, %lo(eg+8000)(a0)
189 ; RV32I-NEXT: #NO_APP
192 ; RV64I-LABEL: constraint_m_with_global_3:
194 ; RV64I-NEXT: lui a0, %hi(eg+8000)
196 ; RV64I-NEXT: sw zero, %lo(eg+8000)(a0)
197 ; RV64I-NEXT: #NO_APP
200 ; RV32I-MEDIUM-LABEL: constraint_m_with_global_3:
201 ; RV32I-MEDIUM: # %bb.0:
202 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi2:
203 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
204 ; RV32I-MEDIUM-NEXT: #APP
205 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi2)(a0)
206 ; RV32I-MEDIUM-NEXT: #NO_APP
207 ; RV32I-MEDIUM-NEXT: ret
209 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_3:
210 ; RV64I-MEDIUM: # %bb.0:
211 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi2:
212 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
213 ; RV64I-MEDIUM-NEXT: #APP
214 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi2)(a0)
215 ; RV64I-MEDIUM-NEXT: #NO_APP
216 ; RV64I-MEDIUM-NEXT: ret
217 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 2000))
221 define void @constraint_m_with_extern_weak_global_1() nounwind {
222 ; RV32I-LABEL: constraint_m_with_extern_weak_global_1:
224 ; RV32I-NEXT: lui a0, %hi(ewg)
226 ; RV32I-NEXT: sw zero, %lo(ewg)(a0)
227 ; RV32I-NEXT: #NO_APP
230 ; RV64I-LABEL: constraint_m_with_extern_weak_global_1:
232 ; RV64I-NEXT: lui a0, %hi(ewg)
234 ; RV64I-NEXT: sw zero, %lo(ewg)(a0)
235 ; RV64I-NEXT: #NO_APP
238 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_1:
239 ; RV32I-MEDIUM: # %bb.0:
240 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi3:
241 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
242 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi3)(a0)
243 ; RV32I-MEDIUM-NEXT: #APP
244 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
245 ; RV32I-MEDIUM-NEXT: #NO_APP
246 ; RV32I-MEDIUM-NEXT: ret
248 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_1:
249 ; RV64I-MEDIUM: # %bb.0:
250 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi3:
251 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
252 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi3)(a0)
253 ; RV64I-MEDIUM-NEXT: #APP
254 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
255 ; RV64I-MEDIUM-NEXT: #NO_APP
256 ; RV64I-MEDIUM-NEXT: ret
257 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @ewg)
261 define void @constraint_m_with_extern_weak_global_2() nounwind {
262 ; RV32I-LABEL: constraint_m_with_extern_weak_global_2:
264 ; RV32I-NEXT: lui a0, %hi(ewg+4)
266 ; RV32I-NEXT: sw zero, %lo(ewg+4)(a0)
267 ; RV32I-NEXT: #NO_APP
270 ; RV64I-LABEL: constraint_m_with_extern_weak_global_2:
272 ; RV64I-NEXT: lui a0, %hi(ewg+4)
274 ; RV64I-NEXT: sw zero, %lo(ewg+4)(a0)
275 ; RV64I-NEXT: #NO_APP
278 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_2:
279 ; RV32I-MEDIUM: # %bb.0:
280 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi4:
281 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
282 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi4)(a0)
283 ; RV32I-MEDIUM-NEXT: #APP
284 ; RV32I-MEDIUM-NEXT: sw zero, 4(a0)
285 ; RV32I-MEDIUM-NEXT: #NO_APP
286 ; RV32I-MEDIUM-NEXT: ret
288 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_2:
289 ; RV64I-MEDIUM: # %bb.0:
290 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi4:
291 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
292 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi4)(a0)
293 ; RV64I-MEDIUM-NEXT: #APP
294 ; RV64I-MEDIUM-NEXT: sw zero, 4(a0)
295 ; RV64I-MEDIUM-NEXT: #NO_APP
296 ; RV64I-MEDIUM-NEXT: ret
297 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
301 define void @constraint_m_with_extern_weak_global_3() nounwind {
302 ; RV32I-LABEL: constraint_m_with_extern_weak_global_3:
304 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
306 ; RV32I-NEXT: sw zero, %lo(ewg+8000)(a0)
307 ; RV32I-NEXT: #NO_APP
310 ; RV64I-LABEL: constraint_m_with_extern_weak_global_3:
312 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
314 ; RV64I-NEXT: sw zero, %lo(ewg+8000)(a0)
315 ; RV64I-NEXT: #NO_APP
318 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_3:
319 ; RV32I-MEDIUM: # %bb.0:
320 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi5:
321 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
322 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi5)(a0)
323 ; RV32I-MEDIUM-NEXT: lui a1, 2
324 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
325 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
326 ; RV32I-MEDIUM-NEXT: #APP
327 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
328 ; RV32I-MEDIUM-NEXT: #NO_APP
329 ; RV32I-MEDIUM-NEXT: ret
331 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_3:
332 ; RV64I-MEDIUM: # %bb.0:
333 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi5:
334 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
335 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi5)(a0)
336 ; RV64I-MEDIUM-NEXT: lui a1, 2
337 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
338 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
339 ; RV64I-MEDIUM-NEXT: #APP
340 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
341 ; RV64I-MEDIUM-NEXT: #NO_APP
342 ; RV64I-MEDIUM-NEXT: ret
343 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
347 define void @constraint_m_with_local_1() nounwind {
348 ; RV32I-LABEL: constraint_m_with_local_1:
349 ; RV32I: # %bb.0: # %entry
350 ; RV32I-NEXT: .Ltmp0: # Block address taken
351 ; RV32I-NEXT: # %bb.1: # %label
352 ; RV32I-NEXT: lui a0, %hi(.Ltmp0)
354 ; RV32I-NEXT: lw zero, %lo(.Ltmp0)(a0)
355 ; RV32I-NEXT: #NO_APP
358 ; RV64I-LABEL: constraint_m_with_local_1:
359 ; RV64I: # %bb.0: # %entry
360 ; RV64I-NEXT: .Ltmp0: # Block address taken
361 ; RV64I-NEXT: # %bb.1: # %label
362 ; RV64I-NEXT: lui a0, %hi(.Ltmp0)
364 ; RV64I-NEXT: lw zero, %lo(.Ltmp0)(a0)
365 ; RV64I-NEXT: #NO_APP
368 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_1:
369 ; RV32I-MEDIUM: # %bb.0: # %entry
370 ; RV32I-MEDIUM-NEXT: .Ltmp0: # Block address taken
371 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
372 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi6:
373 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp0)
374 ; RV32I-MEDIUM-NEXT: #APP
375 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi6)(a0)
376 ; RV32I-MEDIUM-NEXT: #NO_APP
377 ; RV32I-MEDIUM-NEXT: ret
379 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_1:
380 ; RV64I-MEDIUM: # %bb.0: # %entry
381 ; RV64I-MEDIUM-NEXT: .Ltmp0: # Block address taken
382 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
383 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi6:
384 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp0)
385 ; RV64I-MEDIUM-NEXT: #APP
386 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi6)(a0)
387 ; RV64I-MEDIUM-NEXT: #NO_APP
388 ; RV64I-MEDIUM-NEXT: ret
393 tail call void asm sideeffect "lw zero, $0", "*m"(ptr elementtype(ptr) blockaddress(@constraint_m_with_local_1, %label))
397 define void @constraint_m_with_local_2() nounwind {
398 ; RV32I-LABEL: constraint_m_with_local_2:
399 ; RV32I: # %bb.0: # %entry
400 ; RV32I-NEXT: .Ltmp1: # Block address taken
401 ; RV32I-NEXT: # %bb.1: # %label
402 ; RV32I-NEXT: lui a0, %hi(.Ltmp1+4)
404 ; RV32I-NEXT: lw zero, %lo(.Ltmp1+4)(a0)
405 ; RV32I-NEXT: #NO_APP
408 ; RV64I-LABEL: constraint_m_with_local_2:
409 ; RV64I: # %bb.0: # %entry
410 ; RV64I-NEXT: .Ltmp1: # Block address taken
411 ; RV64I-NEXT: # %bb.1: # %label
412 ; RV64I-NEXT: lui a0, %hi(.Ltmp1+4)
414 ; RV64I-NEXT: lw zero, %lo(.Ltmp1+4)(a0)
415 ; RV64I-NEXT: #NO_APP
418 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_2:
419 ; RV32I-MEDIUM: # %bb.0: # %entry
420 ; RV32I-MEDIUM-NEXT: .Ltmp1: # Block address taken
421 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
422 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi7:
423 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp1+4)
424 ; RV32I-MEDIUM-NEXT: #APP
425 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi7)(a0)
426 ; RV32I-MEDIUM-NEXT: #NO_APP
427 ; RV32I-MEDIUM-NEXT: ret
429 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_2:
430 ; RV64I-MEDIUM: # %bb.0: # %entry
431 ; RV64I-MEDIUM-NEXT: .Ltmp1: # Block address taken
432 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
433 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi7:
434 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp1+4)
435 ; RV64I-MEDIUM-NEXT: #APP
436 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi7)(a0)
437 ; RV64I-MEDIUM-NEXT: #NO_APP
438 ; RV64I-MEDIUM-NEXT: ret
443 call void asm "lw zero, $0", "*m"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_m_with_local_2, %label), i32 4))
447 define void @constraint_m_with_local_3() nounwind {
448 ; RV32I-LABEL: constraint_m_with_local_3:
449 ; RV32I: # %bb.0: # %entry
450 ; RV32I-NEXT: .Ltmp2: # Block address taken
451 ; RV32I-NEXT: # %bb.1: # %label
452 ; RV32I-NEXT: lui a0, %hi(.Ltmp2+2000)
454 ; RV32I-NEXT: lw zero, %lo(.Ltmp2+2000)(a0)
455 ; RV32I-NEXT: #NO_APP
458 ; RV64I-LABEL: constraint_m_with_local_3:
459 ; RV64I: # %bb.0: # %entry
460 ; RV64I-NEXT: .Ltmp2: # Block address taken
461 ; RV64I-NEXT: # %bb.1: # %label
462 ; RV64I-NEXT: lui a0, %hi(.Ltmp2+2000)
464 ; RV64I-NEXT: lw zero, %lo(.Ltmp2+2000)(a0)
465 ; RV64I-NEXT: #NO_APP
468 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_3:
469 ; RV32I-MEDIUM: # %bb.0: # %entry
470 ; RV32I-MEDIUM-NEXT: .Ltmp2: # Block address taken
471 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
472 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi8:
473 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp2+2000)
474 ; RV32I-MEDIUM-NEXT: #APP
475 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi8)(a0)
476 ; RV32I-MEDIUM-NEXT: #NO_APP
477 ; RV32I-MEDIUM-NEXT: ret
479 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_3:
480 ; RV64I-MEDIUM: # %bb.0: # %entry
481 ; RV64I-MEDIUM-NEXT: .Ltmp2: # Block address taken
482 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
483 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi8:
484 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp2+2000)
485 ; RV64I-MEDIUM-NEXT: #APP
486 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi8)(a0)
487 ; RV64I-MEDIUM-NEXT: #NO_APP
488 ; RV64I-MEDIUM-NEXT: ret
493 call void asm "lw zero, $0", "*m"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_m_with_local_3, %label), i32 2000))
497 define void @constraint_m_with_multi_operands() nounwind {
498 ; RV32I-LABEL: constraint_m_with_multi_operands:
500 ; RV32I-NEXT: lui a0, %hi(eg)
502 ; RV32I-NEXT: sw zero, %lo(eg)(a0); sw zero, %lo(eg)(a0)
503 ; RV32I-NEXT: #NO_APP
506 ; RV64I-LABEL: constraint_m_with_multi_operands:
508 ; RV64I-NEXT: lui a0, %hi(eg)
510 ; RV64I-NEXT: sw zero, %lo(eg)(a0); sw zero, %lo(eg)(a0)
511 ; RV64I-NEXT: #NO_APP
514 ; RV32I-MEDIUM-LABEL: constraint_m_with_multi_operands:
515 ; RV32I-MEDIUM: # %bb.0:
516 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi9:
517 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
518 ; RV32I-MEDIUM-NEXT: #APP
519 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi9)(a0); sw zero, %pcrel_lo(.Lpcrel_hi9)(a0)
520 ; RV32I-MEDIUM-NEXT: #NO_APP
521 ; RV32I-MEDIUM-NEXT: ret
523 ; RV64I-MEDIUM-LABEL: constraint_m_with_multi_operands:
524 ; RV64I-MEDIUM: # %bb.0:
525 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi9:
526 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
527 ; RV64I-MEDIUM-NEXT: #APP
528 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi9)(a0); sw zero, %pcrel_lo(.Lpcrel_hi9)(a0)
529 ; RV64I-MEDIUM-NEXT: #NO_APP
530 ; RV64I-MEDIUM-NEXT: ret
531 call void asm "sw zero, $0; sw zero, $1", "=*m,=*m"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
535 define void @constraint_m_with_multi_asm() nounwind {
536 ; RV32I-LABEL: constraint_m_with_multi_asm:
538 ; RV32I-NEXT: lui a0, %hi(eg)
540 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
541 ; RV32I-NEXT: #NO_APP
543 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
544 ; RV32I-NEXT: #NO_APP
547 ; RV64I-LABEL: constraint_m_with_multi_asm:
549 ; RV64I-NEXT: lui a0, %hi(eg)
551 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
552 ; RV64I-NEXT: #NO_APP
554 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
555 ; RV64I-NEXT: #NO_APP
558 ; RV32I-MEDIUM-LABEL: constraint_m_with_multi_asm:
559 ; RV32I-MEDIUM: # %bb.0:
560 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi10:
561 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
562 ; RV32I-MEDIUM-NEXT: #APP
563 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi10)(a0)
564 ; RV32I-MEDIUM-NEXT: #NO_APP
565 ; RV32I-MEDIUM-NEXT: #APP
566 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi10)(a0)
567 ; RV32I-MEDIUM-NEXT: #NO_APP
568 ; RV32I-MEDIUM-NEXT: ret
570 ; RV64I-MEDIUM-LABEL: constraint_m_with_multi_asm:
571 ; RV64I-MEDIUM: # %bb.0:
572 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi10:
573 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
574 ; RV64I-MEDIUM-NEXT: #APP
575 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi10)(a0)
576 ; RV64I-MEDIUM-NEXT: #NO_APP
577 ; RV64I-MEDIUM-NEXT: #APP
578 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi10)(a0)
579 ; RV64I-MEDIUM-NEXT: #NO_APP
580 ; RV64I-MEDIUM-NEXT: ret
581 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
582 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
586 define i32 @constraint_m_with_callbr_multi_operands(i32 %a) {
587 ; RV32I-LABEL: constraint_m_with_callbr_multi_operands:
588 ; RV32I: # %bb.0: # %entry
589 ; RV32I-NEXT: lui a1, %hi(eg)
591 ; RV32I-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB14_2
592 ; RV32I-NEXT: #NO_APP
593 ; RV32I-NEXT: # %bb.1: # %normal
594 ; RV32I-NEXT: li a0, 0
596 ; RV32I-NEXT: .LBB14_2: # Block address taken
597 ; RV32I-NEXT: # %fail
598 ; RV32I-NEXT: # Label of block must be emitted
599 ; RV32I-NEXT: li a0, 1
602 ; RV64I-LABEL: constraint_m_with_callbr_multi_operands:
603 ; RV64I: # %bb.0: # %entry
604 ; RV64I-NEXT: lui a1, %hi(eg)
606 ; RV64I-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB14_2
607 ; RV64I-NEXT: #NO_APP
608 ; RV64I-NEXT: # %bb.1: # %normal
609 ; RV64I-NEXT: li a0, 0
611 ; RV64I-NEXT: .LBB14_2: # Block address taken
612 ; RV64I-NEXT: # %fail
613 ; RV64I-NEXT: # Label of block must be emitted
614 ; RV64I-NEXT: li a0, 1
617 ; RV32I-MEDIUM-LABEL: constraint_m_with_callbr_multi_operands:
618 ; RV32I-MEDIUM: # %bb.0: # %entry
619 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi11:
620 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
621 ; RV32I-MEDIUM-NEXT: #APP
622 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi11)(a1); sw zero, %pcrel_lo(.Lpcrel_hi11)(a1); beqz a0, .LBB14_2
623 ; RV32I-MEDIUM-NEXT: #NO_APP
624 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal
625 ; RV32I-MEDIUM-NEXT: li a0, 0
626 ; RV32I-MEDIUM-NEXT: ret
627 ; RV32I-MEDIUM-NEXT: .LBB14_2: # Block address taken
628 ; RV32I-MEDIUM-NEXT: # %fail
629 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
630 ; RV32I-MEDIUM-NEXT: li a0, 1
631 ; RV32I-MEDIUM-NEXT: ret
633 ; RV64I-MEDIUM-LABEL: constraint_m_with_callbr_multi_operands:
634 ; RV64I-MEDIUM: # %bb.0: # %entry
635 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi11:
636 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
637 ; RV64I-MEDIUM-NEXT: #APP
638 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi11)(a1); sw zero, %pcrel_lo(.Lpcrel_hi11)(a1); beqz a0, .LBB14_2
639 ; RV64I-MEDIUM-NEXT: #NO_APP
640 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal
641 ; RV64I-MEDIUM-NEXT: li a0, 0
642 ; RV64I-MEDIUM-NEXT: ret
643 ; RV64I-MEDIUM-NEXT: .LBB14_2: # Block address taken
644 ; RV64I-MEDIUM-NEXT: # %fail
645 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
646 ; RV64I-MEDIUM-NEXT: li a0, 1
647 ; RV64I-MEDIUM-NEXT: ret
649 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]
658 define i32 @constraint_m_with_multi_callbr_asm(i32 %a) {
659 ; RV32I-LABEL: constraint_m_with_multi_callbr_asm:
660 ; RV32I: # %bb.0: # %entry
661 ; RV32I-NEXT: lui a1, %hi(eg)
663 ; RV32I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
664 ; RV32I-NEXT: #NO_APP
665 ; RV32I-NEXT: # %bb.1: # %normal0
667 ; RV32I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
668 ; RV32I-NEXT: #NO_APP
669 ; RV32I-NEXT: # %bb.2: # %normal1
670 ; RV32I-NEXT: li a0, 0
672 ; RV32I-NEXT: .LBB15_3: # Block address taken
673 ; RV32I-NEXT: # %fail
674 ; RV32I-NEXT: # Label of block must be emitted
675 ; RV32I-NEXT: li a0, 1
678 ; RV64I-LABEL: constraint_m_with_multi_callbr_asm:
679 ; RV64I: # %bb.0: # %entry
680 ; RV64I-NEXT: lui a1, %hi(eg)
682 ; RV64I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
683 ; RV64I-NEXT: #NO_APP
684 ; RV64I-NEXT: # %bb.1: # %normal0
686 ; RV64I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
687 ; RV64I-NEXT: #NO_APP
688 ; RV64I-NEXT: # %bb.2: # %normal1
689 ; RV64I-NEXT: li a0, 0
691 ; RV64I-NEXT: .LBB15_3: # Block address taken
692 ; RV64I-NEXT: # %fail
693 ; RV64I-NEXT: # Label of block must be emitted
694 ; RV64I-NEXT: li a0, 1
697 ; RV32I-MEDIUM-LABEL: constraint_m_with_multi_callbr_asm:
698 ; RV32I-MEDIUM: # %bb.0: # %entry
699 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi12:
700 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
701 ; RV32I-MEDIUM-NEXT: #APP
702 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1); beqz a0, .LBB15_3
703 ; RV32I-MEDIUM-NEXT: #NO_APP
704 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal0
705 ; RV32I-MEDIUM-NEXT: #APP
706 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1); beqz a0, .LBB15_3
707 ; RV32I-MEDIUM-NEXT: #NO_APP
708 ; RV32I-MEDIUM-NEXT: # %bb.2: # %normal1
709 ; RV32I-MEDIUM-NEXT: li a0, 0
710 ; RV32I-MEDIUM-NEXT: ret
711 ; RV32I-MEDIUM-NEXT: .LBB15_3: # Block address taken
712 ; RV32I-MEDIUM-NEXT: # %fail
713 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
714 ; RV32I-MEDIUM-NEXT: li a0, 1
715 ; RV32I-MEDIUM-NEXT: ret
717 ; RV64I-MEDIUM-LABEL: constraint_m_with_multi_callbr_asm:
718 ; RV64I-MEDIUM: # %bb.0: # %entry
719 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi12:
720 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
721 ; RV64I-MEDIUM-NEXT: #APP
722 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1); beqz a0, .LBB15_3
723 ; RV64I-MEDIUM-NEXT: #NO_APP
724 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal0
725 ; RV64I-MEDIUM-NEXT: #APP
726 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1); beqz a0, .LBB15_3
727 ; RV64I-MEDIUM-NEXT: #NO_APP
728 ; RV64I-MEDIUM-NEXT: # %bb.2: # %normal1
729 ; RV64I-MEDIUM-NEXT: li a0, 0
730 ; RV64I-MEDIUM-NEXT: ret
731 ; RV64I-MEDIUM-NEXT: .LBB15_3: # Block address taken
732 ; RV64I-MEDIUM-NEXT: # %fail
733 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
734 ; RV64I-MEDIUM-NEXT: li a0, 1
735 ; RV64I-MEDIUM-NEXT: ret
737 callbr void asm "sw zero, $0; beqz $1, $2", "=*m,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
740 callbr void asm "sw zero, $0; beqz $1, $2", "=*m,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
749 define void @constraint_o_1(ptr %a) nounwind {
750 ; RV32I-LABEL: constraint_o_1:
753 ; RV32I-NEXT: #NO_APP
756 ; RV64I-LABEL: constraint_o_1:
759 ; RV64I-NEXT: #NO_APP
762 ; RV32I-MEDIUM-LABEL: constraint_o_1:
763 ; RV32I-MEDIUM: # %bb.0:
764 ; RV32I-MEDIUM-NEXT: #APP
765 ; RV32I-MEDIUM-NEXT: #NO_APP
766 ; RV32I-MEDIUM-NEXT: ret
768 ; RV64I-MEDIUM-LABEL: constraint_o_1:
769 ; RV64I-MEDIUM: # %bb.0:
770 ; RV64I-MEDIUM-NEXT: #APP
771 ; RV64I-MEDIUM-NEXT: #NO_APP
772 ; RV64I-MEDIUM-NEXT: ret
773 call void asm sideeffect "", "=*o"(ptr elementtype(i32) %a)
777 define i32 @constraint_o_2(ptr %a) nounwind {
778 ; RV32I-LABEL: constraint_o_2:
781 ; RV32I-NEXT: lw a0, 0(a0)
782 ; RV32I-NEXT: #NO_APP
785 ; RV64I-LABEL: constraint_o_2:
788 ; RV64I-NEXT: lw a0, 0(a0)
789 ; RV64I-NEXT: #NO_APP
792 ; RV32I-MEDIUM-LABEL: constraint_o_2:
793 ; RV32I-MEDIUM: # %bb.0:
794 ; RV32I-MEDIUM-NEXT: #APP
795 ; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
796 ; RV32I-MEDIUM-NEXT: #NO_APP
797 ; RV32I-MEDIUM-NEXT: ret
799 ; RV64I-MEDIUM-LABEL: constraint_o_2:
800 ; RV64I-MEDIUM: # %bb.0:
801 ; RV64I-MEDIUM-NEXT: #APP
802 ; RV64I-MEDIUM-NEXT: lw a0, 0(a0)
803 ; RV64I-MEDIUM-NEXT: #NO_APP
804 ; RV64I-MEDIUM-NEXT: ret
805 %1 = tail call i32 asm "lw $0, $1", "=r,*o"(ptr elementtype(i32) %a)
809 define i32 @constraint_o_with_offset(ptr %a) nounwind {
810 ; RV32I-LABEL: constraint_o_with_offset:
813 ; RV32I-NEXT: lw a0, 4(a0)
814 ; RV32I-NEXT: #NO_APP
817 ; RV64I-LABEL: constraint_o_with_offset:
820 ; RV64I-NEXT: lw a0, 4(a0)
821 ; RV64I-NEXT: #NO_APP
824 ; RV32I-MEDIUM-LABEL: constraint_o_with_offset:
825 ; RV32I-MEDIUM: # %bb.0:
826 ; RV32I-MEDIUM-NEXT: #APP
827 ; RV32I-MEDIUM-NEXT: lw a0, 4(a0)
828 ; RV32I-MEDIUM-NEXT: #NO_APP
829 ; RV32I-MEDIUM-NEXT: ret
831 ; RV64I-MEDIUM-LABEL: constraint_o_with_offset:
832 ; RV64I-MEDIUM: # %bb.0:
833 ; RV64I-MEDIUM-NEXT: #APP
834 ; RV64I-MEDIUM-NEXT: lw a0, 4(a0)
835 ; RV64I-MEDIUM-NEXT: #NO_APP
836 ; RV64I-MEDIUM-NEXT: ret
837 %1 = getelementptr i32, ptr %a, i32 1
838 %2 = tail call i32 asm "lw $0, $1", "=r,*o"(ptr elementtype(i32) %1)
842 define void @constraint_o_with_global_1() nounwind {
843 ; RV32I-LABEL: constraint_o_with_global_1:
845 ; RV32I-NEXT: lui a0, %hi(eg)
847 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
848 ; RV32I-NEXT: #NO_APP
851 ; RV64I-LABEL: constraint_o_with_global_1:
853 ; RV64I-NEXT: lui a0, %hi(eg)
855 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
856 ; RV64I-NEXT: #NO_APP
859 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_1:
860 ; RV32I-MEDIUM: # %bb.0:
861 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi13:
862 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
863 ; RV32I-MEDIUM-NEXT: #APP
864 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi13)(a0)
865 ; RV32I-MEDIUM-NEXT: #NO_APP
866 ; RV32I-MEDIUM-NEXT: ret
868 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_1:
869 ; RV64I-MEDIUM: # %bb.0:
870 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi13:
871 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
872 ; RV64I-MEDIUM-NEXT: #APP
873 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi13)(a0)
874 ; RV64I-MEDIUM-NEXT: #NO_APP
875 ; RV64I-MEDIUM-NEXT: ret
876 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
880 define void @constraint_o_with_global_2() nounwind {
881 ; RV32I-LABEL: constraint_o_with_global_2:
883 ; RV32I-NEXT: lui a0, %hi(eg+4)
885 ; RV32I-NEXT: sw zero, %lo(eg+4)(a0)
886 ; RV32I-NEXT: #NO_APP
889 ; RV64I-LABEL: constraint_o_with_global_2:
891 ; RV64I-NEXT: lui a0, %hi(eg+4)
893 ; RV64I-NEXT: sw zero, %lo(eg+4)(a0)
894 ; RV64I-NEXT: #NO_APP
897 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_2:
898 ; RV32I-MEDIUM: # %bb.0:
899 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi14:
900 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
901 ; RV32I-MEDIUM-NEXT: #APP
902 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi14)(a0)
903 ; RV32I-MEDIUM-NEXT: #NO_APP
904 ; RV32I-MEDIUM-NEXT: ret
906 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_2:
907 ; RV64I-MEDIUM: # %bb.0:
908 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi14:
909 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
910 ; RV64I-MEDIUM-NEXT: #APP
911 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi14)(a0)
912 ; RV64I-MEDIUM-NEXT: #NO_APP
913 ; RV64I-MEDIUM-NEXT: ret
914 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
918 define void @constraint_o_with_global_3() nounwind {
919 ; RV32I-LABEL: constraint_o_with_global_3:
921 ; RV32I-NEXT: lui a0, %hi(eg+8000)
923 ; RV32I-NEXT: sw zero, %lo(eg+8000)(a0)
924 ; RV32I-NEXT: #NO_APP
927 ; RV64I-LABEL: constraint_o_with_global_3:
929 ; RV64I-NEXT: lui a0, %hi(eg+8000)
931 ; RV64I-NEXT: sw zero, %lo(eg+8000)(a0)
932 ; RV64I-NEXT: #NO_APP
935 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_3:
936 ; RV32I-MEDIUM: # %bb.0:
937 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi15:
938 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
939 ; RV32I-MEDIUM-NEXT: #APP
940 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi15)(a0)
941 ; RV32I-MEDIUM-NEXT: #NO_APP
942 ; RV32I-MEDIUM-NEXT: ret
944 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_3:
945 ; RV64I-MEDIUM: # %bb.0:
946 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi15:
947 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
948 ; RV64I-MEDIUM-NEXT: #APP
949 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi15)(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 2000))
956 define void @constraint_o_with_extern_weak_global_1() nounwind {
957 ; RV32I-LABEL: constraint_o_with_extern_weak_global_1:
959 ; RV32I-NEXT: lui a0, %hi(ewg)
961 ; RV32I-NEXT: sw zero, %lo(ewg)(a0)
962 ; RV32I-NEXT: #NO_APP
965 ; RV64I-LABEL: constraint_o_with_extern_weak_global_1:
967 ; RV64I-NEXT: lui a0, %hi(ewg)
969 ; RV64I-NEXT: sw zero, %lo(ewg)(a0)
970 ; RV64I-NEXT: #NO_APP
973 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_1:
974 ; RV32I-MEDIUM: # %bb.0:
975 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi16:
976 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
977 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi16)(a0)
978 ; RV32I-MEDIUM-NEXT: #APP
979 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
980 ; RV32I-MEDIUM-NEXT: #NO_APP
981 ; RV32I-MEDIUM-NEXT: ret
983 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_1:
984 ; RV64I-MEDIUM: # %bb.0:
985 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi16:
986 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
987 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi16)(a0)
988 ; RV64I-MEDIUM-NEXT: #APP
989 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
990 ; RV64I-MEDIUM-NEXT: #NO_APP
991 ; RV64I-MEDIUM-NEXT: ret
992 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @ewg)
996 define void @constraint_o_with_extern_weak_global_2() nounwind {
997 ; RV32I-LABEL: constraint_o_with_extern_weak_global_2:
999 ; RV32I-NEXT: lui a0, %hi(ewg+4)
1001 ; RV32I-NEXT: sw zero, %lo(ewg+4)(a0)
1002 ; RV32I-NEXT: #NO_APP
1005 ; RV64I-LABEL: constraint_o_with_extern_weak_global_2:
1007 ; RV64I-NEXT: lui a0, %hi(ewg+4)
1009 ; RV64I-NEXT: sw zero, %lo(ewg+4)(a0)
1010 ; RV64I-NEXT: #NO_APP
1013 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_2:
1014 ; RV32I-MEDIUM: # %bb.0:
1015 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi17:
1016 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1017 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi17)(a0)
1018 ; RV32I-MEDIUM-NEXT: #APP
1019 ; RV32I-MEDIUM-NEXT: sw zero, 4(a0)
1020 ; RV32I-MEDIUM-NEXT: #NO_APP
1021 ; RV32I-MEDIUM-NEXT: ret
1023 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_2:
1024 ; RV64I-MEDIUM: # %bb.0:
1025 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi17:
1026 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1027 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi17)(a0)
1028 ; RV64I-MEDIUM-NEXT: #APP
1029 ; RV64I-MEDIUM-NEXT: sw zero, 4(a0)
1030 ; RV64I-MEDIUM-NEXT: #NO_APP
1031 ; RV64I-MEDIUM-NEXT: ret
1032 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
1036 define void @constraint_o_with_extern_weak_global_3() nounwind {
1037 ; RV32I-LABEL: constraint_o_with_extern_weak_global_3:
1039 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
1041 ; RV32I-NEXT: sw zero, %lo(ewg+8000)(a0)
1042 ; RV32I-NEXT: #NO_APP
1045 ; RV64I-LABEL: constraint_o_with_extern_weak_global_3:
1047 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
1049 ; RV64I-NEXT: sw zero, %lo(ewg+8000)(a0)
1050 ; RV64I-NEXT: #NO_APP
1053 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_3:
1054 ; RV32I-MEDIUM: # %bb.0:
1055 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi18:
1056 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1057 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi18)(a0)
1058 ; RV32I-MEDIUM-NEXT: lui a1, 2
1059 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
1060 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
1061 ; RV32I-MEDIUM-NEXT: #APP
1062 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1063 ; RV32I-MEDIUM-NEXT: #NO_APP
1064 ; RV32I-MEDIUM-NEXT: ret
1066 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_3:
1067 ; RV64I-MEDIUM: # %bb.0:
1068 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi18:
1069 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1070 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi18)(a0)
1071 ; RV64I-MEDIUM-NEXT: lui a1, 2
1072 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
1073 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
1074 ; RV64I-MEDIUM-NEXT: #APP
1075 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1076 ; RV64I-MEDIUM-NEXT: #NO_APP
1077 ; RV64I-MEDIUM-NEXT: ret
1078 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
1082 define void @constraint_o_with_multi_operands() nounwind {
1083 ; RV32I-LABEL: constraint_o_with_multi_operands:
1085 ; RV32I-NEXT: lui a0, %hi(eg)
1087 ; RV32I-NEXT: sw zero, %lo(eg)(a0) \n sw zero, %lo(eg)(a0)
1088 ; RV32I-NEXT: #NO_APP
1091 ; RV64I-LABEL: constraint_o_with_multi_operands:
1093 ; RV64I-NEXT: lui a0, %hi(eg)
1095 ; RV64I-NEXT: sw zero, %lo(eg)(a0) \n sw zero, %lo(eg)(a0)
1096 ; RV64I-NEXT: #NO_APP
1099 ; RV32I-MEDIUM-LABEL: constraint_o_with_multi_operands:
1100 ; RV32I-MEDIUM: # %bb.0:
1101 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi19:
1102 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1103 ; RV32I-MEDIUM-NEXT: #APP
1104 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi19)(a0) \n sw zero, %pcrel_lo(.Lpcrel_hi19)(a0)
1105 ; RV32I-MEDIUM-NEXT: #NO_APP
1106 ; RV32I-MEDIUM-NEXT: ret
1108 ; RV64I-MEDIUM-LABEL: constraint_o_with_multi_operands:
1109 ; RV64I-MEDIUM: # %bb.0:
1110 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi19:
1111 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1112 ; RV64I-MEDIUM-NEXT: #APP
1113 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi19)(a0) \n sw zero, %pcrel_lo(.Lpcrel_hi19)(a0)
1114 ; RV64I-MEDIUM-NEXT: #NO_APP
1115 ; RV64I-MEDIUM-NEXT: ret
1116 call void asm "sw zero, $0 \n sw zero, $1", "=*o,=*o"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
1120 define void @constraint_o_with_multi_asm() nounwind {
1121 ; RV32I-LABEL: constraint_o_with_multi_asm:
1123 ; RV32I-NEXT: lui a0, %hi(eg)
1125 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
1126 ; RV32I-NEXT: #NO_APP
1128 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
1129 ; RV32I-NEXT: #NO_APP
1132 ; RV64I-LABEL: constraint_o_with_multi_asm:
1134 ; RV64I-NEXT: lui a0, %hi(eg)
1136 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
1137 ; RV64I-NEXT: #NO_APP
1139 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
1140 ; RV64I-NEXT: #NO_APP
1143 ; RV32I-MEDIUM-LABEL: constraint_o_with_multi_asm:
1144 ; RV32I-MEDIUM: # %bb.0:
1145 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi20:
1146 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1147 ; RV32I-MEDIUM-NEXT: #APP
1148 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a0)
1149 ; RV32I-MEDIUM-NEXT: #NO_APP
1150 ; RV32I-MEDIUM-NEXT: #APP
1151 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a0)
1152 ; RV32I-MEDIUM-NEXT: #NO_APP
1153 ; RV32I-MEDIUM-NEXT: ret
1155 ; RV64I-MEDIUM-LABEL: constraint_o_with_multi_asm:
1156 ; RV64I-MEDIUM: # %bb.0:
1157 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi20:
1158 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1159 ; RV64I-MEDIUM-NEXT: #APP
1160 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a0)
1161 ; RV64I-MEDIUM-NEXT: #NO_APP
1162 ; RV64I-MEDIUM-NEXT: #APP
1163 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a0)
1164 ; RV64I-MEDIUM-NEXT: #NO_APP
1165 ; RV64I-MEDIUM-NEXT: ret
1166 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
1167 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
1171 define i32 @constraint_o_with_callbr_multi_operands(i32 %a) {
1172 ; RV32I-LABEL: constraint_o_with_callbr_multi_operands:
1173 ; RV32I: # %bb.0: # %entry
1174 ; RV32I-NEXT: lui a1, %hi(eg)
1176 ; RV32I-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB27_2
1177 ; RV32I-NEXT: #NO_APP
1178 ; RV32I-NEXT: # %bb.1: # %normal
1179 ; RV32I-NEXT: li a0, 0
1181 ; RV32I-NEXT: .LBB27_2: # Block address taken
1182 ; RV32I-NEXT: # %fail
1183 ; RV32I-NEXT: # Label of block must be emitted
1184 ; RV32I-NEXT: li a0, 1
1187 ; RV64I-LABEL: constraint_o_with_callbr_multi_operands:
1188 ; RV64I: # %bb.0: # %entry
1189 ; RV64I-NEXT: lui a1, %hi(eg)
1191 ; RV64I-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB27_2
1192 ; RV64I-NEXT: #NO_APP
1193 ; RV64I-NEXT: # %bb.1: # %normal
1194 ; RV64I-NEXT: li a0, 0
1196 ; RV64I-NEXT: .LBB27_2: # Block address taken
1197 ; RV64I-NEXT: # %fail
1198 ; RV64I-NEXT: # Label of block must be emitted
1199 ; RV64I-NEXT: li a0, 1
1202 ; RV32I-MEDIUM-LABEL: constraint_o_with_callbr_multi_operands:
1203 ; RV32I-MEDIUM: # %bb.0: # %entry
1204 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi21:
1205 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1206 ; RV32I-MEDIUM-NEXT: #APP
1207 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1); sw zero, %pcrel_lo(.Lpcrel_hi21)(a1); beqz a0, .LBB27_2
1208 ; RV32I-MEDIUM-NEXT: #NO_APP
1209 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal
1210 ; RV32I-MEDIUM-NEXT: li a0, 0
1211 ; RV32I-MEDIUM-NEXT: ret
1212 ; RV32I-MEDIUM-NEXT: .LBB27_2: # Block address taken
1213 ; RV32I-MEDIUM-NEXT: # %fail
1214 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
1215 ; RV32I-MEDIUM-NEXT: li a0, 1
1216 ; RV32I-MEDIUM-NEXT: ret
1218 ; RV64I-MEDIUM-LABEL: constraint_o_with_callbr_multi_operands:
1219 ; RV64I-MEDIUM: # %bb.0: # %entry
1220 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi21:
1221 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1222 ; RV64I-MEDIUM-NEXT: #APP
1223 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1); sw zero, %pcrel_lo(.Lpcrel_hi21)(a1); beqz a0, .LBB27_2
1224 ; RV64I-MEDIUM-NEXT: #NO_APP
1225 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal
1226 ; RV64I-MEDIUM-NEXT: li a0, 0
1227 ; RV64I-MEDIUM-NEXT: ret
1228 ; RV64I-MEDIUM-NEXT: .LBB27_2: # Block address taken
1229 ; RV64I-MEDIUM-NEXT: # %fail
1230 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
1231 ; RV64I-MEDIUM-NEXT: li a0, 1
1232 ; RV64I-MEDIUM-NEXT: ret
1234 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]
1243 define i32 @constraint_o_with_multi_callbr_asm(i32 %a) {
1244 ; RV32I-LABEL: constraint_o_with_multi_callbr_asm:
1245 ; RV32I: # %bb.0: # %entry
1246 ; RV32I-NEXT: lui a1, %hi(eg)
1248 ; RV32I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB28_3
1249 ; RV32I-NEXT: #NO_APP
1250 ; RV32I-NEXT: # %bb.1: # %normal0
1252 ; RV32I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB28_3
1253 ; RV32I-NEXT: #NO_APP
1254 ; RV32I-NEXT: # %bb.2: # %normal1
1255 ; RV32I-NEXT: li a0, 0
1257 ; RV32I-NEXT: .LBB28_3: # Block address taken
1258 ; RV32I-NEXT: # %fail
1259 ; RV32I-NEXT: # Label of block must be emitted
1260 ; RV32I-NEXT: li a0, 1
1263 ; RV64I-LABEL: constraint_o_with_multi_callbr_asm:
1264 ; RV64I: # %bb.0: # %entry
1265 ; RV64I-NEXT: lui a1, %hi(eg)
1267 ; RV64I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB28_3
1268 ; RV64I-NEXT: #NO_APP
1269 ; RV64I-NEXT: # %bb.1: # %normal0
1271 ; RV64I-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB28_3
1272 ; RV64I-NEXT: #NO_APP
1273 ; RV64I-NEXT: # %bb.2: # %normal1
1274 ; RV64I-NEXT: li a0, 0
1276 ; RV64I-NEXT: .LBB28_3: # Block address taken
1277 ; RV64I-NEXT: # %fail
1278 ; RV64I-NEXT: # Label of block must be emitted
1279 ; RV64I-NEXT: li a0, 1
1282 ; RV32I-MEDIUM-LABEL: constraint_o_with_multi_callbr_asm:
1283 ; RV32I-MEDIUM: # %bb.0: # %entry
1284 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi22:
1285 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1286 ; RV32I-MEDIUM-NEXT: #APP
1287 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi22)(a1); beqz a0, .LBB28_3
1288 ; RV32I-MEDIUM-NEXT: #NO_APP
1289 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal0
1290 ; RV32I-MEDIUM-NEXT: #APP
1291 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi22)(a1); beqz a0, .LBB28_3
1292 ; RV32I-MEDIUM-NEXT: #NO_APP
1293 ; RV32I-MEDIUM-NEXT: # %bb.2: # %normal1
1294 ; RV32I-MEDIUM-NEXT: li a0, 0
1295 ; RV32I-MEDIUM-NEXT: ret
1296 ; RV32I-MEDIUM-NEXT: .LBB28_3: # Block address taken
1297 ; RV32I-MEDIUM-NEXT: # %fail
1298 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
1299 ; RV32I-MEDIUM-NEXT: li a0, 1
1300 ; RV32I-MEDIUM-NEXT: ret
1302 ; RV64I-MEDIUM-LABEL: constraint_o_with_multi_callbr_asm:
1303 ; RV64I-MEDIUM: # %bb.0: # %entry
1304 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi22:
1305 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1306 ; RV64I-MEDIUM-NEXT: #APP
1307 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi22)(a1); beqz a0, .LBB28_3
1308 ; RV64I-MEDIUM-NEXT: #NO_APP
1309 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal0
1310 ; RV64I-MEDIUM-NEXT: #APP
1311 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi22)(a1); beqz a0, .LBB28_3
1312 ; RV64I-MEDIUM-NEXT: #NO_APP
1313 ; RV64I-MEDIUM-NEXT: # %bb.2: # %normal1
1314 ; RV64I-MEDIUM-NEXT: li a0, 0
1315 ; RV64I-MEDIUM-NEXT: ret
1316 ; RV64I-MEDIUM-NEXT: .LBB28_3: # Block address taken
1317 ; RV64I-MEDIUM-NEXT: # %fail
1318 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
1319 ; RV64I-MEDIUM-NEXT: li a0, 1
1320 ; RV64I-MEDIUM-NEXT: ret
1322 callbr void asm "sw zero, $0; beqz $1, $2", "=*o,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
1325 callbr void asm "sw zero, $0; beqz $1, $2", "=*o,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
1334 define void @constraint_o_with_local_1() nounwind {
1335 ; RV32I-LABEL: constraint_o_with_local_1:
1336 ; RV32I: # %bb.0: # %entry
1337 ; RV32I-NEXT: .Ltmp3: # Block address taken
1338 ; RV32I-NEXT: # %bb.1: # %label
1339 ; RV32I-NEXT: lui a0, %hi(.Ltmp3)
1341 ; RV32I-NEXT: lw zero, %lo(.Ltmp3)(a0)
1342 ; RV32I-NEXT: #NO_APP
1345 ; RV64I-LABEL: constraint_o_with_local_1:
1346 ; RV64I: # %bb.0: # %entry
1347 ; RV64I-NEXT: .Ltmp3: # Block address taken
1348 ; RV64I-NEXT: # %bb.1: # %label
1349 ; RV64I-NEXT: lui a0, %hi(.Ltmp3)
1351 ; RV64I-NEXT: lw zero, %lo(.Ltmp3)(a0)
1352 ; RV64I-NEXT: #NO_APP
1355 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_1:
1356 ; RV32I-MEDIUM: # %bb.0: # %entry
1357 ; RV32I-MEDIUM-NEXT: .Ltmp3: # Block address taken
1358 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
1359 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi23:
1360 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp3)
1361 ; RV32I-MEDIUM-NEXT: #APP
1362 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi23)(a0)
1363 ; RV32I-MEDIUM-NEXT: #NO_APP
1364 ; RV32I-MEDIUM-NEXT: ret
1366 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_1:
1367 ; RV64I-MEDIUM: # %bb.0: # %entry
1368 ; RV64I-MEDIUM-NEXT: .Ltmp3: # Block address taken
1369 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
1370 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi23:
1371 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp3)
1372 ; RV64I-MEDIUM-NEXT: #APP
1373 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi23)(a0)
1374 ; RV64I-MEDIUM-NEXT: #NO_APP
1375 ; RV64I-MEDIUM-NEXT: ret
1380 tail call void asm sideeffect "lw zero, $0", "*o"(ptr elementtype(ptr) blockaddress(@constraint_o_with_local_1, %label))
1384 define void @constraint_o_with_local_2() nounwind {
1385 ; RV32I-LABEL: constraint_o_with_local_2:
1386 ; RV32I: # %bb.0: # %entry
1387 ; RV32I-NEXT: .Ltmp4: # Block address taken
1388 ; RV32I-NEXT: # %bb.1: # %label
1389 ; RV32I-NEXT: lui a0, %hi(.Ltmp4+4)
1391 ; RV32I-NEXT: lw zero, %lo(.Ltmp4+4)(a0)
1392 ; RV32I-NEXT: #NO_APP
1395 ; RV64I-LABEL: constraint_o_with_local_2:
1396 ; RV64I: # %bb.0: # %entry
1397 ; RV64I-NEXT: .Ltmp4: # Block address taken
1398 ; RV64I-NEXT: # %bb.1: # %label
1399 ; RV64I-NEXT: lui a0, %hi(.Ltmp4+4)
1401 ; RV64I-NEXT: lw zero, %lo(.Ltmp4+4)(a0)
1402 ; RV64I-NEXT: #NO_APP
1405 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_2:
1406 ; RV32I-MEDIUM: # %bb.0: # %entry
1407 ; RV32I-MEDIUM-NEXT: .Ltmp4: # Block address taken
1408 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
1409 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi24:
1410 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp4+4)
1411 ; RV32I-MEDIUM-NEXT: #APP
1412 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi24)(a0)
1413 ; RV32I-MEDIUM-NEXT: #NO_APP
1414 ; RV32I-MEDIUM-NEXT: ret
1416 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_2:
1417 ; RV64I-MEDIUM: # %bb.0: # %entry
1418 ; RV64I-MEDIUM-NEXT: .Ltmp4: # Block address taken
1419 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
1420 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi24:
1421 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp4+4)
1422 ; RV64I-MEDIUM-NEXT: #APP
1423 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi24)(a0)
1424 ; RV64I-MEDIUM-NEXT: #NO_APP
1425 ; RV64I-MEDIUM-NEXT: ret
1430 call void asm "lw zero, $0", "*o"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_o_with_local_2, %label), i32 4))
1434 define void @constraint_o_with_local_3() nounwind {
1435 ; RV32I-LABEL: constraint_o_with_local_3:
1436 ; RV32I: # %bb.0: # %entry
1437 ; RV32I-NEXT: .Ltmp5: # Block address taken
1438 ; RV32I-NEXT: # %bb.1: # %label
1439 ; RV32I-NEXT: lui a0, %hi(.Ltmp5+2000)
1441 ; RV32I-NEXT: lw zero, %lo(.Ltmp5+2000)(a0)
1442 ; RV32I-NEXT: #NO_APP
1445 ; RV64I-LABEL: constraint_o_with_local_3:
1446 ; RV64I: # %bb.0: # %entry
1447 ; RV64I-NEXT: .Ltmp5: # Block address taken
1448 ; RV64I-NEXT: # %bb.1: # %label
1449 ; RV64I-NEXT: lui a0, %hi(.Ltmp5+2000)
1451 ; RV64I-NEXT: lw zero, %lo(.Ltmp5+2000)(a0)
1452 ; RV64I-NEXT: #NO_APP
1455 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_3:
1456 ; RV32I-MEDIUM: # %bb.0: # %entry
1457 ; RV32I-MEDIUM-NEXT: .Ltmp5: # Block address taken
1458 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
1459 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi25:
1460 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp5+2000)
1461 ; RV32I-MEDIUM-NEXT: #APP
1462 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi25)(a0)
1463 ; RV32I-MEDIUM-NEXT: #NO_APP
1464 ; RV32I-MEDIUM-NEXT: ret
1466 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_3:
1467 ; RV64I-MEDIUM: # %bb.0: # %entry
1468 ; RV64I-MEDIUM-NEXT: .Ltmp5: # Block address taken
1469 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
1470 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi25:
1471 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp5+2000)
1472 ; RV64I-MEDIUM-NEXT: #APP
1473 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi25)(a0)
1474 ; RV64I-MEDIUM-NEXT: #NO_APP
1475 ; RV64I-MEDIUM-NEXT: ret
1480 call void asm "lw zero, $0", "*o"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_o_with_local_3, %label), i32 2000))
1484 define void @constraint_A(ptr %a) nounwind {
1485 ; RV32I-LABEL: constraint_A:
1488 ; RV32I-NEXT: sb s0, 0(a0)
1489 ; RV32I-NEXT: #NO_APP
1491 ; RV32I-NEXT: lb s1, 0(a0)
1492 ; RV32I-NEXT: #NO_APP
1495 ; RV64I-LABEL: constraint_A:
1498 ; RV64I-NEXT: sb s0, 0(a0)
1499 ; RV64I-NEXT: #NO_APP
1501 ; RV64I-NEXT: lb s1, 0(a0)
1502 ; RV64I-NEXT: #NO_APP
1505 ; RV32I-MEDIUM-LABEL: constraint_A:
1506 ; RV32I-MEDIUM: # %bb.0:
1507 ; RV32I-MEDIUM-NEXT: #APP
1508 ; RV32I-MEDIUM-NEXT: sb s0, 0(a0)
1509 ; RV32I-MEDIUM-NEXT: #NO_APP
1510 ; RV32I-MEDIUM-NEXT: #APP
1511 ; RV32I-MEDIUM-NEXT: lb s1, 0(a0)
1512 ; RV32I-MEDIUM-NEXT: #NO_APP
1513 ; RV32I-MEDIUM-NEXT: ret
1515 ; RV64I-MEDIUM-LABEL: constraint_A:
1516 ; RV64I-MEDIUM: # %bb.0:
1517 ; RV64I-MEDIUM-NEXT: #APP
1518 ; RV64I-MEDIUM-NEXT: sb s0, 0(a0)
1519 ; RV64I-MEDIUM-NEXT: #NO_APP
1520 ; RV64I-MEDIUM-NEXT: #APP
1521 ; RV64I-MEDIUM-NEXT: lb s1, 0(a0)
1522 ; RV64I-MEDIUM-NEXT: #NO_APP
1523 ; RV64I-MEDIUM-NEXT: ret
1524 tail call void asm sideeffect "sb s0, $0", "*A"(ptr elementtype(i8) %a)
1525 tail call void asm sideeffect "lb s1, $0", "*A"(ptr elementtype(i8) %a)
1529 define i32 @constraint_A_with_offset(ptr %a) nounwind {
1530 ; RV32I-LABEL: constraint_A_with_offset:
1532 ; RV32I-NEXT: addi a0, a0, 4
1534 ; RV32I-NEXT: lw a0, 0(a0)
1535 ; RV32I-NEXT: #NO_APP
1538 ; RV64I-LABEL: constraint_A_with_offset:
1540 ; RV64I-NEXT: addi a0, a0, 4
1542 ; RV64I-NEXT: lw a0, 0(a0)
1543 ; RV64I-NEXT: #NO_APP
1546 ; RV32I-MEDIUM-LABEL: constraint_A_with_offset:
1547 ; RV32I-MEDIUM: # %bb.0:
1548 ; RV32I-MEDIUM-NEXT: addi a0, a0, 4
1549 ; RV32I-MEDIUM-NEXT: #APP
1550 ; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
1551 ; RV32I-MEDIUM-NEXT: #NO_APP
1552 ; RV32I-MEDIUM-NEXT: ret
1554 ; RV64I-MEDIUM-LABEL: constraint_A_with_offset:
1555 ; RV64I-MEDIUM: # %bb.0:
1556 ; RV64I-MEDIUM-NEXT: addi a0, a0, 4
1557 ; RV64I-MEDIUM-NEXT: #APP
1558 ; RV64I-MEDIUM-NEXT: lw a0, 0(a0)
1559 ; RV64I-MEDIUM-NEXT: #NO_APP
1560 ; RV64I-MEDIUM-NEXT: ret
1561 %1 = getelementptr i32, ptr %a, i32 1
1562 %2 = tail call i32 asm "lw $0, $1", "=r,*A"(ptr elementtype(i32) %1)
1566 define void @constraint_A_with_global_1() nounwind {
1567 ; RV32I-LABEL: constraint_A_with_global_1:
1569 ; RV32I-NEXT: lui a0, %hi(eg)
1570 ; RV32I-NEXT: addi a0, a0, %lo(eg)
1572 ; RV32I-NEXT: sw zero, 0(a0)
1573 ; RV32I-NEXT: #NO_APP
1576 ; RV64I-LABEL: constraint_A_with_global_1:
1578 ; RV64I-NEXT: lui a0, %hi(eg)
1579 ; RV64I-NEXT: addi a0, a0, %lo(eg)
1581 ; RV64I-NEXT: sw zero, 0(a0)
1582 ; RV64I-NEXT: #NO_APP
1585 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_1:
1586 ; RV32I-MEDIUM: # %bb.0:
1587 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi26:
1588 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1589 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi26)
1590 ; RV32I-MEDIUM-NEXT: #APP
1591 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1592 ; RV32I-MEDIUM-NEXT: #NO_APP
1593 ; RV32I-MEDIUM-NEXT: ret
1595 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_1:
1596 ; RV64I-MEDIUM: # %bb.0:
1597 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi26:
1598 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1599 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi26)
1600 ; RV64I-MEDIUM-NEXT: #APP
1601 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1602 ; RV64I-MEDIUM-NEXT: #NO_APP
1603 ; RV64I-MEDIUM-NEXT: ret
1604 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
1608 define void @constraint_A_with_global_2() nounwind {
1609 ; RV32I-LABEL: constraint_A_with_global_2:
1611 ; RV32I-NEXT: lui a0, %hi(eg+4)
1612 ; RV32I-NEXT: addi a0, a0, %lo(eg+4)
1614 ; RV32I-NEXT: sw zero, 0(a0)
1615 ; RV32I-NEXT: #NO_APP
1618 ; RV64I-LABEL: constraint_A_with_global_2:
1620 ; RV64I-NEXT: lui a0, %hi(eg+4)
1621 ; RV64I-NEXT: addi a0, a0, %lo(eg+4)
1623 ; RV64I-NEXT: sw zero, 0(a0)
1624 ; RV64I-NEXT: #NO_APP
1627 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_2:
1628 ; RV32I-MEDIUM: # %bb.0:
1629 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi27:
1630 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
1631 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi27)
1632 ; RV32I-MEDIUM-NEXT: #APP
1633 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1634 ; RV32I-MEDIUM-NEXT: #NO_APP
1635 ; RV32I-MEDIUM-NEXT: ret
1637 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_2:
1638 ; RV64I-MEDIUM: # %bb.0:
1639 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi27:
1640 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
1641 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi27)
1642 ; RV64I-MEDIUM-NEXT: #APP
1643 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1644 ; RV64I-MEDIUM-NEXT: #NO_APP
1645 ; RV64I-MEDIUM-NEXT: ret
1646 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
1650 define void @constraint_A_with_global_3() nounwind {
1651 ; RV32I-LABEL: constraint_A_with_global_3:
1653 ; RV32I-NEXT: lui a0, %hi(eg+8000)
1654 ; RV32I-NEXT: addi a0, a0, %lo(eg+8000)
1656 ; RV32I-NEXT: sw zero, 0(a0)
1657 ; RV32I-NEXT: #NO_APP
1660 ; RV64I-LABEL: constraint_A_with_global_3:
1662 ; RV64I-NEXT: lui a0, %hi(eg+8000)
1663 ; RV64I-NEXT: addi a0, a0, %lo(eg+8000)
1665 ; RV64I-NEXT: sw zero, 0(a0)
1666 ; RV64I-NEXT: #NO_APP
1669 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_3:
1670 ; RV32I-MEDIUM: # %bb.0:
1671 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi28:
1672 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
1673 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi28)
1674 ; RV32I-MEDIUM-NEXT: #APP
1675 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1676 ; RV32I-MEDIUM-NEXT: #NO_APP
1677 ; RV32I-MEDIUM-NEXT: ret
1679 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_3:
1680 ; RV64I-MEDIUM: # %bb.0:
1681 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi28:
1682 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
1683 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi28)
1684 ; RV64I-MEDIUM-NEXT: #APP
1685 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1686 ; RV64I-MEDIUM-NEXT: #NO_APP
1687 ; RV64I-MEDIUM-NEXT: ret
1688 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 2000))
1692 define void @constraint_A_with_extern_weak_global_1() nounwind {
1693 ; RV32I-LABEL: constraint_A_with_extern_weak_global_1:
1695 ; RV32I-NEXT: lui a0, %hi(ewg)
1696 ; RV32I-NEXT: addi a0, a0, %lo(ewg)
1698 ; RV32I-NEXT: sw zero, 0(a0)
1699 ; RV32I-NEXT: #NO_APP
1702 ; RV64I-LABEL: constraint_A_with_extern_weak_global_1:
1704 ; RV64I-NEXT: lui a0, %hi(ewg)
1705 ; RV64I-NEXT: addi a0, a0, %lo(ewg)
1707 ; RV64I-NEXT: sw zero, 0(a0)
1708 ; RV64I-NEXT: #NO_APP
1711 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_1:
1712 ; RV32I-MEDIUM: # %bb.0:
1713 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi29:
1714 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1715 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi29)(a0)
1716 ; RV32I-MEDIUM-NEXT: #APP
1717 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1718 ; RV32I-MEDIUM-NEXT: #NO_APP
1719 ; RV32I-MEDIUM-NEXT: ret
1721 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_1:
1722 ; RV64I-MEDIUM: # %bb.0:
1723 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi29:
1724 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1725 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi29)(a0)
1726 ; RV64I-MEDIUM-NEXT: #APP
1727 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1728 ; RV64I-MEDIUM-NEXT: #NO_APP
1729 ; RV64I-MEDIUM-NEXT: ret
1730 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @ewg)
1734 define void @constraint_A_with_extern_weak_global_2() nounwind {
1735 ; RV32I-LABEL: constraint_A_with_extern_weak_global_2:
1737 ; RV32I-NEXT: lui a0, %hi(ewg+4)
1738 ; RV32I-NEXT: addi a0, a0, %lo(ewg+4)
1740 ; RV32I-NEXT: sw zero, 0(a0)
1741 ; RV32I-NEXT: #NO_APP
1744 ; RV64I-LABEL: constraint_A_with_extern_weak_global_2:
1746 ; RV64I-NEXT: lui a0, %hi(ewg+4)
1747 ; RV64I-NEXT: addi a0, a0, %lo(ewg+4)
1749 ; RV64I-NEXT: sw zero, 0(a0)
1750 ; RV64I-NEXT: #NO_APP
1753 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_2:
1754 ; RV32I-MEDIUM: # %bb.0:
1755 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi30:
1756 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1757 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi30)(a0)
1758 ; RV32I-MEDIUM-NEXT: addi a0, a0, 4
1759 ; RV32I-MEDIUM-NEXT: #APP
1760 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1761 ; RV32I-MEDIUM-NEXT: #NO_APP
1762 ; RV32I-MEDIUM-NEXT: ret
1764 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_2:
1765 ; RV64I-MEDIUM: # %bb.0:
1766 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi30:
1767 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1768 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi30)(a0)
1769 ; RV64I-MEDIUM-NEXT: addi a0, a0, 4
1770 ; RV64I-MEDIUM-NEXT: #APP
1771 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1772 ; RV64I-MEDIUM-NEXT: #NO_APP
1773 ; RV64I-MEDIUM-NEXT: ret
1774 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
1778 define void @constraint_A_with_extern_weak_global_3() nounwind {
1779 ; RV32I-LABEL: constraint_A_with_extern_weak_global_3:
1781 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
1782 ; RV32I-NEXT: addi a0, a0, %lo(ewg+8000)
1784 ; RV32I-NEXT: sw zero, 0(a0)
1785 ; RV32I-NEXT: #NO_APP
1788 ; RV64I-LABEL: constraint_A_with_extern_weak_global_3:
1790 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
1791 ; RV64I-NEXT: addi a0, a0, %lo(ewg+8000)
1793 ; RV64I-NEXT: sw zero, 0(a0)
1794 ; RV64I-NEXT: #NO_APP
1797 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_3:
1798 ; RV32I-MEDIUM: # %bb.0:
1799 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi31:
1800 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1801 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi31)(a0)
1802 ; RV32I-MEDIUM-NEXT: lui a1, 2
1803 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
1804 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
1805 ; RV32I-MEDIUM-NEXT: #APP
1806 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1807 ; RV32I-MEDIUM-NEXT: #NO_APP
1808 ; RV32I-MEDIUM-NEXT: ret
1810 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_3:
1811 ; RV64I-MEDIUM: # %bb.0:
1812 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi31:
1813 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1814 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi31)(a0)
1815 ; RV64I-MEDIUM-NEXT: lui a1, 2
1816 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
1817 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
1818 ; RV64I-MEDIUM-NEXT: #APP
1819 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1820 ; RV64I-MEDIUM-NEXT: #NO_APP
1821 ; RV64I-MEDIUM-NEXT: ret
1822 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
1826 define void @constraint_A_with_multi_operands() nounwind {
1827 ; RV32I-LABEL: constraint_A_with_multi_operands:
1829 ; RV32I-NEXT: lui a0, %hi(eg)
1830 ; RV32I-NEXT: addi a0, a0, %lo(eg)
1832 ; RV32I-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1833 ; RV32I-NEXT: #NO_APP
1836 ; RV64I-LABEL: constraint_A_with_multi_operands:
1838 ; RV64I-NEXT: lui a0, %hi(eg)
1839 ; RV64I-NEXT: addi a0, a0, %lo(eg)
1841 ; RV64I-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1842 ; RV64I-NEXT: #NO_APP
1845 ; RV32I-MEDIUM-LABEL: constraint_A_with_multi_operands:
1846 ; RV32I-MEDIUM: # %bb.0:
1847 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi32:
1848 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1849 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi32)
1850 ; RV32I-MEDIUM-NEXT: #APP
1851 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1852 ; RV32I-MEDIUM-NEXT: #NO_APP
1853 ; RV32I-MEDIUM-NEXT: ret
1855 ; RV64I-MEDIUM-LABEL: constraint_A_with_multi_operands:
1856 ; RV64I-MEDIUM: # %bb.0:
1857 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi32:
1858 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1859 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi32)
1860 ; RV64I-MEDIUM-NEXT: #APP
1861 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
1862 ; RV64I-MEDIUM-NEXT: #NO_APP
1863 ; RV64I-MEDIUM-NEXT: ret
1864 call void asm "sw zero, $0 \n sw zero, $1", "=*A,=*A"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
1868 define void @constraint_A_with_multi_asm() nounwind {
1869 ; RV32I-LABEL: constraint_A_with_multi_asm:
1871 ; RV32I-NEXT: lui a0, %hi(eg)
1872 ; RV32I-NEXT: addi a0, a0, %lo(eg)
1874 ; RV32I-NEXT: sw zero, 0(a0)
1875 ; RV32I-NEXT: #NO_APP
1877 ; RV32I-NEXT: sw zero, 0(a0)
1878 ; RV32I-NEXT: #NO_APP
1881 ; RV64I-LABEL: constraint_A_with_multi_asm:
1883 ; RV64I-NEXT: lui a0, %hi(eg)
1884 ; RV64I-NEXT: addi a0, a0, %lo(eg)
1886 ; RV64I-NEXT: sw zero, 0(a0)
1887 ; RV64I-NEXT: #NO_APP
1889 ; RV64I-NEXT: sw zero, 0(a0)
1890 ; RV64I-NEXT: #NO_APP
1893 ; RV32I-MEDIUM-LABEL: constraint_A_with_multi_asm:
1894 ; RV32I-MEDIUM: # %bb.0:
1895 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi33:
1896 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1897 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi33)
1898 ; RV32I-MEDIUM-NEXT: #APP
1899 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1900 ; RV32I-MEDIUM-NEXT: #NO_APP
1901 ; RV32I-MEDIUM-NEXT: #APP
1902 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1903 ; RV32I-MEDIUM-NEXT: #NO_APP
1904 ; RV32I-MEDIUM-NEXT: ret
1906 ; RV64I-MEDIUM-LABEL: constraint_A_with_multi_asm:
1907 ; RV64I-MEDIUM: # %bb.0:
1908 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi33:
1909 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1910 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi33)
1911 ; RV64I-MEDIUM-NEXT: #APP
1912 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1913 ; RV64I-MEDIUM-NEXT: #NO_APP
1914 ; RV64I-MEDIUM-NEXT: #APP
1915 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1916 ; RV64I-MEDIUM-NEXT: #NO_APP
1917 ; RV64I-MEDIUM-NEXT: ret
1918 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
1919 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
1923 define i32 @constraint_A_with_callbr_multi_operands(i32 %a) {
1924 ; RV32I-LABEL: constraint_A_with_callbr_multi_operands:
1925 ; RV32I: # %bb.0: # %entry
1926 ; RV32I-NEXT: lui a1, %hi(eg)
1927 ; RV32I-NEXT: addi a1, a1, %lo(eg)
1929 ; RV32I-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB42_2
1930 ; RV32I-NEXT: #NO_APP
1931 ; RV32I-NEXT: # %bb.1: # %normal
1932 ; RV32I-NEXT: li a0, 0
1934 ; RV32I-NEXT: .LBB42_2: # Block address taken
1935 ; RV32I-NEXT: # %fail
1936 ; RV32I-NEXT: # Label of block must be emitted
1937 ; RV32I-NEXT: li a0, 1
1940 ; RV64I-LABEL: constraint_A_with_callbr_multi_operands:
1941 ; RV64I: # %bb.0: # %entry
1942 ; RV64I-NEXT: lui a1, %hi(eg)
1943 ; RV64I-NEXT: addi a1, a1, %lo(eg)
1945 ; RV64I-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB42_2
1946 ; RV64I-NEXT: #NO_APP
1947 ; RV64I-NEXT: # %bb.1: # %normal
1948 ; RV64I-NEXT: li a0, 0
1950 ; RV64I-NEXT: .LBB42_2: # Block address taken
1951 ; RV64I-NEXT: # %fail
1952 ; RV64I-NEXT: # Label of block must be emitted
1953 ; RV64I-NEXT: li a0, 1
1956 ; RV32I-MEDIUM-LABEL: constraint_A_with_callbr_multi_operands:
1957 ; RV32I-MEDIUM: # %bb.0: # %entry
1958 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi34:
1959 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1960 ; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi34)
1961 ; RV32I-MEDIUM-NEXT: #APP
1962 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB42_2
1963 ; RV32I-MEDIUM-NEXT: #NO_APP
1964 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal
1965 ; RV32I-MEDIUM-NEXT: li a0, 0
1966 ; RV32I-MEDIUM-NEXT: ret
1967 ; RV32I-MEDIUM-NEXT: .LBB42_2: # Block address taken
1968 ; RV32I-MEDIUM-NEXT: # %fail
1969 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
1970 ; RV32I-MEDIUM-NEXT: li a0, 1
1971 ; RV32I-MEDIUM-NEXT: ret
1973 ; RV64I-MEDIUM-LABEL: constraint_A_with_callbr_multi_operands:
1974 ; RV64I-MEDIUM: # %bb.0: # %entry
1975 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi34:
1976 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
1977 ; RV64I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi34)
1978 ; RV64I-MEDIUM-NEXT: #APP
1979 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB42_2
1980 ; RV64I-MEDIUM-NEXT: #NO_APP
1981 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal
1982 ; RV64I-MEDIUM-NEXT: li a0, 0
1983 ; RV64I-MEDIUM-NEXT: ret
1984 ; RV64I-MEDIUM-NEXT: .LBB42_2: # Block address taken
1985 ; RV64I-MEDIUM-NEXT: # %fail
1986 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
1987 ; RV64I-MEDIUM-NEXT: li a0, 1
1988 ; RV64I-MEDIUM-NEXT: ret
1990 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]
1999 define i32 @constraint_A_with_multi_callbr_asm(i32 %a) {
2000 ; RV32I-LABEL: constraint_A_with_multi_callbr_asm:
2001 ; RV32I: # %bb.0: # %entry
2002 ; RV32I-NEXT: lui a1, %hi(eg)
2003 ; RV32I-NEXT: addi a1, a1, %lo(eg)
2005 ; RV32I-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2006 ; RV32I-NEXT: #NO_APP
2007 ; RV32I-NEXT: # %bb.1: # %normal0
2009 ; RV32I-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2010 ; RV32I-NEXT: #NO_APP
2011 ; RV32I-NEXT: # %bb.2: # %normal1
2012 ; RV32I-NEXT: li a0, 0
2014 ; RV32I-NEXT: .LBB43_3: # Block address taken
2015 ; RV32I-NEXT: # %fail
2016 ; RV32I-NEXT: # Label of block must be emitted
2017 ; RV32I-NEXT: li a0, 1
2020 ; RV64I-LABEL: constraint_A_with_multi_callbr_asm:
2021 ; RV64I: # %bb.0: # %entry
2022 ; RV64I-NEXT: lui a1, %hi(eg)
2023 ; RV64I-NEXT: addi a1, a1, %lo(eg)
2025 ; RV64I-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2026 ; RV64I-NEXT: #NO_APP
2027 ; RV64I-NEXT: # %bb.1: # %normal0
2029 ; RV64I-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2030 ; RV64I-NEXT: #NO_APP
2031 ; RV64I-NEXT: # %bb.2: # %normal1
2032 ; RV64I-NEXT: li a0, 0
2034 ; RV64I-NEXT: .LBB43_3: # Block address taken
2035 ; RV64I-NEXT: # %fail
2036 ; RV64I-NEXT: # Label of block must be emitted
2037 ; RV64I-NEXT: li a0, 1
2040 ; RV32I-MEDIUM-LABEL: constraint_A_with_multi_callbr_asm:
2041 ; RV32I-MEDIUM: # %bb.0: # %entry
2042 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi35:
2043 ; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
2044 ; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi35)
2045 ; RV32I-MEDIUM-NEXT: #APP
2046 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2047 ; RV32I-MEDIUM-NEXT: #NO_APP
2048 ; RV32I-MEDIUM-NEXT: # %bb.1: # %normal0
2049 ; RV32I-MEDIUM-NEXT: #APP
2050 ; RV32I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2051 ; RV32I-MEDIUM-NEXT: #NO_APP
2052 ; RV32I-MEDIUM-NEXT: # %bb.2: # %normal1
2053 ; RV32I-MEDIUM-NEXT: li a0, 0
2054 ; RV32I-MEDIUM-NEXT: ret
2055 ; RV32I-MEDIUM-NEXT: .LBB43_3: # Block address taken
2056 ; RV32I-MEDIUM-NEXT: # %fail
2057 ; RV32I-MEDIUM-NEXT: # Label of block must be emitted
2058 ; RV32I-MEDIUM-NEXT: li a0, 1
2059 ; RV32I-MEDIUM-NEXT: ret
2061 ; RV64I-MEDIUM-LABEL: constraint_A_with_multi_callbr_asm:
2062 ; RV64I-MEDIUM: # %bb.0: # %entry
2063 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi35:
2064 ; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(eg)
2065 ; RV64I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi35)
2066 ; RV64I-MEDIUM-NEXT: #APP
2067 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2068 ; RV64I-MEDIUM-NEXT: #NO_APP
2069 ; RV64I-MEDIUM-NEXT: # %bb.1: # %normal0
2070 ; RV64I-MEDIUM-NEXT: #APP
2071 ; RV64I-MEDIUM-NEXT: sw zero, 0(a1); beqz a0, .LBB43_3
2072 ; RV64I-MEDIUM-NEXT: #NO_APP
2073 ; RV64I-MEDIUM-NEXT: # %bb.2: # %normal1
2074 ; RV64I-MEDIUM-NEXT: li a0, 0
2075 ; RV64I-MEDIUM-NEXT: ret
2076 ; RV64I-MEDIUM-NEXT: .LBB43_3: # Block address taken
2077 ; RV64I-MEDIUM-NEXT: # %fail
2078 ; RV64I-MEDIUM-NEXT: # Label of block must be emitted
2079 ; RV64I-MEDIUM-NEXT: li a0, 1
2080 ; RV64I-MEDIUM-NEXT: ret
2082 callbr void asm "sw zero, $0; beqz $1, $2", "=*A,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
2085 callbr void asm "sw zero, $0; beqz $1, $2", "=*A,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
2094 define void @constraint_A_with_local_1() nounwind {
2095 ; RV32I-LABEL: constraint_A_with_local_1:
2096 ; RV32I: # %bb.0: # %entry
2097 ; RV32I-NEXT: .Ltmp6: # Block address taken
2098 ; RV32I-NEXT: # %bb.1: # %label
2099 ; RV32I-NEXT: lui a0, %hi(.Ltmp6)
2100 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp6)
2102 ; RV32I-NEXT: lw zero, 0(a0)
2103 ; RV32I-NEXT: #NO_APP
2106 ; RV64I-LABEL: constraint_A_with_local_1:
2107 ; RV64I: # %bb.0: # %entry
2108 ; RV64I-NEXT: .Ltmp6: # Block address taken
2109 ; RV64I-NEXT: # %bb.1: # %label
2110 ; RV64I-NEXT: lui a0, %hi(.Ltmp6)
2111 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp6)
2113 ; RV64I-NEXT: lw zero, 0(a0)
2114 ; RV64I-NEXT: #NO_APP
2117 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_1:
2118 ; RV32I-MEDIUM: # %bb.0: # %entry
2119 ; RV32I-MEDIUM-NEXT: .Ltmp6: # Block address taken
2120 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2121 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi36:
2122 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp6)
2123 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi36)
2124 ; RV32I-MEDIUM-NEXT: #APP
2125 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
2126 ; RV32I-MEDIUM-NEXT: #NO_APP
2127 ; RV32I-MEDIUM-NEXT: ret
2129 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_1:
2130 ; RV64I-MEDIUM: # %bb.0: # %entry
2131 ; RV64I-MEDIUM-NEXT: .Ltmp6: # Block address taken
2132 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2133 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi36:
2134 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp6)
2135 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi36)
2136 ; RV64I-MEDIUM-NEXT: #APP
2137 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
2138 ; RV64I-MEDIUM-NEXT: #NO_APP
2139 ; RV64I-MEDIUM-NEXT: ret
2144 tail call void asm sideeffect "lw zero, $0", "*A"(ptr elementtype(ptr) blockaddress(@constraint_A_with_local_1, %label))
2148 define void @constraint_A_with_local_2() nounwind {
2149 ; RV32I-LABEL: constraint_A_with_local_2:
2150 ; RV32I: # %bb.0: # %entry
2151 ; RV32I-NEXT: .Ltmp7: # Block address taken
2152 ; RV32I-NEXT: # %bb.1: # %label
2153 ; RV32I-NEXT: lui a0, %hi(.Ltmp7+4)
2154 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp7+4)
2156 ; RV32I-NEXT: lw zero, 0(a0)
2157 ; RV32I-NEXT: #NO_APP
2160 ; RV64I-LABEL: constraint_A_with_local_2:
2161 ; RV64I: # %bb.0: # %entry
2162 ; RV64I-NEXT: .Ltmp7: # Block address taken
2163 ; RV64I-NEXT: # %bb.1: # %label
2164 ; RV64I-NEXT: lui a0, %hi(.Ltmp7+4)
2165 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp7+4)
2167 ; RV64I-NEXT: lw zero, 0(a0)
2168 ; RV64I-NEXT: #NO_APP
2171 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_2:
2172 ; RV32I-MEDIUM: # %bb.0: # %entry
2173 ; RV32I-MEDIUM-NEXT: .Ltmp7: # Block address taken
2174 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2175 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi37:
2176 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp7+4)
2177 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi37)
2178 ; RV32I-MEDIUM-NEXT: #APP
2179 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
2180 ; RV32I-MEDIUM-NEXT: #NO_APP
2181 ; RV32I-MEDIUM-NEXT: ret
2183 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_2:
2184 ; RV64I-MEDIUM: # %bb.0: # %entry
2185 ; RV64I-MEDIUM-NEXT: .Ltmp7: # Block address taken
2186 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2187 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi37:
2188 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp7+4)
2189 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi37)
2190 ; RV64I-MEDIUM-NEXT: #APP
2191 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
2192 ; RV64I-MEDIUM-NEXT: #NO_APP
2193 ; RV64I-MEDIUM-NEXT: ret
2198 call void asm "lw zero, $0", "*A"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_A_with_local_2, %label), i32 4))
2202 define void @constraint_A_with_local_3() nounwind {
2203 ; RV32I-LABEL: constraint_A_with_local_3:
2204 ; RV32I: # %bb.0: # %entry
2205 ; RV32I-NEXT: .Ltmp8: # Block address taken
2206 ; RV32I-NEXT: # %bb.1: # %label
2207 ; RV32I-NEXT: lui a0, %hi(.Ltmp8+2000)
2208 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp8+2000)
2210 ; RV32I-NEXT: lw zero, 0(a0)
2211 ; RV32I-NEXT: #NO_APP
2214 ; RV64I-LABEL: constraint_A_with_local_3:
2215 ; RV64I: # %bb.0: # %entry
2216 ; RV64I-NEXT: .Ltmp8: # Block address taken
2217 ; RV64I-NEXT: # %bb.1: # %label
2218 ; RV64I-NEXT: lui a0, %hi(.Ltmp8+2000)
2219 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp8+2000)
2221 ; RV64I-NEXT: lw zero, 0(a0)
2222 ; RV64I-NEXT: #NO_APP
2225 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_3:
2226 ; RV32I-MEDIUM: # %bb.0: # %entry
2227 ; RV32I-MEDIUM-NEXT: .Ltmp8: # Block address taken
2228 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2229 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi38:
2230 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp8+2000)
2231 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi38)
2232 ; RV32I-MEDIUM-NEXT: #APP
2233 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
2234 ; RV32I-MEDIUM-NEXT: #NO_APP
2235 ; RV32I-MEDIUM-NEXT: ret
2237 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_3:
2238 ; RV64I-MEDIUM: # %bb.0: # %entry
2239 ; RV64I-MEDIUM-NEXT: .Ltmp8: # Block address taken
2240 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2241 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi38:
2242 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp8+2000)
2243 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi38)
2244 ; RV64I-MEDIUM-NEXT: #APP
2245 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
2246 ; RV64I-MEDIUM-NEXT: #NO_APP
2247 ; RV64I-MEDIUM-NEXT: ret
2252 call void asm "lw zero, $0", "*A"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_A_with_local_3, %label), i32 2000))