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,RV32I-NO-INTEGRATED %s
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs -no-integrated-as < %s \
5 ; RUN: | FileCheck -check-prefixes=RV64I,RV64I-NO-INTEGRATED %s
6 ; RUN: llc -mtriple=riscv32 -code-model=medium -verify-machineinstrs -no-integrated-as < %s \
7 ; RUN: | FileCheck -check-prefixes=RV32I-MEDIUM,RV32I-MEDIUM-NO-INTEGRATED %s
8 ; RUN: llc -mtriple=riscv64 -code-model=medium -verify-machineinstrs -no-integrated-as < %s \
9 ; RUN: | FileCheck -check-prefixes=RV64I-MEDIUM,RV64I-MEDIUM-NO-INTEGRATED %s
10 ; RUN: llc -mtriple=riscv64 -code-model=large -verify-machineinstrs -no-integrated-as < %s \
11 ; RUN: | FileCheck -check-prefixes=RV64I-LARGE,RV64I-LARGE-NO-INTEGRATED %s
12 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
13 ; RUN: | FileCheck -check-prefixes=RV32I,RV32I-INTEGRATED %s
14 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
15 ; RUN: | FileCheck -check-prefixes=RV64I,RV64I-INTEGRATED %s
16 ; RUN: llc -mtriple=riscv32 -code-model=medium -verify-machineinstrs < %s \
17 ; RUN: | FileCheck -check-prefixes=RV32I-MEDIUM,RV32I-MEDIUM-INTEGRATED %s
18 ; RUN: llc -mtriple=riscv64 -code-model=medium -verify-machineinstrs < %s \
19 ; RUN: | FileCheck -check-prefixes=RV64I-MEDIUM,RV64I-MEDIUM-INTEGRATED %s
20 ; RUN: llc -mtriple=riscv64 -code-model=large -verify-machineinstrs < %s \
21 ; RUN: | FileCheck -check-prefixes=RV64I-LARGE,RV64I-LARGE-INTEGRATED %s
23 @eg = external global [4000 x i32], align 4
24 @ewg = extern_weak global [4000 x i32], align 4
26 define void @constraint_m_1(ptr %a) nounwind {
27 ; RV32I-LABEL: constraint_m_1:
33 ; RV64I-LABEL: constraint_m_1:
39 ; RV32I-MEDIUM-LABEL: constraint_m_1:
40 ; RV32I-MEDIUM: # %bb.0:
41 ; RV32I-MEDIUM-NEXT: #APP
42 ; RV32I-MEDIUM-NEXT: #NO_APP
43 ; RV32I-MEDIUM-NEXT: ret
45 ; RV64I-MEDIUM-LABEL: constraint_m_1:
46 ; RV64I-MEDIUM: # %bb.0:
47 ; RV64I-MEDIUM-NEXT: #APP
48 ; RV64I-MEDIUM-NEXT: #NO_APP
49 ; RV64I-MEDIUM-NEXT: ret
51 ; RV64I-LARGE-LABEL: constraint_m_1:
52 ; RV64I-LARGE: # %bb.0:
53 ; RV64I-LARGE-NEXT: #APP
54 ; RV64I-LARGE-NEXT: #NO_APP
55 ; RV64I-LARGE-NEXT: ret
56 call void asm sideeffect "", "=*m"(ptr elementtype(i32) %a)
60 define i32 @constraint_m_2(ptr %a) nounwind {
61 ; RV32I-LABEL: constraint_m_2:
64 ; RV32I-NEXT: lw a0, 0(a0)
68 ; RV64I-LABEL: constraint_m_2:
71 ; RV64I-NEXT: lw a0, 0(a0)
75 ; RV32I-MEDIUM-LABEL: constraint_m_2:
76 ; RV32I-MEDIUM: # %bb.0:
77 ; RV32I-MEDIUM-NEXT: #APP
78 ; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
79 ; RV32I-MEDIUM-NEXT: #NO_APP
80 ; RV32I-MEDIUM-NEXT: ret
82 ; RV64I-MEDIUM-LABEL: constraint_m_2:
83 ; RV64I-MEDIUM: # %bb.0:
84 ; RV64I-MEDIUM-NEXT: #APP
85 ; RV64I-MEDIUM-NEXT: lw a0, 0(a0)
86 ; RV64I-MEDIUM-NEXT: #NO_APP
87 ; RV64I-MEDIUM-NEXT: ret
89 ; RV64I-LARGE-LABEL: constraint_m_2:
90 ; RV64I-LARGE: # %bb.0:
91 ; RV64I-LARGE-NEXT: #APP
92 ; RV64I-LARGE-NEXT: lw a0, 0(a0)
93 ; RV64I-LARGE-NEXT: #NO_APP
94 ; RV64I-LARGE-NEXT: ret
95 %1 = tail call i32 asm "lw $0, $1", "=r,*m"(ptr elementtype(i32) %a)
99 define i32 @constraint_m_with_offset(ptr %a) nounwind {
100 ; RV32I-LABEL: constraint_m_with_offset:
103 ; RV32I-NEXT: lw a0, 4(a0)
104 ; RV32I-NEXT: #NO_APP
107 ; RV64I-LABEL: constraint_m_with_offset:
110 ; RV64I-NEXT: lw a0, 4(a0)
111 ; RV64I-NEXT: #NO_APP
114 ; RV32I-MEDIUM-LABEL: constraint_m_with_offset:
115 ; RV32I-MEDIUM: # %bb.0:
116 ; RV32I-MEDIUM-NEXT: #APP
117 ; RV32I-MEDIUM-NEXT: lw a0, 4(a0)
118 ; RV32I-MEDIUM-NEXT: #NO_APP
119 ; RV32I-MEDIUM-NEXT: ret
121 ; RV64I-MEDIUM-LABEL: constraint_m_with_offset:
122 ; RV64I-MEDIUM: # %bb.0:
123 ; RV64I-MEDIUM-NEXT: #APP
124 ; RV64I-MEDIUM-NEXT: lw a0, 4(a0)
125 ; RV64I-MEDIUM-NEXT: #NO_APP
126 ; RV64I-MEDIUM-NEXT: ret
128 ; RV64I-LARGE-LABEL: constraint_m_with_offset:
129 ; RV64I-LARGE: # %bb.0:
130 ; RV64I-LARGE-NEXT: #APP
131 ; RV64I-LARGE-NEXT: lw a0, 4(a0)
132 ; RV64I-LARGE-NEXT: #NO_APP
133 ; RV64I-LARGE-NEXT: ret
134 %1 = getelementptr i32, ptr %a, i32 1
135 %2 = tail call i32 asm "lw $0, $1", "=r,*m"(ptr elementtype(i32) %1)
139 define void @constraint_m_with_global_1() nounwind {
140 ; RV32I-LABEL: constraint_m_with_global_1:
142 ; RV32I-NEXT: lui a0, %hi(eg)
144 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
145 ; RV32I-NEXT: #NO_APP
148 ; RV64I-LABEL: constraint_m_with_global_1:
150 ; RV64I-NEXT: lui a0, %hi(eg)
152 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
153 ; RV64I-NEXT: #NO_APP
156 ; RV32I-MEDIUM-LABEL: constraint_m_with_global_1:
157 ; RV32I-MEDIUM: # %bb.0:
158 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi0:
159 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
160 ; RV32I-MEDIUM-NEXT: #APP
161 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi0)(a0)
162 ; RV32I-MEDIUM-NEXT: #NO_APP
163 ; RV32I-MEDIUM-NEXT: ret
165 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_1:
166 ; RV64I-MEDIUM: # %bb.0:
167 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi0:
168 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
169 ; RV64I-MEDIUM-NEXT: #APP
170 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi0)(a0)
171 ; RV64I-MEDIUM-NEXT: #NO_APP
172 ; RV64I-MEDIUM-NEXT: ret
174 ; RV64I-LARGE-LABEL: constraint_m_with_global_1:
175 ; RV64I-LARGE: # %bb.0:
176 ; RV64I-LARGE-NEXT: .Lpcrel_hi0:
177 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI3_0)
178 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi0)(a0)
179 ; RV64I-LARGE-NEXT: #APP
180 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
181 ; RV64I-LARGE-NEXT: #NO_APP
182 ; RV64I-LARGE-NEXT: ret
183 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
187 define void @constraint_m_with_global_2() nounwind {
188 ; RV32I-LABEL: constraint_m_with_global_2:
190 ; RV32I-NEXT: lui a0, %hi(eg+4)
192 ; RV32I-NEXT: sw zero, %lo(eg+4)(a0)
193 ; RV32I-NEXT: #NO_APP
196 ; RV64I-LABEL: constraint_m_with_global_2:
198 ; RV64I-NEXT: lui a0, %hi(eg+4)
200 ; RV64I-NEXT: sw zero, %lo(eg+4)(a0)
201 ; RV64I-NEXT: #NO_APP
204 ; RV32I-MEDIUM-LABEL: constraint_m_with_global_2:
205 ; RV32I-MEDIUM: # %bb.0:
206 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi1:
207 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
208 ; RV32I-MEDIUM-NEXT: #APP
209 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi1)(a0)
210 ; RV32I-MEDIUM-NEXT: #NO_APP
211 ; RV32I-MEDIUM-NEXT: ret
213 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_2:
214 ; RV64I-MEDIUM: # %bb.0:
215 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi1:
216 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
217 ; RV64I-MEDIUM-NEXT: #APP
218 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi1)(a0)
219 ; RV64I-MEDIUM-NEXT: #NO_APP
220 ; RV64I-MEDIUM-NEXT: ret
222 ; RV64I-LARGE-LABEL: constraint_m_with_global_2:
223 ; RV64I-LARGE: # %bb.0:
224 ; RV64I-LARGE-NEXT: .Lpcrel_hi1:
225 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI4_0)
226 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi1)(a0)
227 ; RV64I-LARGE-NEXT: #APP
228 ; RV64I-LARGE-NEXT: sw zero, 4(a0)
229 ; RV64I-LARGE-NEXT: #NO_APP
230 ; RV64I-LARGE-NEXT: ret
231 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
235 define void @constraint_m_with_global_3() nounwind {
236 ; RV32I-LABEL: constraint_m_with_global_3:
238 ; RV32I-NEXT: lui a0, %hi(eg+8000)
240 ; RV32I-NEXT: sw zero, %lo(eg+8000)(a0)
241 ; RV32I-NEXT: #NO_APP
244 ; RV64I-LABEL: constraint_m_with_global_3:
246 ; RV64I-NEXT: lui a0, %hi(eg+8000)
248 ; RV64I-NEXT: sw zero, %lo(eg+8000)(a0)
249 ; RV64I-NEXT: #NO_APP
252 ; RV32I-MEDIUM-LABEL: constraint_m_with_global_3:
253 ; RV32I-MEDIUM: # %bb.0:
254 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi2:
255 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
256 ; RV32I-MEDIUM-NEXT: #APP
257 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi2)(a0)
258 ; RV32I-MEDIUM-NEXT: #NO_APP
259 ; RV32I-MEDIUM-NEXT: ret
261 ; RV64I-MEDIUM-LABEL: constraint_m_with_global_3:
262 ; RV64I-MEDIUM: # %bb.0:
263 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi2:
264 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
265 ; RV64I-MEDIUM-NEXT: #APP
266 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi2)(a0)
267 ; RV64I-MEDIUM-NEXT: #NO_APP
268 ; RV64I-MEDIUM-NEXT: ret
270 ; RV64I-LARGE-LABEL: constraint_m_with_global_3:
271 ; RV64I-LARGE: # %bb.0:
272 ; RV64I-LARGE-NEXT: .Lpcrel_hi2:
273 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI5_0)
274 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi2)(a0)
275 ; RV64I-LARGE-NEXT: lui a1, 2
276 ; RV64I-LARGE-NEXT: addiw a1, a1, -192
277 ; RV64I-LARGE-NEXT: add a0, a0, a1
278 ; RV64I-LARGE-NEXT: #APP
279 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
280 ; RV64I-LARGE-NEXT: #NO_APP
281 ; RV64I-LARGE-NEXT: ret
282 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 2000))
286 define void @constraint_m_with_extern_weak_global_1() nounwind {
287 ; RV32I-LABEL: constraint_m_with_extern_weak_global_1:
289 ; RV32I-NEXT: lui a0, %hi(ewg)
291 ; RV32I-NEXT: sw zero, %lo(ewg)(a0)
292 ; RV32I-NEXT: #NO_APP
295 ; RV64I-LABEL: constraint_m_with_extern_weak_global_1:
297 ; RV64I-NEXT: lui a0, %hi(ewg)
299 ; RV64I-NEXT: sw zero, %lo(ewg)(a0)
300 ; RV64I-NEXT: #NO_APP
303 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_1:
304 ; RV32I-MEDIUM: # %bb.0:
305 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi3:
306 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
307 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi3)(a0)
308 ; RV32I-MEDIUM-NEXT: #APP
309 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
310 ; RV32I-MEDIUM-NEXT: #NO_APP
311 ; RV32I-MEDIUM-NEXT: ret
313 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_1:
314 ; RV64I-MEDIUM: # %bb.0:
315 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi3:
316 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
317 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi3)(a0)
318 ; RV64I-MEDIUM-NEXT: #APP
319 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
320 ; RV64I-MEDIUM-NEXT: #NO_APP
321 ; RV64I-MEDIUM-NEXT: ret
323 ; RV64I-LARGE-LABEL: constraint_m_with_extern_weak_global_1:
324 ; RV64I-LARGE: # %bb.0:
325 ; RV64I-LARGE-NEXT: .Lpcrel_hi3:
326 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI6_0)
327 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi3)(a0)
328 ; RV64I-LARGE-NEXT: #APP
329 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
330 ; RV64I-LARGE-NEXT: #NO_APP
331 ; RV64I-LARGE-NEXT: ret
332 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @ewg)
336 define void @constraint_m_with_extern_weak_global_2() nounwind {
337 ; RV32I-LABEL: constraint_m_with_extern_weak_global_2:
339 ; RV32I-NEXT: lui a0, %hi(ewg+4)
341 ; RV32I-NEXT: sw zero, %lo(ewg+4)(a0)
342 ; RV32I-NEXT: #NO_APP
345 ; RV64I-LABEL: constraint_m_with_extern_weak_global_2:
347 ; RV64I-NEXT: lui a0, %hi(ewg+4)
349 ; RV64I-NEXT: sw zero, %lo(ewg+4)(a0)
350 ; RV64I-NEXT: #NO_APP
353 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_2:
354 ; RV32I-MEDIUM: # %bb.0:
355 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi4:
356 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
357 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi4)(a0)
358 ; RV32I-MEDIUM-NEXT: #APP
359 ; RV32I-MEDIUM-NEXT: sw zero, 4(a0)
360 ; RV32I-MEDIUM-NEXT: #NO_APP
361 ; RV32I-MEDIUM-NEXT: ret
363 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_2:
364 ; RV64I-MEDIUM: # %bb.0:
365 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi4:
366 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
367 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi4)(a0)
368 ; RV64I-MEDIUM-NEXT: #APP
369 ; RV64I-MEDIUM-NEXT: sw zero, 4(a0)
370 ; RV64I-MEDIUM-NEXT: #NO_APP
371 ; RV64I-MEDIUM-NEXT: ret
373 ; RV64I-LARGE-LABEL: constraint_m_with_extern_weak_global_2:
374 ; RV64I-LARGE: # %bb.0:
375 ; RV64I-LARGE-NEXT: .Lpcrel_hi4:
376 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI7_0)
377 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi4)(a0)
378 ; RV64I-LARGE-NEXT: #APP
379 ; RV64I-LARGE-NEXT: sw zero, 4(a0)
380 ; RV64I-LARGE-NEXT: #NO_APP
381 ; RV64I-LARGE-NEXT: ret
382 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
386 define void @constraint_m_with_extern_weak_global_3() nounwind {
387 ; RV32I-LABEL: constraint_m_with_extern_weak_global_3:
389 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
391 ; RV32I-NEXT: sw zero, %lo(ewg+8000)(a0)
392 ; RV32I-NEXT: #NO_APP
395 ; RV64I-LABEL: constraint_m_with_extern_weak_global_3:
397 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
399 ; RV64I-NEXT: sw zero, %lo(ewg+8000)(a0)
400 ; RV64I-NEXT: #NO_APP
403 ; RV32I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_3:
404 ; RV32I-MEDIUM: # %bb.0:
405 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi5:
406 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
407 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi5)(a0)
408 ; RV32I-MEDIUM-NEXT: lui a1, 2
409 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
410 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
411 ; RV32I-MEDIUM-NEXT: #APP
412 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
413 ; RV32I-MEDIUM-NEXT: #NO_APP
414 ; RV32I-MEDIUM-NEXT: ret
416 ; RV64I-MEDIUM-LABEL: constraint_m_with_extern_weak_global_3:
417 ; RV64I-MEDIUM: # %bb.0:
418 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi5:
419 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
420 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi5)(a0)
421 ; RV64I-MEDIUM-NEXT: lui a1, 2
422 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
423 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
424 ; RV64I-MEDIUM-NEXT: #APP
425 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
426 ; RV64I-MEDIUM-NEXT: #NO_APP
427 ; RV64I-MEDIUM-NEXT: ret
429 ; RV64I-LARGE-LABEL: constraint_m_with_extern_weak_global_3:
430 ; RV64I-LARGE: # %bb.0:
431 ; RV64I-LARGE-NEXT: .Lpcrel_hi5:
432 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI8_0)
433 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi5)(a0)
434 ; RV64I-LARGE-NEXT: lui a1, 2
435 ; RV64I-LARGE-NEXT: addiw a1, a1, -192
436 ; RV64I-LARGE-NEXT: add a0, a0, a1
437 ; RV64I-LARGE-NEXT: #APP
438 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
439 ; RV64I-LARGE-NEXT: #NO_APP
440 ; RV64I-LARGE-NEXT: ret
441 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
445 define void @constraint_m_with_local_1() nounwind {
446 ; RV32I-LABEL: constraint_m_with_local_1:
447 ; RV32I: # %bb.0: # %entry
448 ; RV32I-NEXT: .Ltmp0: # Block address taken
449 ; RV32I-NEXT: # %bb.1: # %label
450 ; RV32I-NEXT: lui a0, %hi(.Ltmp0)
452 ; RV32I-NEXT: lw zero, %lo(.Ltmp0)(a0)
453 ; RV32I-NEXT: #NO_APP
456 ; RV64I-LABEL: constraint_m_with_local_1:
457 ; RV64I: # %bb.0: # %entry
458 ; RV64I-NEXT: .Ltmp0: # Block address taken
459 ; RV64I-NEXT: # %bb.1: # %label
460 ; RV64I-NEXT: lui a0, %hi(.Ltmp0)
462 ; RV64I-NEXT: lw zero, %lo(.Ltmp0)(a0)
463 ; RV64I-NEXT: #NO_APP
466 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_1:
467 ; RV32I-MEDIUM: # %bb.0: # %entry
468 ; RV32I-MEDIUM-NEXT: .Ltmp0: # Block address taken
469 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
470 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi6:
471 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp0)
472 ; RV32I-MEDIUM-NEXT: #APP
473 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi6)(a0)
474 ; RV32I-MEDIUM-NEXT: #NO_APP
475 ; RV32I-MEDIUM-NEXT: ret
477 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_1:
478 ; RV64I-MEDIUM: # %bb.0: # %entry
479 ; RV64I-MEDIUM-NEXT: .Ltmp0: # Block address taken
480 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
481 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi6:
482 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp0)
483 ; RV64I-MEDIUM-NEXT: #APP
484 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi6)(a0)
485 ; RV64I-MEDIUM-NEXT: #NO_APP
486 ; RV64I-MEDIUM-NEXT: ret
488 ; RV64I-LARGE-LABEL: constraint_m_with_local_1:
489 ; RV64I-LARGE: # %bb.0: # %entry
490 ; RV64I-LARGE-NEXT: .Ltmp0: # Block address taken
491 ; RV64I-LARGE-NEXT: # %bb.1: # %label
492 ; RV64I-LARGE-NEXT: .Lpcrel_hi6:
493 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp0)
494 ; RV64I-LARGE-NEXT: #APP
495 ; RV64I-LARGE-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi6)(a0)
496 ; RV64I-LARGE-NEXT: #NO_APP
497 ; RV64I-LARGE-NEXT: ret
502 tail call void asm sideeffect "lw zero, $0", "*m"(ptr elementtype(ptr) blockaddress(@constraint_m_with_local_1, %label))
506 define void @constraint_m_with_local_2() nounwind {
507 ; RV32I-LABEL: constraint_m_with_local_2:
508 ; RV32I: # %bb.0: # %entry
509 ; RV32I-NEXT: .Ltmp1: # Block address taken
510 ; RV32I-NEXT: # %bb.1: # %label
511 ; RV32I-NEXT: lui a0, %hi(.Ltmp1+4)
513 ; RV32I-NEXT: lw zero, %lo(.Ltmp1+4)(a0)
514 ; RV32I-NEXT: #NO_APP
517 ; RV64I-LABEL: constraint_m_with_local_2:
518 ; RV64I: # %bb.0: # %entry
519 ; RV64I-NEXT: .Ltmp1: # Block address taken
520 ; RV64I-NEXT: # %bb.1: # %label
521 ; RV64I-NEXT: lui a0, %hi(.Ltmp1+4)
523 ; RV64I-NEXT: lw zero, %lo(.Ltmp1+4)(a0)
524 ; RV64I-NEXT: #NO_APP
527 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_2:
528 ; RV32I-MEDIUM: # %bb.0: # %entry
529 ; RV32I-MEDIUM-NEXT: .Ltmp1: # Block address taken
530 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
531 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi7:
532 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp1+4)
533 ; RV32I-MEDIUM-NEXT: #APP
534 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi7)(a0)
535 ; RV32I-MEDIUM-NEXT: #NO_APP
536 ; RV32I-MEDIUM-NEXT: ret
538 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_2:
539 ; RV64I-MEDIUM: # %bb.0: # %entry
540 ; RV64I-MEDIUM-NEXT: .Ltmp1: # Block address taken
541 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
542 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi7:
543 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp1+4)
544 ; RV64I-MEDIUM-NEXT: #APP
545 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi7)(a0)
546 ; RV64I-MEDIUM-NEXT: #NO_APP
547 ; RV64I-MEDIUM-NEXT: ret
549 ; RV64I-LARGE-LABEL: constraint_m_with_local_2:
550 ; RV64I-LARGE: # %bb.0: # %entry
551 ; RV64I-LARGE-NEXT: .Ltmp1: # Block address taken
552 ; RV64I-LARGE-NEXT: # %bb.1: # %label
553 ; RV64I-LARGE-NEXT: .Lpcrel_hi7:
554 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp1+4)
555 ; RV64I-LARGE-NEXT: #APP
556 ; RV64I-LARGE-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi7)(a0)
557 ; RV64I-LARGE-NEXT: #NO_APP
558 ; RV64I-LARGE-NEXT: ret
563 call void asm "lw zero, $0", "*m"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_m_with_local_2, %label), i32 4))
567 define void @constraint_m_with_local_3() nounwind {
568 ; RV32I-LABEL: constraint_m_with_local_3:
569 ; RV32I: # %bb.0: # %entry
570 ; RV32I-NEXT: .Ltmp2: # Block address taken
571 ; RV32I-NEXT: # %bb.1: # %label
572 ; RV32I-NEXT: lui a0, %hi(.Ltmp2+2000)
574 ; RV32I-NEXT: lw zero, %lo(.Ltmp2+2000)(a0)
575 ; RV32I-NEXT: #NO_APP
578 ; RV64I-LABEL: constraint_m_with_local_3:
579 ; RV64I: # %bb.0: # %entry
580 ; RV64I-NEXT: .Ltmp2: # Block address taken
581 ; RV64I-NEXT: # %bb.1: # %label
582 ; RV64I-NEXT: lui a0, %hi(.Ltmp2+2000)
584 ; RV64I-NEXT: lw zero, %lo(.Ltmp2+2000)(a0)
585 ; RV64I-NEXT: #NO_APP
588 ; RV32I-MEDIUM-LABEL: constraint_m_with_local_3:
589 ; RV32I-MEDIUM: # %bb.0: # %entry
590 ; RV32I-MEDIUM-NEXT: .Ltmp2: # Block address taken
591 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
592 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi8:
593 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp2+2000)
594 ; RV32I-MEDIUM-NEXT: #APP
595 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi8)(a0)
596 ; RV32I-MEDIUM-NEXT: #NO_APP
597 ; RV32I-MEDIUM-NEXT: ret
599 ; RV64I-MEDIUM-LABEL: constraint_m_with_local_3:
600 ; RV64I-MEDIUM: # %bb.0: # %entry
601 ; RV64I-MEDIUM-NEXT: .Ltmp2: # Block address taken
602 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
603 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi8:
604 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp2+2000)
605 ; RV64I-MEDIUM-NEXT: #APP
606 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi8)(a0)
607 ; RV64I-MEDIUM-NEXT: #NO_APP
608 ; RV64I-MEDIUM-NEXT: ret
610 ; RV64I-LARGE-LABEL: constraint_m_with_local_3:
611 ; RV64I-LARGE: # %bb.0: # %entry
612 ; RV64I-LARGE-NEXT: .Ltmp2: # Block address taken
613 ; RV64I-LARGE-NEXT: # %bb.1: # %label
614 ; RV64I-LARGE-NEXT: .Lpcrel_hi8:
615 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp2+2000)
616 ; RV64I-LARGE-NEXT: #APP
617 ; RV64I-LARGE-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi8)(a0)
618 ; RV64I-LARGE-NEXT: #NO_APP
619 ; RV64I-LARGE-NEXT: ret
624 call void asm "lw zero, $0", "*m"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_m_with_local_3, %label), i32 2000))
628 define void @constraint_m_with_multi_operands() nounwind {
629 ; RV32I-NO-INTEGRATED-LABEL: constraint_m_with_multi_operands:
630 ; RV32I-NO-INTEGRATED: # %bb.0:
631 ; RV32I-NO-INTEGRATED-NEXT: lui a0, %hi(eg)
632 ; RV32I-NO-INTEGRATED-NEXT: #APP
633 ; RV32I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a0); sw zero, %lo(eg)(a0)
634 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
635 ; RV32I-NO-INTEGRATED-NEXT: ret
637 ; RV64I-NO-INTEGRATED-LABEL: constraint_m_with_multi_operands:
638 ; RV64I-NO-INTEGRATED: # %bb.0:
639 ; RV64I-NO-INTEGRATED-NEXT: lui a0, %hi(eg)
640 ; RV64I-NO-INTEGRATED-NEXT: #APP
641 ; RV64I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a0); sw zero, %lo(eg)(a0)
642 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
643 ; RV64I-NO-INTEGRATED-NEXT: ret
645 ; RV32I-MEDIUM-NO-INTEGRATED-LABEL: constraint_m_with_multi_operands:
646 ; RV32I-MEDIUM-NO-INTEGRATED: # %bb.0:
647 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi9:
648 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: auipc a0, %pcrel_hi(eg)
649 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
650 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi9)(a0); sw zero, %pcrel_lo(.Lpcrel_hi9)(a0)
651 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
652 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
654 ; RV64I-MEDIUM-NO-INTEGRATED-LABEL: constraint_m_with_multi_operands:
655 ; RV64I-MEDIUM-NO-INTEGRATED: # %bb.0:
656 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi9:
657 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: auipc a0, %pcrel_hi(eg)
658 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
659 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi9)(a0); sw zero, %pcrel_lo(.Lpcrel_hi9)(a0)
660 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
661 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
663 ; RV64I-LARGE-NO-INTEGRATED-LABEL: constraint_m_with_multi_operands:
664 ; RV64I-LARGE-NO-INTEGRATED: # %bb.0:
665 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .Lpcrel_hi9:
666 ; RV64I-LARGE-NO-INTEGRATED-NEXT: auipc a0, %pcrel_hi(.LCPI12_0)
667 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi9)(a0)
668 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
669 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a0); sw zero, 0(a0)
670 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
671 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
673 ; RV32I-INTEGRATED-LABEL: constraint_m_with_multi_operands:
674 ; RV32I-INTEGRATED: # %bb.0:
675 ; RV32I-INTEGRATED-NEXT: lui a0, %hi(eg)
676 ; RV32I-INTEGRATED-NEXT: #APP
677 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a0)
678 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a0)
679 ; RV32I-INTEGRATED-NEXT: #NO_APP
680 ; RV32I-INTEGRATED-NEXT: ret
682 ; RV64I-INTEGRATED-LABEL: constraint_m_with_multi_operands:
683 ; RV64I-INTEGRATED: # %bb.0:
684 ; RV64I-INTEGRATED-NEXT: lui a0, %hi(eg)
685 ; RV64I-INTEGRATED-NEXT: #APP
686 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a0)
687 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a0)
688 ; RV64I-INTEGRATED-NEXT: #NO_APP
689 ; RV64I-INTEGRATED-NEXT: ret
691 ; RV32I-MEDIUM-INTEGRATED-LABEL: constraint_m_with_multi_operands:
692 ; RV32I-MEDIUM-INTEGRATED: # %bb.0:
693 ; RV32I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi9:
694 ; RV32I-MEDIUM-INTEGRATED-NEXT: auipc a0, %pcrel_hi(eg)
695 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
696 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi9)(a0)
697 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi9)(a0)
698 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
699 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
701 ; RV64I-MEDIUM-INTEGRATED-LABEL: constraint_m_with_multi_operands:
702 ; RV64I-MEDIUM-INTEGRATED: # %bb.0:
703 ; RV64I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi9:
704 ; RV64I-MEDIUM-INTEGRATED-NEXT: auipc a0, %pcrel_hi(eg)
705 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
706 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi9)(a0)
707 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi9)(a0)
708 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
709 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
711 ; RV64I-LARGE-INTEGRATED-LABEL: constraint_m_with_multi_operands:
712 ; RV64I-LARGE-INTEGRATED: # %bb.0:
713 ; RV64I-LARGE-INTEGRATED-NEXT: .Lpcrel_hi9:
714 ; RV64I-LARGE-INTEGRATED-NEXT: auipc a0, %pcrel_hi(.LCPI12_0)
715 ; RV64I-LARGE-INTEGRATED-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi9)(a0)
716 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
717 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a0)
718 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a0)
719 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
720 ; RV64I-LARGE-INTEGRATED-NEXT: ret
721 call void asm "sw zero, $0; sw zero, $1", "=*m,=*m"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
725 define void @constraint_m_with_multi_asm() nounwind {
726 ; RV32I-LABEL: constraint_m_with_multi_asm:
728 ; RV32I-NEXT: lui a0, %hi(eg)
730 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
731 ; RV32I-NEXT: #NO_APP
733 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
734 ; RV32I-NEXT: #NO_APP
737 ; RV64I-LABEL: constraint_m_with_multi_asm:
739 ; RV64I-NEXT: lui a0, %hi(eg)
741 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
742 ; RV64I-NEXT: #NO_APP
744 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
745 ; RV64I-NEXT: #NO_APP
748 ; RV32I-MEDIUM-LABEL: constraint_m_with_multi_asm:
749 ; RV32I-MEDIUM: # %bb.0:
750 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi10:
751 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
752 ; RV32I-MEDIUM-NEXT: #APP
753 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi10)(a0)
754 ; RV32I-MEDIUM-NEXT: #NO_APP
755 ; RV32I-MEDIUM-NEXT: #APP
756 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi10)(a0)
757 ; RV32I-MEDIUM-NEXT: #NO_APP
758 ; RV32I-MEDIUM-NEXT: ret
760 ; RV64I-MEDIUM-LABEL: constraint_m_with_multi_asm:
761 ; RV64I-MEDIUM: # %bb.0:
762 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi10:
763 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
764 ; RV64I-MEDIUM-NEXT: #APP
765 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi10)(a0)
766 ; RV64I-MEDIUM-NEXT: #NO_APP
767 ; RV64I-MEDIUM-NEXT: #APP
768 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi10)(a0)
769 ; RV64I-MEDIUM-NEXT: #NO_APP
770 ; RV64I-MEDIUM-NEXT: ret
772 ; RV64I-LARGE-LABEL: constraint_m_with_multi_asm:
773 ; RV64I-LARGE: # %bb.0:
774 ; RV64I-LARGE-NEXT: .Lpcrel_hi10:
775 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI13_0)
776 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi10)(a0)
777 ; RV64I-LARGE-NEXT: #APP
778 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
779 ; RV64I-LARGE-NEXT: #NO_APP
780 ; RV64I-LARGE-NEXT: #APP
781 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
782 ; RV64I-LARGE-NEXT: #NO_APP
783 ; RV64I-LARGE-NEXT: ret
784 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
785 call void asm "sw zero, $0", "=*m"(ptr elementtype(i32) @eg)
789 define i32 @constraint_m_with_callbr_multi_operands(i32 %a) {
790 ; RV32I-NO-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
791 ; RV32I-NO-INTEGRATED: # %bb.0: # %entry
792 ; RV32I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
793 ; RV32I-NO-INTEGRATED-NEXT: #APP
794 ; RV32I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB14_2
795 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
796 ; RV32I-NO-INTEGRATED-NEXT: # %bb.1: # %normal
797 ; RV32I-NO-INTEGRATED-NEXT: li a0, 0
798 ; RV32I-NO-INTEGRATED-NEXT: ret
799 ; RV32I-NO-INTEGRATED-NEXT: .LBB14_2: # Block address taken
800 ; RV32I-NO-INTEGRATED-NEXT: # %fail
801 ; RV32I-NO-INTEGRATED-NEXT: # Label of block must be emitted
802 ; RV32I-NO-INTEGRATED-NEXT: li a0, 1
803 ; RV32I-NO-INTEGRATED-NEXT: ret
805 ; RV64I-NO-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
806 ; RV64I-NO-INTEGRATED: # %bb.0: # %entry
807 ; RV64I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
808 ; RV64I-NO-INTEGRATED-NEXT: #APP
809 ; RV64I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB14_2
810 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
811 ; RV64I-NO-INTEGRATED-NEXT: # %bb.1: # %normal
812 ; RV64I-NO-INTEGRATED-NEXT: li a0, 0
813 ; RV64I-NO-INTEGRATED-NEXT: ret
814 ; RV64I-NO-INTEGRATED-NEXT: .LBB14_2: # Block address taken
815 ; RV64I-NO-INTEGRATED-NEXT: # %fail
816 ; RV64I-NO-INTEGRATED-NEXT: # Label of block must be emitted
817 ; RV64I-NO-INTEGRATED-NEXT: li a0, 1
818 ; RV64I-NO-INTEGRATED-NEXT: ret
820 ; RV32I-MEDIUM-NO-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
821 ; RV32I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
822 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi11:
823 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
824 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
825 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi11)(a1); sw zero, %pcrel_lo(.Lpcrel_hi11)(a1); beqz a0, .LBB14_2
826 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
827 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal
828 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
829 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
830 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .LBB14_2: # Block address taken
831 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
832 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
833 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
834 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
836 ; RV64I-MEDIUM-NO-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
837 ; RV64I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
838 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi11:
839 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
840 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
841 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi11)(a1); sw zero, %pcrel_lo(.Lpcrel_hi11)(a1); beqz a0, .LBB14_2
842 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
843 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal
844 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
845 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
846 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .LBB14_2: # Block address taken
847 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
848 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
849 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
850 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
852 ; RV64I-LARGE-NO-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
853 ; RV64I-LARGE-NO-INTEGRATED: # %bb.0: # %entry
854 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .Lpcrel_hi11:
855 ; RV64I-LARGE-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI14_0)
856 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi11)(a1)
857 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
858 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB14_2
859 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
860 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.1: # %normal
861 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 0
862 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
863 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .LBB14_2: # Block address taken
864 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %fail
865 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # Label of block must be emitted
866 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 1
867 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
869 ; RV32I-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
870 ; RV32I-INTEGRATED: # %bb.0: # %entry
871 ; RV32I-INTEGRATED-NEXT: lui a1, %hi(eg)
872 ; RV32I-INTEGRATED-NEXT: #APP
873 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
874 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
875 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB14_2
876 ; RV32I-INTEGRATED-NEXT: #NO_APP
877 ; RV32I-INTEGRATED-NEXT: # %bb.1: # %normal
878 ; RV32I-INTEGRATED-NEXT: li a0, 0
879 ; RV32I-INTEGRATED-NEXT: ret
880 ; RV32I-INTEGRATED-NEXT: .LBB14_2: # Block address taken
881 ; RV32I-INTEGRATED-NEXT: # %fail
882 ; RV32I-INTEGRATED-NEXT: # Label of block must be emitted
883 ; RV32I-INTEGRATED-NEXT: li a0, 1
884 ; RV32I-INTEGRATED-NEXT: ret
886 ; RV64I-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
887 ; RV64I-INTEGRATED: # %bb.0: # %entry
888 ; RV64I-INTEGRATED-NEXT: lui a1, %hi(eg)
889 ; RV64I-INTEGRATED-NEXT: #APP
890 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
891 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
892 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB14_2
893 ; RV64I-INTEGRATED-NEXT: #NO_APP
894 ; RV64I-INTEGRATED-NEXT: # %bb.1: # %normal
895 ; RV64I-INTEGRATED-NEXT: li a0, 0
896 ; RV64I-INTEGRATED-NEXT: ret
897 ; RV64I-INTEGRATED-NEXT: .LBB14_2: # Block address taken
898 ; RV64I-INTEGRATED-NEXT: # %fail
899 ; RV64I-INTEGRATED-NEXT: # Label of block must be emitted
900 ; RV64I-INTEGRATED-NEXT: li a0, 1
901 ; RV64I-INTEGRATED-NEXT: ret
903 ; RV32I-MEDIUM-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
904 ; RV32I-MEDIUM-INTEGRATED: # %bb.0: # %entry
905 ; RV32I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi11:
906 ; RV32I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
907 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
908 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi11)(a1)
909 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi11)(a1)
910 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB14_2
911 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
912 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal
913 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 0
914 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
915 ; RV32I-MEDIUM-INTEGRATED-NEXT: .LBB14_2: # Block address taken
916 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %fail
917 ; RV32I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
918 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 1
919 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
921 ; RV64I-MEDIUM-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
922 ; RV64I-MEDIUM-INTEGRATED: # %bb.0: # %entry
923 ; RV64I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi11:
924 ; RV64I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
925 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
926 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi11)(a1)
927 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi11)(a1)
928 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB14_2
929 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
930 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal
931 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 0
932 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
933 ; RV64I-MEDIUM-INTEGRATED-NEXT: .LBB14_2: # Block address taken
934 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %fail
935 ; RV64I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
936 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 1
937 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
939 ; RV64I-LARGE-INTEGRATED-LABEL: constraint_m_with_callbr_multi_operands:
940 ; RV64I-LARGE-INTEGRATED: # %bb.0: # %entry
941 ; RV64I-LARGE-INTEGRATED-NEXT: .Lpcrel_hi11:
942 ; RV64I-LARGE-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI14_0)
943 ; RV64I-LARGE-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi11)(a1)
944 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
945 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
946 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
947 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB14_2
948 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
949 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.1: # %normal
950 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 0
951 ; RV64I-LARGE-INTEGRATED-NEXT: ret
952 ; RV64I-LARGE-INTEGRATED-NEXT: .LBB14_2: # Block address taken
953 ; RV64I-LARGE-INTEGRATED-NEXT: # %fail
954 ; RV64I-LARGE-INTEGRATED-NEXT: # Label of block must be emitted
955 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 1
956 ; RV64I-LARGE-INTEGRATED-NEXT: ret
958 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]
967 define i32 @constraint_m_with_multi_callbr_asm(i32 %a) {
968 ; RV32I-NO-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
969 ; RV32I-NO-INTEGRATED: # %bb.0: # %entry
970 ; RV32I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
971 ; RV32I-NO-INTEGRATED-NEXT: #APP
972 ; RV32I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
973 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
974 ; RV32I-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
975 ; RV32I-NO-INTEGRATED-NEXT: #APP
976 ; RV32I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
977 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
978 ; RV32I-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
979 ; RV32I-NO-INTEGRATED-NEXT: li a0, 0
980 ; RV32I-NO-INTEGRATED-NEXT: ret
981 ; RV32I-NO-INTEGRATED-NEXT: .LBB15_3: # Block address taken
982 ; RV32I-NO-INTEGRATED-NEXT: # %fail
983 ; RV32I-NO-INTEGRATED-NEXT: # Label of block must be emitted
984 ; RV32I-NO-INTEGRATED-NEXT: li a0, 1
985 ; RV32I-NO-INTEGRATED-NEXT: ret
987 ; RV64I-NO-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
988 ; RV64I-NO-INTEGRATED: # %bb.0: # %entry
989 ; RV64I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
990 ; RV64I-NO-INTEGRATED-NEXT: #APP
991 ; RV64I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
992 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
993 ; RV64I-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
994 ; RV64I-NO-INTEGRATED-NEXT: #APP
995 ; RV64I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB15_3
996 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
997 ; RV64I-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
998 ; RV64I-NO-INTEGRATED-NEXT: li a0, 0
999 ; RV64I-NO-INTEGRATED-NEXT: ret
1000 ; RV64I-NO-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1001 ; RV64I-NO-INTEGRATED-NEXT: # %fail
1002 ; RV64I-NO-INTEGRATED-NEXT: # Label of block must be emitted
1003 ; RV64I-NO-INTEGRATED-NEXT: li a0, 1
1004 ; RV64I-NO-INTEGRATED-NEXT: ret
1006 ; RV32I-MEDIUM-NO-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
1007 ; RV32I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
1008 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi12:
1009 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1010 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1011 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1); beqz a0, .LBB15_3
1012 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1013 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
1014 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1015 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1); beqz a0, .LBB15_3
1016 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1017 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
1018 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
1019 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
1020 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1021 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
1022 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
1023 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
1024 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
1026 ; RV64I-MEDIUM-NO-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
1027 ; RV64I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
1028 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi12:
1029 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1030 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1031 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1); beqz a0, .LBB15_3
1032 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1033 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
1034 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1035 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1); beqz a0, .LBB15_3
1036 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1037 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
1038 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
1039 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
1040 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1041 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
1042 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
1043 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
1044 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
1046 ; RV64I-LARGE-NO-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
1047 ; RV64I-LARGE-NO-INTEGRATED: # %bb.0: # %entry
1048 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .Lpcrel_hi12:
1049 ; RV64I-LARGE-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI15_0)
1050 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi12)(a1)
1051 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
1052 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB15_3
1053 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
1054 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
1055 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
1056 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB15_3
1057 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
1058 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
1059 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 0
1060 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
1061 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1062 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %fail
1063 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # Label of block must be emitted
1064 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 1
1065 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
1067 ; RV32I-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
1068 ; RV32I-INTEGRATED: # %bb.0: # %entry
1069 ; RV32I-INTEGRATED-NEXT: lui a1, %hi(eg)
1070 ; RV32I-INTEGRATED-NEXT: #APP
1071 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1072 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB15_3
1073 ; RV32I-INTEGRATED-NEXT: #NO_APP
1074 ; RV32I-INTEGRATED-NEXT: # %bb.1: # %normal0
1075 ; RV32I-INTEGRATED-NEXT: #APP
1076 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1077 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB15_3
1078 ; RV32I-INTEGRATED-NEXT: #NO_APP
1079 ; RV32I-INTEGRATED-NEXT: # %bb.2: # %normal1
1080 ; RV32I-INTEGRATED-NEXT: li a0, 0
1081 ; RV32I-INTEGRATED-NEXT: ret
1082 ; RV32I-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1083 ; RV32I-INTEGRATED-NEXT: # %fail
1084 ; RV32I-INTEGRATED-NEXT: # Label of block must be emitted
1085 ; RV32I-INTEGRATED-NEXT: li a0, 1
1086 ; RV32I-INTEGRATED-NEXT: ret
1088 ; RV64I-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
1089 ; RV64I-INTEGRATED: # %bb.0: # %entry
1090 ; RV64I-INTEGRATED-NEXT: lui a1, %hi(eg)
1091 ; RV64I-INTEGRATED-NEXT: #APP
1092 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1093 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB15_3
1094 ; RV64I-INTEGRATED-NEXT: #NO_APP
1095 ; RV64I-INTEGRATED-NEXT: # %bb.1: # %normal0
1096 ; RV64I-INTEGRATED-NEXT: #APP
1097 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1098 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB15_3
1099 ; RV64I-INTEGRATED-NEXT: #NO_APP
1100 ; RV64I-INTEGRATED-NEXT: # %bb.2: # %normal1
1101 ; RV64I-INTEGRATED-NEXT: li a0, 0
1102 ; RV64I-INTEGRATED-NEXT: ret
1103 ; RV64I-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1104 ; RV64I-INTEGRATED-NEXT: # %fail
1105 ; RV64I-INTEGRATED-NEXT: # Label of block must be emitted
1106 ; RV64I-INTEGRATED-NEXT: li a0, 1
1107 ; RV64I-INTEGRATED-NEXT: ret
1109 ; RV32I-MEDIUM-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
1110 ; RV32I-MEDIUM-INTEGRATED: # %bb.0: # %entry
1111 ; RV32I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi12:
1112 ; RV32I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1113 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
1114 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1)
1115 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB15_3
1116 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
1117 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal0
1118 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
1119 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1)
1120 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB15_3
1121 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
1122 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.2: # %normal1
1123 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 0
1124 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
1125 ; RV32I-MEDIUM-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1126 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %fail
1127 ; RV32I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
1128 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 1
1129 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
1131 ; RV64I-MEDIUM-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
1132 ; RV64I-MEDIUM-INTEGRATED: # %bb.0: # %entry
1133 ; RV64I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi12:
1134 ; RV64I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1135 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
1136 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1)
1137 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB15_3
1138 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
1139 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal0
1140 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
1141 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi12)(a1)
1142 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB15_3
1143 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
1144 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.2: # %normal1
1145 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 0
1146 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
1147 ; RV64I-MEDIUM-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1148 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %fail
1149 ; RV64I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
1150 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 1
1151 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
1153 ; RV64I-LARGE-INTEGRATED-LABEL: constraint_m_with_multi_callbr_asm:
1154 ; RV64I-LARGE-INTEGRATED: # %bb.0: # %entry
1155 ; RV64I-LARGE-INTEGRATED-NEXT: .Lpcrel_hi12:
1156 ; RV64I-LARGE-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI15_0)
1157 ; RV64I-LARGE-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi12)(a1)
1158 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
1159 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
1160 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB15_3
1161 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
1162 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.1: # %normal0
1163 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
1164 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
1165 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB15_3
1166 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
1167 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.2: # %normal1
1168 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 0
1169 ; RV64I-LARGE-INTEGRATED-NEXT: ret
1170 ; RV64I-LARGE-INTEGRATED-NEXT: .LBB15_3: # Block address taken
1171 ; RV64I-LARGE-INTEGRATED-NEXT: # %fail
1172 ; RV64I-LARGE-INTEGRATED-NEXT: # Label of block must be emitted
1173 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 1
1174 ; RV64I-LARGE-INTEGRATED-NEXT: ret
1176 callbr void asm "sw zero, $0; beqz $1, $2", "=*m,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
1179 callbr void asm "sw zero, $0; beqz $1, $2", "=*m,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
1188 define void @constraint_o_1(ptr %a) nounwind {
1189 ; RV32I-LABEL: constraint_o_1:
1192 ; RV32I-NEXT: #NO_APP
1195 ; RV64I-LABEL: constraint_o_1:
1198 ; RV64I-NEXT: #NO_APP
1201 ; RV32I-MEDIUM-LABEL: constraint_o_1:
1202 ; RV32I-MEDIUM: # %bb.0:
1203 ; RV32I-MEDIUM-NEXT: #APP
1204 ; RV32I-MEDIUM-NEXT: #NO_APP
1205 ; RV32I-MEDIUM-NEXT: ret
1207 ; RV64I-MEDIUM-LABEL: constraint_o_1:
1208 ; RV64I-MEDIUM: # %bb.0:
1209 ; RV64I-MEDIUM-NEXT: #APP
1210 ; RV64I-MEDIUM-NEXT: #NO_APP
1211 ; RV64I-MEDIUM-NEXT: ret
1213 ; RV64I-LARGE-LABEL: constraint_o_1:
1214 ; RV64I-LARGE: # %bb.0:
1215 ; RV64I-LARGE-NEXT: #APP
1216 ; RV64I-LARGE-NEXT: #NO_APP
1217 ; RV64I-LARGE-NEXT: ret
1218 call void asm sideeffect "", "=*o"(ptr elementtype(i32) %a)
1222 define i32 @constraint_o_2(ptr %a) nounwind {
1223 ; RV32I-LABEL: constraint_o_2:
1226 ; RV32I-NEXT: lw a0, 0(a0)
1227 ; RV32I-NEXT: #NO_APP
1230 ; RV64I-LABEL: constraint_o_2:
1233 ; RV64I-NEXT: lw a0, 0(a0)
1234 ; RV64I-NEXT: #NO_APP
1237 ; RV32I-MEDIUM-LABEL: constraint_o_2:
1238 ; RV32I-MEDIUM: # %bb.0:
1239 ; RV32I-MEDIUM-NEXT: #APP
1240 ; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
1241 ; RV32I-MEDIUM-NEXT: #NO_APP
1242 ; RV32I-MEDIUM-NEXT: ret
1244 ; RV64I-MEDIUM-LABEL: constraint_o_2:
1245 ; RV64I-MEDIUM: # %bb.0:
1246 ; RV64I-MEDIUM-NEXT: #APP
1247 ; RV64I-MEDIUM-NEXT: lw a0, 0(a0)
1248 ; RV64I-MEDIUM-NEXT: #NO_APP
1249 ; RV64I-MEDIUM-NEXT: ret
1251 ; RV64I-LARGE-LABEL: constraint_o_2:
1252 ; RV64I-LARGE: # %bb.0:
1253 ; RV64I-LARGE-NEXT: #APP
1254 ; RV64I-LARGE-NEXT: lw a0, 0(a0)
1255 ; RV64I-LARGE-NEXT: #NO_APP
1256 ; RV64I-LARGE-NEXT: ret
1257 %1 = tail call i32 asm "lw $0, $1", "=r,*o"(ptr elementtype(i32) %a)
1261 define i32 @constraint_o_with_offset(ptr %a) nounwind {
1262 ; RV32I-LABEL: constraint_o_with_offset:
1265 ; RV32I-NEXT: lw a0, 4(a0)
1266 ; RV32I-NEXT: #NO_APP
1269 ; RV64I-LABEL: constraint_o_with_offset:
1272 ; RV64I-NEXT: lw a0, 4(a0)
1273 ; RV64I-NEXT: #NO_APP
1276 ; RV32I-MEDIUM-LABEL: constraint_o_with_offset:
1277 ; RV32I-MEDIUM: # %bb.0:
1278 ; RV32I-MEDIUM-NEXT: #APP
1279 ; RV32I-MEDIUM-NEXT: lw a0, 4(a0)
1280 ; RV32I-MEDIUM-NEXT: #NO_APP
1281 ; RV32I-MEDIUM-NEXT: ret
1283 ; RV64I-MEDIUM-LABEL: constraint_o_with_offset:
1284 ; RV64I-MEDIUM: # %bb.0:
1285 ; RV64I-MEDIUM-NEXT: #APP
1286 ; RV64I-MEDIUM-NEXT: lw a0, 4(a0)
1287 ; RV64I-MEDIUM-NEXT: #NO_APP
1288 ; RV64I-MEDIUM-NEXT: ret
1290 ; RV64I-LARGE-LABEL: constraint_o_with_offset:
1291 ; RV64I-LARGE: # %bb.0:
1292 ; RV64I-LARGE-NEXT: #APP
1293 ; RV64I-LARGE-NEXT: lw a0, 4(a0)
1294 ; RV64I-LARGE-NEXT: #NO_APP
1295 ; RV64I-LARGE-NEXT: ret
1296 %1 = getelementptr i32, ptr %a, i32 1
1297 %2 = tail call i32 asm "lw $0, $1", "=r,*o"(ptr elementtype(i32) %1)
1301 define void @constraint_o_with_global_1() nounwind {
1302 ; RV32I-LABEL: constraint_o_with_global_1:
1304 ; RV32I-NEXT: lui a0, %hi(eg)
1306 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
1307 ; RV32I-NEXT: #NO_APP
1310 ; RV64I-LABEL: constraint_o_with_global_1:
1312 ; RV64I-NEXT: lui a0, %hi(eg)
1314 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
1315 ; RV64I-NEXT: #NO_APP
1318 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_1:
1319 ; RV32I-MEDIUM: # %bb.0:
1320 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi13:
1321 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1322 ; RV32I-MEDIUM-NEXT: #APP
1323 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi13)(a0)
1324 ; RV32I-MEDIUM-NEXT: #NO_APP
1325 ; RV32I-MEDIUM-NEXT: ret
1327 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_1:
1328 ; RV64I-MEDIUM: # %bb.0:
1329 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi13:
1330 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1331 ; RV64I-MEDIUM-NEXT: #APP
1332 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi13)(a0)
1333 ; RV64I-MEDIUM-NEXT: #NO_APP
1334 ; RV64I-MEDIUM-NEXT: ret
1336 ; RV64I-LARGE-LABEL: constraint_o_with_global_1:
1337 ; RV64I-LARGE: # %bb.0:
1338 ; RV64I-LARGE-NEXT: .Lpcrel_hi13:
1339 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI19_0)
1340 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi13)(a0)
1341 ; RV64I-LARGE-NEXT: #APP
1342 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
1343 ; RV64I-LARGE-NEXT: #NO_APP
1344 ; RV64I-LARGE-NEXT: ret
1345 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
1349 define void @constraint_o_with_global_2() nounwind {
1350 ; RV32I-LABEL: constraint_o_with_global_2:
1352 ; RV32I-NEXT: lui a0, %hi(eg+4)
1354 ; RV32I-NEXT: sw zero, %lo(eg+4)(a0)
1355 ; RV32I-NEXT: #NO_APP
1358 ; RV64I-LABEL: constraint_o_with_global_2:
1360 ; RV64I-NEXT: lui a0, %hi(eg+4)
1362 ; RV64I-NEXT: sw zero, %lo(eg+4)(a0)
1363 ; RV64I-NEXT: #NO_APP
1366 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_2:
1367 ; RV32I-MEDIUM: # %bb.0:
1368 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi14:
1369 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
1370 ; RV32I-MEDIUM-NEXT: #APP
1371 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi14)(a0)
1372 ; RV32I-MEDIUM-NEXT: #NO_APP
1373 ; RV32I-MEDIUM-NEXT: ret
1375 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_2:
1376 ; RV64I-MEDIUM: # %bb.0:
1377 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi14:
1378 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
1379 ; RV64I-MEDIUM-NEXT: #APP
1380 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi14)(a0)
1381 ; RV64I-MEDIUM-NEXT: #NO_APP
1382 ; RV64I-MEDIUM-NEXT: ret
1384 ; RV64I-LARGE-LABEL: constraint_o_with_global_2:
1385 ; RV64I-LARGE: # %bb.0:
1386 ; RV64I-LARGE-NEXT: .Lpcrel_hi14:
1387 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI20_0)
1388 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi14)(a0)
1389 ; RV64I-LARGE-NEXT: #APP
1390 ; RV64I-LARGE-NEXT: sw zero, 4(a0)
1391 ; RV64I-LARGE-NEXT: #NO_APP
1392 ; RV64I-LARGE-NEXT: ret
1393 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
1397 define void @constraint_o_with_global_3() nounwind {
1398 ; RV32I-LABEL: constraint_o_with_global_3:
1400 ; RV32I-NEXT: lui a0, %hi(eg+8000)
1402 ; RV32I-NEXT: sw zero, %lo(eg+8000)(a0)
1403 ; RV32I-NEXT: #NO_APP
1406 ; RV64I-LABEL: constraint_o_with_global_3:
1408 ; RV64I-NEXT: lui a0, %hi(eg+8000)
1410 ; RV64I-NEXT: sw zero, %lo(eg+8000)(a0)
1411 ; RV64I-NEXT: #NO_APP
1414 ; RV32I-MEDIUM-LABEL: constraint_o_with_global_3:
1415 ; RV32I-MEDIUM: # %bb.0:
1416 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi15:
1417 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
1418 ; RV32I-MEDIUM-NEXT: #APP
1419 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi15)(a0)
1420 ; RV32I-MEDIUM-NEXT: #NO_APP
1421 ; RV32I-MEDIUM-NEXT: ret
1423 ; RV64I-MEDIUM-LABEL: constraint_o_with_global_3:
1424 ; RV64I-MEDIUM: # %bb.0:
1425 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi15:
1426 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
1427 ; RV64I-MEDIUM-NEXT: #APP
1428 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi15)(a0)
1429 ; RV64I-MEDIUM-NEXT: #NO_APP
1430 ; RV64I-MEDIUM-NEXT: ret
1432 ; RV64I-LARGE-LABEL: constraint_o_with_global_3:
1433 ; RV64I-LARGE: # %bb.0:
1434 ; RV64I-LARGE-NEXT: .Lpcrel_hi15:
1435 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI21_0)
1436 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi15)(a0)
1437 ; RV64I-LARGE-NEXT: lui a1, 2
1438 ; RV64I-LARGE-NEXT: addiw a1, a1, -192
1439 ; RV64I-LARGE-NEXT: add a0, a0, a1
1440 ; RV64I-LARGE-NEXT: #APP
1441 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
1442 ; RV64I-LARGE-NEXT: #NO_APP
1443 ; RV64I-LARGE-NEXT: ret
1444 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 2000))
1448 define void @constraint_o_with_extern_weak_global_1() nounwind {
1449 ; RV32I-LABEL: constraint_o_with_extern_weak_global_1:
1451 ; RV32I-NEXT: lui a0, %hi(ewg)
1453 ; RV32I-NEXT: sw zero, %lo(ewg)(a0)
1454 ; RV32I-NEXT: #NO_APP
1457 ; RV64I-LABEL: constraint_o_with_extern_weak_global_1:
1459 ; RV64I-NEXT: lui a0, %hi(ewg)
1461 ; RV64I-NEXT: sw zero, %lo(ewg)(a0)
1462 ; RV64I-NEXT: #NO_APP
1465 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_1:
1466 ; RV32I-MEDIUM: # %bb.0:
1467 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi16:
1468 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1469 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi16)(a0)
1470 ; RV32I-MEDIUM-NEXT: #APP
1471 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1472 ; RV32I-MEDIUM-NEXT: #NO_APP
1473 ; RV32I-MEDIUM-NEXT: ret
1475 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_1:
1476 ; RV64I-MEDIUM: # %bb.0:
1477 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi16:
1478 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1479 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi16)(a0)
1480 ; RV64I-MEDIUM-NEXT: #APP
1481 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1482 ; RV64I-MEDIUM-NEXT: #NO_APP
1483 ; RV64I-MEDIUM-NEXT: ret
1485 ; RV64I-LARGE-LABEL: constraint_o_with_extern_weak_global_1:
1486 ; RV64I-LARGE: # %bb.0:
1487 ; RV64I-LARGE-NEXT: .Lpcrel_hi16:
1488 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI22_0)
1489 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi16)(a0)
1490 ; RV64I-LARGE-NEXT: #APP
1491 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
1492 ; RV64I-LARGE-NEXT: #NO_APP
1493 ; RV64I-LARGE-NEXT: ret
1494 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @ewg)
1498 define void @constraint_o_with_extern_weak_global_2() nounwind {
1499 ; RV32I-LABEL: constraint_o_with_extern_weak_global_2:
1501 ; RV32I-NEXT: lui a0, %hi(ewg+4)
1503 ; RV32I-NEXT: sw zero, %lo(ewg+4)(a0)
1504 ; RV32I-NEXT: #NO_APP
1507 ; RV64I-LABEL: constraint_o_with_extern_weak_global_2:
1509 ; RV64I-NEXT: lui a0, %hi(ewg+4)
1511 ; RV64I-NEXT: sw zero, %lo(ewg+4)(a0)
1512 ; RV64I-NEXT: #NO_APP
1515 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_2:
1516 ; RV32I-MEDIUM: # %bb.0:
1517 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi17:
1518 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1519 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi17)(a0)
1520 ; RV32I-MEDIUM-NEXT: #APP
1521 ; RV32I-MEDIUM-NEXT: sw zero, 4(a0)
1522 ; RV32I-MEDIUM-NEXT: #NO_APP
1523 ; RV32I-MEDIUM-NEXT: ret
1525 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_2:
1526 ; RV64I-MEDIUM: # %bb.0:
1527 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi17:
1528 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1529 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi17)(a0)
1530 ; RV64I-MEDIUM-NEXT: #APP
1531 ; RV64I-MEDIUM-NEXT: sw zero, 4(a0)
1532 ; RV64I-MEDIUM-NEXT: #NO_APP
1533 ; RV64I-MEDIUM-NEXT: ret
1535 ; RV64I-LARGE-LABEL: constraint_o_with_extern_weak_global_2:
1536 ; RV64I-LARGE: # %bb.0:
1537 ; RV64I-LARGE-NEXT: .Lpcrel_hi17:
1538 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI23_0)
1539 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi17)(a0)
1540 ; RV64I-LARGE-NEXT: #APP
1541 ; RV64I-LARGE-NEXT: sw zero, 4(a0)
1542 ; RV64I-LARGE-NEXT: #NO_APP
1543 ; RV64I-LARGE-NEXT: ret
1544 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
1548 define void @constraint_o_with_extern_weak_global_3() nounwind {
1549 ; RV32I-LABEL: constraint_o_with_extern_weak_global_3:
1551 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
1553 ; RV32I-NEXT: sw zero, %lo(ewg+8000)(a0)
1554 ; RV32I-NEXT: #NO_APP
1557 ; RV64I-LABEL: constraint_o_with_extern_weak_global_3:
1559 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
1561 ; RV64I-NEXT: sw zero, %lo(ewg+8000)(a0)
1562 ; RV64I-NEXT: #NO_APP
1565 ; RV32I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_3:
1566 ; RV32I-MEDIUM: # %bb.0:
1567 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi18:
1568 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1569 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi18)(a0)
1570 ; RV32I-MEDIUM-NEXT: lui a1, 2
1571 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
1572 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
1573 ; RV32I-MEDIUM-NEXT: #APP
1574 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
1575 ; RV32I-MEDIUM-NEXT: #NO_APP
1576 ; RV32I-MEDIUM-NEXT: ret
1578 ; RV64I-MEDIUM-LABEL: constraint_o_with_extern_weak_global_3:
1579 ; RV64I-MEDIUM: # %bb.0:
1580 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi18:
1581 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
1582 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi18)(a0)
1583 ; RV64I-MEDIUM-NEXT: lui a1, 2
1584 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
1585 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
1586 ; RV64I-MEDIUM-NEXT: #APP
1587 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
1588 ; RV64I-MEDIUM-NEXT: #NO_APP
1589 ; RV64I-MEDIUM-NEXT: ret
1591 ; RV64I-LARGE-LABEL: constraint_o_with_extern_weak_global_3:
1592 ; RV64I-LARGE: # %bb.0:
1593 ; RV64I-LARGE-NEXT: .Lpcrel_hi18:
1594 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI24_0)
1595 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi18)(a0)
1596 ; RV64I-LARGE-NEXT: lui a1, 2
1597 ; RV64I-LARGE-NEXT: addiw a1, a1, -192
1598 ; RV64I-LARGE-NEXT: add a0, a0, a1
1599 ; RV64I-LARGE-NEXT: #APP
1600 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
1601 ; RV64I-LARGE-NEXT: #NO_APP
1602 ; RV64I-LARGE-NEXT: ret
1603 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
1607 define void @constraint_o_with_multi_asm() nounwind {
1608 ; RV32I-LABEL: constraint_o_with_multi_asm:
1610 ; RV32I-NEXT: lui a0, %hi(eg)
1612 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
1613 ; RV32I-NEXT: #NO_APP
1615 ; RV32I-NEXT: sw zero, %lo(eg)(a0)
1616 ; RV32I-NEXT: #NO_APP
1619 ; RV64I-LABEL: constraint_o_with_multi_asm:
1621 ; RV64I-NEXT: lui a0, %hi(eg)
1623 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
1624 ; RV64I-NEXT: #NO_APP
1626 ; RV64I-NEXT: sw zero, %lo(eg)(a0)
1627 ; RV64I-NEXT: #NO_APP
1630 ; RV32I-MEDIUM-LABEL: constraint_o_with_multi_asm:
1631 ; RV32I-MEDIUM: # %bb.0:
1632 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi19:
1633 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1634 ; RV32I-MEDIUM-NEXT: #APP
1635 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi19)(a0)
1636 ; RV32I-MEDIUM-NEXT: #NO_APP
1637 ; RV32I-MEDIUM-NEXT: #APP
1638 ; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi19)(a0)
1639 ; RV32I-MEDIUM-NEXT: #NO_APP
1640 ; RV32I-MEDIUM-NEXT: ret
1642 ; RV64I-MEDIUM-LABEL: constraint_o_with_multi_asm:
1643 ; RV64I-MEDIUM: # %bb.0:
1644 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi19:
1645 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
1646 ; RV64I-MEDIUM-NEXT: #APP
1647 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi19)(a0)
1648 ; RV64I-MEDIUM-NEXT: #NO_APP
1649 ; RV64I-MEDIUM-NEXT: #APP
1650 ; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi19)(a0)
1651 ; RV64I-MEDIUM-NEXT: #NO_APP
1652 ; RV64I-MEDIUM-NEXT: ret
1654 ; RV64I-LARGE-LABEL: constraint_o_with_multi_asm:
1655 ; RV64I-LARGE: # %bb.0:
1656 ; RV64I-LARGE-NEXT: .Lpcrel_hi19:
1657 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI25_0)
1658 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi19)(a0)
1659 ; RV64I-LARGE-NEXT: #APP
1660 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
1661 ; RV64I-LARGE-NEXT: #NO_APP
1662 ; RV64I-LARGE-NEXT: #APP
1663 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
1664 ; RV64I-LARGE-NEXT: #NO_APP
1665 ; RV64I-LARGE-NEXT: ret
1666 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
1667 call void asm "sw zero, $0", "=*o"(ptr elementtype(i32) @eg)
1671 define i32 @constraint_o_with_callbr_multi_operands(i32 %a) {
1672 ; RV32I-NO-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1673 ; RV32I-NO-INTEGRATED: # %bb.0: # %entry
1674 ; RV32I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
1675 ; RV32I-NO-INTEGRATED-NEXT: #APP
1676 ; RV32I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB26_2
1677 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
1678 ; RV32I-NO-INTEGRATED-NEXT: # %bb.1: # %normal
1679 ; RV32I-NO-INTEGRATED-NEXT: li a0, 0
1680 ; RV32I-NO-INTEGRATED-NEXT: ret
1681 ; RV32I-NO-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1682 ; RV32I-NO-INTEGRATED-NEXT: # %fail
1683 ; RV32I-NO-INTEGRATED-NEXT: # Label of block must be emitted
1684 ; RV32I-NO-INTEGRATED-NEXT: li a0, 1
1685 ; RV32I-NO-INTEGRATED-NEXT: ret
1687 ; RV64I-NO-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1688 ; RV64I-NO-INTEGRATED: # %bb.0: # %entry
1689 ; RV64I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
1690 ; RV64I-NO-INTEGRATED-NEXT: #APP
1691 ; RV64I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); sw zero, %lo(eg)(a1); beqz a0, .LBB26_2
1692 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
1693 ; RV64I-NO-INTEGRATED-NEXT: # %bb.1: # %normal
1694 ; RV64I-NO-INTEGRATED-NEXT: li a0, 0
1695 ; RV64I-NO-INTEGRATED-NEXT: ret
1696 ; RV64I-NO-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1697 ; RV64I-NO-INTEGRATED-NEXT: # %fail
1698 ; RV64I-NO-INTEGRATED-NEXT: # Label of block must be emitted
1699 ; RV64I-NO-INTEGRATED-NEXT: li a0, 1
1700 ; RV64I-NO-INTEGRATED-NEXT: ret
1702 ; RV32I-MEDIUM-NO-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1703 ; RV32I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
1704 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi20:
1705 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1706 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1707 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a1); sw zero, %pcrel_lo(.Lpcrel_hi20)(a1); beqz a0, .LBB26_2
1708 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1709 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal
1710 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
1711 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
1712 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1713 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
1714 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
1715 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
1716 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
1718 ; RV64I-MEDIUM-NO-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1719 ; RV64I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
1720 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi20:
1721 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1722 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1723 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a1); sw zero, %pcrel_lo(.Lpcrel_hi20)(a1); beqz a0, .LBB26_2
1724 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1725 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal
1726 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
1727 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
1728 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1729 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
1730 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
1731 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
1732 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
1734 ; RV64I-LARGE-NO-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1735 ; RV64I-LARGE-NO-INTEGRATED: # %bb.0: # %entry
1736 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .Lpcrel_hi20:
1737 ; RV64I-LARGE-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI26_0)
1738 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi20)(a1)
1739 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
1740 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB26_2
1741 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
1742 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.1: # %normal
1743 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 0
1744 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
1745 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1746 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %fail
1747 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # Label of block must be emitted
1748 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 1
1749 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
1751 ; RV32I-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1752 ; RV32I-INTEGRATED: # %bb.0: # %entry
1753 ; RV32I-INTEGRATED-NEXT: lui a1, %hi(eg)
1754 ; RV32I-INTEGRATED-NEXT: #APP
1755 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1756 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1757 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB26_2
1758 ; RV32I-INTEGRATED-NEXT: #NO_APP
1759 ; RV32I-INTEGRATED-NEXT: # %bb.1: # %normal
1760 ; RV32I-INTEGRATED-NEXT: li a0, 0
1761 ; RV32I-INTEGRATED-NEXT: ret
1762 ; RV32I-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1763 ; RV32I-INTEGRATED-NEXT: # %fail
1764 ; RV32I-INTEGRATED-NEXT: # Label of block must be emitted
1765 ; RV32I-INTEGRATED-NEXT: li a0, 1
1766 ; RV32I-INTEGRATED-NEXT: ret
1768 ; RV64I-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1769 ; RV64I-INTEGRATED: # %bb.0: # %entry
1770 ; RV64I-INTEGRATED-NEXT: lui a1, %hi(eg)
1771 ; RV64I-INTEGRATED-NEXT: #APP
1772 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1773 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1774 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB26_2
1775 ; RV64I-INTEGRATED-NEXT: #NO_APP
1776 ; RV64I-INTEGRATED-NEXT: # %bb.1: # %normal
1777 ; RV64I-INTEGRATED-NEXT: li a0, 0
1778 ; RV64I-INTEGRATED-NEXT: ret
1779 ; RV64I-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1780 ; RV64I-INTEGRATED-NEXT: # %fail
1781 ; RV64I-INTEGRATED-NEXT: # Label of block must be emitted
1782 ; RV64I-INTEGRATED-NEXT: li a0, 1
1783 ; RV64I-INTEGRATED-NEXT: ret
1785 ; RV32I-MEDIUM-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1786 ; RV32I-MEDIUM-INTEGRATED: # %bb.0: # %entry
1787 ; RV32I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi20:
1788 ; RV32I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1789 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
1790 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a1)
1791 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a1)
1792 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB26_2
1793 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
1794 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal
1795 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 0
1796 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
1797 ; RV32I-MEDIUM-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1798 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %fail
1799 ; RV32I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
1800 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 1
1801 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
1803 ; RV64I-MEDIUM-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1804 ; RV64I-MEDIUM-INTEGRATED: # %bb.0: # %entry
1805 ; RV64I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi20:
1806 ; RV64I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1807 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
1808 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a1)
1809 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi20)(a1)
1810 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB26_2
1811 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
1812 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal
1813 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 0
1814 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
1815 ; RV64I-MEDIUM-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1816 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %fail
1817 ; RV64I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
1818 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 1
1819 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
1821 ; RV64I-LARGE-INTEGRATED-LABEL: constraint_o_with_callbr_multi_operands:
1822 ; RV64I-LARGE-INTEGRATED: # %bb.0: # %entry
1823 ; RV64I-LARGE-INTEGRATED-NEXT: .Lpcrel_hi20:
1824 ; RV64I-LARGE-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI26_0)
1825 ; RV64I-LARGE-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi20)(a1)
1826 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
1827 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
1828 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
1829 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB26_2
1830 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
1831 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.1: # %normal
1832 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 0
1833 ; RV64I-LARGE-INTEGRATED-NEXT: ret
1834 ; RV64I-LARGE-INTEGRATED-NEXT: .LBB26_2: # Block address taken
1835 ; RV64I-LARGE-INTEGRATED-NEXT: # %fail
1836 ; RV64I-LARGE-INTEGRATED-NEXT: # Label of block must be emitted
1837 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 1
1838 ; RV64I-LARGE-INTEGRATED-NEXT: ret
1840 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]
1849 define i32 @constraint_o_with_multi_callbr_asm(i32 %a) {
1850 ; RV32I-NO-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
1851 ; RV32I-NO-INTEGRATED: # %bb.0: # %entry
1852 ; RV32I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
1853 ; RV32I-NO-INTEGRATED-NEXT: #APP
1854 ; RV32I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB27_3
1855 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
1856 ; RV32I-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
1857 ; RV32I-NO-INTEGRATED-NEXT: #APP
1858 ; RV32I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB27_3
1859 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
1860 ; RV32I-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
1861 ; RV32I-NO-INTEGRATED-NEXT: li a0, 0
1862 ; RV32I-NO-INTEGRATED-NEXT: ret
1863 ; RV32I-NO-INTEGRATED-NEXT: .LBB27_3: # Block address taken
1864 ; RV32I-NO-INTEGRATED-NEXT: # %fail
1865 ; RV32I-NO-INTEGRATED-NEXT: # Label of block must be emitted
1866 ; RV32I-NO-INTEGRATED-NEXT: li a0, 1
1867 ; RV32I-NO-INTEGRATED-NEXT: ret
1869 ; RV64I-NO-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
1870 ; RV64I-NO-INTEGRATED: # %bb.0: # %entry
1871 ; RV64I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
1872 ; RV64I-NO-INTEGRATED-NEXT: #APP
1873 ; RV64I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB27_3
1874 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
1875 ; RV64I-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
1876 ; RV64I-NO-INTEGRATED-NEXT: #APP
1877 ; RV64I-NO-INTEGRATED-NEXT: sw zero, %lo(eg)(a1); beqz a0, .LBB27_3
1878 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
1879 ; RV64I-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
1880 ; RV64I-NO-INTEGRATED-NEXT: li a0, 0
1881 ; RV64I-NO-INTEGRATED-NEXT: ret
1882 ; RV64I-NO-INTEGRATED-NEXT: .LBB27_3: # Block address taken
1883 ; RV64I-NO-INTEGRATED-NEXT: # %fail
1884 ; RV64I-NO-INTEGRATED-NEXT: # Label of block must be emitted
1885 ; RV64I-NO-INTEGRATED-NEXT: li a0, 1
1886 ; RV64I-NO-INTEGRATED-NEXT: ret
1888 ; RV32I-MEDIUM-NO-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
1889 ; RV32I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
1890 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi21:
1891 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1892 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1893 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1); beqz a0, .LBB27_3
1894 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1895 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
1896 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1897 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1); beqz a0, .LBB27_3
1898 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1899 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
1900 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
1901 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
1902 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .LBB27_3: # Block address taken
1903 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
1904 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
1905 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
1906 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
1908 ; RV64I-MEDIUM-NO-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
1909 ; RV64I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
1910 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi21:
1911 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1912 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1913 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1); beqz a0, .LBB27_3
1914 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1915 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
1916 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
1917 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1); beqz a0, .LBB27_3
1918 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
1919 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
1920 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
1921 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
1922 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .LBB27_3: # Block address taken
1923 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
1924 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
1925 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
1926 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
1928 ; RV64I-LARGE-NO-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
1929 ; RV64I-LARGE-NO-INTEGRATED: # %bb.0: # %entry
1930 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .Lpcrel_hi21:
1931 ; RV64I-LARGE-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI27_0)
1932 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi21)(a1)
1933 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
1934 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB27_3
1935 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
1936 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
1937 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
1938 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB27_3
1939 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
1940 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
1941 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 0
1942 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
1943 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .LBB27_3: # Block address taken
1944 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %fail
1945 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # Label of block must be emitted
1946 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 1
1947 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
1949 ; RV32I-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
1950 ; RV32I-INTEGRATED: # %bb.0: # %entry
1951 ; RV32I-INTEGRATED-NEXT: lui a1, %hi(eg)
1952 ; RV32I-INTEGRATED-NEXT: #APP
1953 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1954 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB27_3
1955 ; RV32I-INTEGRATED-NEXT: #NO_APP
1956 ; RV32I-INTEGRATED-NEXT: # %bb.1: # %normal0
1957 ; RV32I-INTEGRATED-NEXT: #APP
1958 ; RV32I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1959 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB27_3
1960 ; RV32I-INTEGRATED-NEXT: #NO_APP
1961 ; RV32I-INTEGRATED-NEXT: # %bb.2: # %normal1
1962 ; RV32I-INTEGRATED-NEXT: li a0, 0
1963 ; RV32I-INTEGRATED-NEXT: ret
1964 ; RV32I-INTEGRATED-NEXT: .LBB27_3: # Block address taken
1965 ; RV32I-INTEGRATED-NEXT: # %fail
1966 ; RV32I-INTEGRATED-NEXT: # Label of block must be emitted
1967 ; RV32I-INTEGRATED-NEXT: li a0, 1
1968 ; RV32I-INTEGRATED-NEXT: ret
1970 ; RV64I-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
1971 ; RV64I-INTEGRATED: # %bb.0: # %entry
1972 ; RV64I-INTEGRATED-NEXT: lui a1, %hi(eg)
1973 ; RV64I-INTEGRATED-NEXT: #APP
1974 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1975 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB27_3
1976 ; RV64I-INTEGRATED-NEXT: #NO_APP
1977 ; RV64I-INTEGRATED-NEXT: # %bb.1: # %normal0
1978 ; RV64I-INTEGRATED-NEXT: #APP
1979 ; RV64I-INTEGRATED-NEXT: sw zero, %lo(eg)(a1)
1980 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB27_3
1981 ; RV64I-INTEGRATED-NEXT: #NO_APP
1982 ; RV64I-INTEGRATED-NEXT: # %bb.2: # %normal1
1983 ; RV64I-INTEGRATED-NEXT: li a0, 0
1984 ; RV64I-INTEGRATED-NEXT: ret
1985 ; RV64I-INTEGRATED-NEXT: .LBB27_3: # Block address taken
1986 ; RV64I-INTEGRATED-NEXT: # %fail
1987 ; RV64I-INTEGRATED-NEXT: # Label of block must be emitted
1988 ; RV64I-INTEGRATED-NEXT: li a0, 1
1989 ; RV64I-INTEGRATED-NEXT: ret
1991 ; RV32I-MEDIUM-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
1992 ; RV32I-MEDIUM-INTEGRATED: # %bb.0: # %entry
1993 ; RV32I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi21:
1994 ; RV32I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
1995 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
1996 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1)
1997 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB27_3
1998 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
1999 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal0
2000 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
2001 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1)
2002 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB27_3
2003 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
2004 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.2: # %normal1
2005 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 0
2006 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
2007 ; RV32I-MEDIUM-INTEGRATED-NEXT: .LBB27_3: # Block address taken
2008 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %fail
2009 ; RV32I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
2010 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 1
2011 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
2013 ; RV64I-MEDIUM-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
2014 ; RV64I-MEDIUM-INTEGRATED: # %bb.0: # %entry
2015 ; RV64I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi21:
2016 ; RV64I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
2017 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
2018 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1)
2019 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB27_3
2020 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
2021 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal0
2022 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
2023 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi21)(a1)
2024 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB27_3
2025 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
2026 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.2: # %normal1
2027 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 0
2028 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
2029 ; RV64I-MEDIUM-INTEGRATED-NEXT: .LBB27_3: # Block address taken
2030 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %fail
2031 ; RV64I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
2032 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 1
2033 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
2035 ; RV64I-LARGE-INTEGRATED-LABEL: constraint_o_with_multi_callbr_asm:
2036 ; RV64I-LARGE-INTEGRATED: # %bb.0: # %entry
2037 ; RV64I-LARGE-INTEGRATED-NEXT: .Lpcrel_hi21:
2038 ; RV64I-LARGE-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI27_0)
2039 ; RV64I-LARGE-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi21)(a1)
2040 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
2041 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
2042 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB27_3
2043 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
2044 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.1: # %normal0
2045 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
2046 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
2047 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB27_3
2048 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
2049 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.2: # %normal1
2050 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 0
2051 ; RV64I-LARGE-INTEGRATED-NEXT: ret
2052 ; RV64I-LARGE-INTEGRATED-NEXT: .LBB27_3: # Block address taken
2053 ; RV64I-LARGE-INTEGRATED-NEXT: # %fail
2054 ; RV64I-LARGE-INTEGRATED-NEXT: # Label of block must be emitted
2055 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 1
2056 ; RV64I-LARGE-INTEGRATED-NEXT: ret
2058 callbr void asm "sw zero, $0; beqz $1, $2", "=*o,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
2061 callbr void asm "sw zero, $0; beqz $1, $2", "=*o,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
2070 define void @constraint_o_with_local_1() nounwind {
2071 ; RV32I-LABEL: constraint_o_with_local_1:
2072 ; RV32I: # %bb.0: # %entry
2073 ; RV32I-NEXT: .Ltmp3: # Block address taken
2074 ; RV32I-NEXT: # %bb.1: # %label
2075 ; RV32I-NEXT: lui a0, %hi(.Ltmp3)
2077 ; RV32I-NEXT: lw zero, %lo(.Ltmp3)(a0)
2078 ; RV32I-NEXT: #NO_APP
2081 ; RV64I-LABEL: constraint_o_with_local_1:
2082 ; RV64I: # %bb.0: # %entry
2083 ; RV64I-NEXT: .Ltmp3: # Block address taken
2084 ; RV64I-NEXT: # %bb.1: # %label
2085 ; RV64I-NEXT: lui a0, %hi(.Ltmp3)
2087 ; RV64I-NEXT: lw zero, %lo(.Ltmp3)(a0)
2088 ; RV64I-NEXT: #NO_APP
2091 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_1:
2092 ; RV32I-MEDIUM: # %bb.0: # %entry
2093 ; RV32I-MEDIUM-NEXT: .Ltmp3: # Block address taken
2094 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2095 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi22:
2096 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp3)
2097 ; RV32I-MEDIUM-NEXT: #APP
2098 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi22)(a0)
2099 ; RV32I-MEDIUM-NEXT: #NO_APP
2100 ; RV32I-MEDIUM-NEXT: ret
2102 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_1:
2103 ; RV64I-MEDIUM: # %bb.0: # %entry
2104 ; RV64I-MEDIUM-NEXT: .Ltmp3: # Block address taken
2105 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2106 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi22:
2107 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp3)
2108 ; RV64I-MEDIUM-NEXT: #APP
2109 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi22)(a0)
2110 ; RV64I-MEDIUM-NEXT: #NO_APP
2111 ; RV64I-MEDIUM-NEXT: ret
2113 ; RV64I-LARGE-LABEL: constraint_o_with_local_1:
2114 ; RV64I-LARGE: # %bb.0: # %entry
2115 ; RV64I-LARGE-NEXT: .Ltmp3: # Block address taken
2116 ; RV64I-LARGE-NEXT: # %bb.1: # %label
2117 ; RV64I-LARGE-NEXT: .Lpcrel_hi22:
2118 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp3)
2119 ; RV64I-LARGE-NEXT: #APP
2120 ; RV64I-LARGE-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi22)(a0)
2121 ; RV64I-LARGE-NEXT: #NO_APP
2122 ; RV64I-LARGE-NEXT: ret
2127 tail call void asm sideeffect "lw zero, $0", "*o"(ptr elementtype(ptr) blockaddress(@constraint_o_with_local_1, %label))
2131 define void @constraint_o_with_local_2() nounwind {
2132 ; RV32I-LABEL: constraint_o_with_local_2:
2133 ; RV32I: # %bb.0: # %entry
2134 ; RV32I-NEXT: .Ltmp4: # Block address taken
2135 ; RV32I-NEXT: # %bb.1: # %label
2136 ; RV32I-NEXT: lui a0, %hi(.Ltmp4+4)
2138 ; RV32I-NEXT: lw zero, %lo(.Ltmp4+4)(a0)
2139 ; RV32I-NEXT: #NO_APP
2142 ; RV64I-LABEL: constraint_o_with_local_2:
2143 ; RV64I: # %bb.0: # %entry
2144 ; RV64I-NEXT: .Ltmp4: # Block address taken
2145 ; RV64I-NEXT: # %bb.1: # %label
2146 ; RV64I-NEXT: lui a0, %hi(.Ltmp4+4)
2148 ; RV64I-NEXT: lw zero, %lo(.Ltmp4+4)(a0)
2149 ; RV64I-NEXT: #NO_APP
2152 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_2:
2153 ; RV32I-MEDIUM: # %bb.0: # %entry
2154 ; RV32I-MEDIUM-NEXT: .Ltmp4: # Block address taken
2155 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2156 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi23:
2157 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp4+4)
2158 ; RV32I-MEDIUM-NEXT: #APP
2159 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi23)(a0)
2160 ; RV32I-MEDIUM-NEXT: #NO_APP
2161 ; RV32I-MEDIUM-NEXT: ret
2163 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_2:
2164 ; RV64I-MEDIUM: # %bb.0: # %entry
2165 ; RV64I-MEDIUM-NEXT: .Ltmp4: # Block address taken
2166 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2167 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi23:
2168 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp4+4)
2169 ; RV64I-MEDIUM-NEXT: #APP
2170 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi23)(a0)
2171 ; RV64I-MEDIUM-NEXT: #NO_APP
2172 ; RV64I-MEDIUM-NEXT: ret
2174 ; RV64I-LARGE-LABEL: constraint_o_with_local_2:
2175 ; RV64I-LARGE: # %bb.0: # %entry
2176 ; RV64I-LARGE-NEXT: .Ltmp4: # Block address taken
2177 ; RV64I-LARGE-NEXT: # %bb.1: # %label
2178 ; RV64I-LARGE-NEXT: .Lpcrel_hi23:
2179 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp4+4)
2180 ; RV64I-LARGE-NEXT: #APP
2181 ; RV64I-LARGE-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi23)(a0)
2182 ; RV64I-LARGE-NEXT: #NO_APP
2183 ; RV64I-LARGE-NEXT: ret
2188 call void asm "lw zero, $0", "*o"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_o_with_local_2, %label), i32 4))
2192 define void @constraint_o_with_local_3() nounwind {
2193 ; RV32I-LABEL: constraint_o_with_local_3:
2194 ; RV32I: # %bb.0: # %entry
2195 ; RV32I-NEXT: .Ltmp5: # Block address taken
2196 ; RV32I-NEXT: # %bb.1: # %label
2197 ; RV32I-NEXT: lui a0, %hi(.Ltmp5+2000)
2199 ; RV32I-NEXT: lw zero, %lo(.Ltmp5+2000)(a0)
2200 ; RV32I-NEXT: #NO_APP
2203 ; RV64I-LABEL: constraint_o_with_local_3:
2204 ; RV64I: # %bb.0: # %entry
2205 ; RV64I-NEXT: .Ltmp5: # Block address taken
2206 ; RV64I-NEXT: # %bb.1: # %label
2207 ; RV64I-NEXT: lui a0, %hi(.Ltmp5+2000)
2209 ; RV64I-NEXT: lw zero, %lo(.Ltmp5+2000)(a0)
2210 ; RV64I-NEXT: #NO_APP
2213 ; RV32I-MEDIUM-LABEL: constraint_o_with_local_3:
2214 ; RV32I-MEDIUM: # %bb.0: # %entry
2215 ; RV32I-MEDIUM-NEXT: .Ltmp5: # Block address taken
2216 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
2217 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi24:
2218 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp5+2000)
2219 ; RV32I-MEDIUM-NEXT: #APP
2220 ; RV32I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi24)(a0)
2221 ; RV32I-MEDIUM-NEXT: #NO_APP
2222 ; RV32I-MEDIUM-NEXT: ret
2224 ; RV64I-MEDIUM-LABEL: constraint_o_with_local_3:
2225 ; RV64I-MEDIUM: # %bb.0: # %entry
2226 ; RV64I-MEDIUM-NEXT: .Ltmp5: # Block address taken
2227 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
2228 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi24:
2229 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp5+2000)
2230 ; RV64I-MEDIUM-NEXT: #APP
2231 ; RV64I-MEDIUM-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi24)(a0)
2232 ; RV64I-MEDIUM-NEXT: #NO_APP
2233 ; RV64I-MEDIUM-NEXT: ret
2235 ; RV64I-LARGE-LABEL: constraint_o_with_local_3:
2236 ; RV64I-LARGE: # %bb.0: # %entry
2237 ; RV64I-LARGE-NEXT: .Ltmp5: # Block address taken
2238 ; RV64I-LARGE-NEXT: # %bb.1: # %label
2239 ; RV64I-LARGE-NEXT: .Lpcrel_hi24:
2240 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp5+2000)
2241 ; RV64I-LARGE-NEXT: #APP
2242 ; RV64I-LARGE-NEXT: lw zero, %pcrel_lo(.Lpcrel_hi24)(a0)
2243 ; RV64I-LARGE-NEXT: #NO_APP
2244 ; RV64I-LARGE-NEXT: ret
2249 call void asm "lw zero, $0", "*o"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_o_with_local_3, %label), i32 2000))
2253 define void @constraint_A(ptr %a) nounwind {
2254 ; RV32I-LABEL: constraint_A:
2257 ; RV32I-NEXT: sb s0, 0(a0)
2258 ; RV32I-NEXT: #NO_APP
2260 ; RV32I-NEXT: lb s1, 0(a0)
2261 ; RV32I-NEXT: #NO_APP
2264 ; RV64I-LABEL: constraint_A:
2267 ; RV64I-NEXT: sb s0, 0(a0)
2268 ; RV64I-NEXT: #NO_APP
2270 ; RV64I-NEXT: lb s1, 0(a0)
2271 ; RV64I-NEXT: #NO_APP
2274 ; RV32I-MEDIUM-LABEL: constraint_A:
2275 ; RV32I-MEDIUM: # %bb.0:
2276 ; RV32I-MEDIUM-NEXT: #APP
2277 ; RV32I-MEDIUM-NEXT: sb s0, 0(a0)
2278 ; RV32I-MEDIUM-NEXT: #NO_APP
2279 ; RV32I-MEDIUM-NEXT: #APP
2280 ; RV32I-MEDIUM-NEXT: lb s1, 0(a0)
2281 ; RV32I-MEDIUM-NEXT: #NO_APP
2282 ; RV32I-MEDIUM-NEXT: ret
2284 ; RV64I-MEDIUM-LABEL: constraint_A:
2285 ; RV64I-MEDIUM: # %bb.0:
2286 ; RV64I-MEDIUM-NEXT: #APP
2287 ; RV64I-MEDIUM-NEXT: sb s0, 0(a0)
2288 ; RV64I-MEDIUM-NEXT: #NO_APP
2289 ; RV64I-MEDIUM-NEXT: #APP
2290 ; RV64I-MEDIUM-NEXT: lb s1, 0(a0)
2291 ; RV64I-MEDIUM-NEXT: #NO_APP
2292 ; RV64I-MEDIUM-NEXT: ret
2294 ; RV64I-LARGE-LABEL: constraint_A:
2295 ; RV64I-LARGE: # %bb.0:
2296 ; RV64I-LARGE-NEXT: #APP
2297 ; RV64I-LARGE-NEXT: sb s0, 0(a0)
2298 ; RV64I-LARGE-NEXT: #NO_APP
2299 ; RV64I-LARGE-NEXT: #APP
2300 ; RV64I-LARGE-NEXT: lb s1, 0(a0)
2301 ; RV64I-LARGE-NEXT: #NO_APP
2302 ; RV64I-LARGE-NEXT: ret
2303 tail call void asm sideeffect "sb s0, $0", "*A"(ptr elementtype(i8) %a)
2304 tail call void asm sideeffect "lb s1, $0", "*A"(ptr elementtype(i8) %a)
2308 define i32 @constraint_A_with_offset(ptr %a) nounwind {
2309 ; RV32I-LABEL: constraint_A_with_offset:
2311 ; RV32I-NEXT: addi a0, a0, 4
2313 ; RV32I-NEXT: lw a0, 0(a0)
2314 ; RV32I-NEXT: #NO_APP
2317 ; RV64I-LABEL: constraint_A_with_offset:
2319 ; RV64I-NEXT: addi a0, a0, 4
2321 ; RV64I-NEXT: lw a0, 0(a0)
2322 ; RV64I-NEXT: #NO_APP
2325 ; RV32I-MEDIUM-LABEL: constraint_A_with_offset:
2326 ; RV32I-MEDIUM: # %bb.0:
2327 ; RV32I-MEDIUM-NEXT: addi a0, a0, 4
2328 ; RV32I-MEDIUM-NEXT: #APP
2329 ; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
2330 ; RV32I-MEDIUM-NEXT: #NO_APP
2331 ; RV32I-MEDIUM-NEXT: ret
2333 ; RV64I-MEDIUM-LABEL: constraint_A_with_offset:
2334 ; RV64I-MEDIUM: # %bb.0:
2335 ; RV64I-MEDIUM-NEXT: addi a0, a0, 4
2336 ; RV64I-MEDIUM-NEXT: #APP
2337 ; RV64I-MEDIUM-NEXT: lw a0, 0(a0)
2338 ; RV64I-MEDIUM-NEXT: #NO_APP
2339 ; RV64I-MEDIUM-NEXT: ret
2341 ; RV64I-LARGE-LABEL: constraint_A_with_offset:
2342 ; RV64I-LARGE: # %bb.0:
2343 ; RV64I-LARGE-NEXT: addi a0, a0, 4
2344 ; RV64I-LARGE-NEXT: #APP
2345 ; RV64I-LARGE-NEXT: lw a0, 0(a0)
2346 ; RV64I-LARGE-NEXT: #NO_APP
2347 ; RV64I-LARGE-NEXT: ret
2348 %1 = getelementptr i32, ptr %a, i32 1
2349 %2 = tail call i32 asm "lw $0, $1", "=r,*A"(ptr elementtype(i32) %1)
2353 define void @constraint_A_with_global_1() nounwind {
2354 ; RV32I-LABEL: constraint_A_with_global_1:
2356 ; RV32I-NEXT: lui a0, %hi(eg)
2357 ; RV32I-NEXT: addi a0, a0, %lo(eg)
2359 ; RV32I-NEXT: sw zero, 0(a0)
2360 ; RV32I-NEXT: #NO_APP
2363 ; RV64I-LABEL: constraint_A_with_global_1:
2365 ; RV64I-NEXT: lui a0, %hi(eg)
2366 ; RV64I-NEXT: addi a0, a0, %lo(eg)
2368 ; RV64I-NEXT: sw zero, 0(a0)
2369 ; RV64I-NEXT: #NO_APP
2372 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_1:
2373 ; RV32I-MEDIUM: # %bb.0:
2374 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi25:
2375 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
2376 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi25)
2377 ; RV32I-MEDIUM-NEXT: #APP
2378 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
2379 ; RV32I-MEDIUM-NEXT: #NO_APP
2380 ; RV32I-MEDIUM-NEXT: ret
2382 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_1:
2383 ; RV64I-MEDIUM: # %bb.0:
2384 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi25:
2385 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
2386 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi25)
2387 ; RV64I-MEDIUM-NEXT: #APP
2388 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
2389 ; RV64I-MEDIUM-NEXT: #NO_APP
2390 ; RV64I-MEDIUM-NEXT: ret
2392 ; RV64I-LARGE-LABEL: constraint_A_with_global_1:
2393 ; RV64I-LARGE: # %bb.0:
2394 ; RV64I-LARGE-NEXT: .Lpcrel_hi25:
2395 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI33_0)
2396 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi25)(a0)
2397 ; RV64I-LARGE-NEXT: #APP
2398 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
2399 ; RV64I-LARGE-NEXT: #NO_APP
2400 ; RV64I-LARGE-NEXT: ret
2401 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
2405 define void @constraint_A_with_global_2() nounwind {
2406 ; RV32I-LABEL: constraint_A_with_global_2:
2408 ; RV32I-NEXT: lui a0, %hi(eg+4)
2409 ; RV32I-NEXT: addi a0, a0, %lo(eg+4)
2411 ; RV32I-NEXT: sw zero, 0(a0)
2412 ; RV32I-NEXT: #NO_APP
2415 ; RV64I-LABEL: constraint_A_with_global_2:
2417 ; RV64I-NEXT: lui a0, %hi(eg+4)
2418 ; RV64I-NEXT: addi a0, a0, %lo(eg+4)
2420 ; RV64I-NEXT: sw zero, 0(a0)
2421 ; RV64I-NEXT: #NO_APP
2424 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_2:
2425 ; RV32I-MEDIUM: # %bb.0:
2426 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi26:
2427 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
2428 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi26)
2429 ; RV32I-MEDIUM-NEXT: #APP
2430 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
2431 ; RV32I-MEDIUM-NEXT: #NO_APP
2432 ; RV32I-MEDIUM-NEXT: ret
2434 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_2:
2435 ; RV64I-MEDIUM: # %bb.0:
2436 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi26:
2437 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+4)
2438 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi26)
2439 ; RV64I-MEDIUM-NEXT: #APP
2440 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
2441 ; RV64I-MEDIUM-NEXT: #NO_APP
2442 ; RV64I-MEDIUM-NEXT: ret
2444 ; RV64I-LARGE-LABEL: constraint_A_with_global_2:
2445 ; RV64I-LARGE: # %bb.0:
2446 ; RV64I-LARGE-NEXT: .Lpcrel_hi26:
2447 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI34_0)
2448 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi26)(a0)
2449 ; RV64I-LARGE-NEXT: addi a0, a0, 4
2450 ; RV64I-LARGE-NEXT: #APP
2451 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
2452 ; RV64I-LARGE-NEXT: #NO_APP
2453 ; RV64I-LARGE-NEXT: ret
2454 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 1))
2458 define void @constraint_A_with_global_3() nounwind {
2459 ; RV32I-LABEL: constraint_A_with_global_3:
2461 ; RV32I-NEXT: lui a0, %hi(eg+8000)
2462 ; RV32I-NEXT: addi a0, a0, %lo(eg+8000)
2464 ; RV32I-NEXT: sw zero, 0(a0)
2465 ; RV32I-NEXT: #NO_APP
2468 ; RV64I-LABEL: constraint_A_with_global_3:
2470 ; RV64I-NEXT: lui a0, %hi(eg+8000)
2471 ; RV64I-NEXT: addi a0, a0, %lo(eg+8000)
2473 ; RV64I-NEXT: sw zero, 0(a0)
2474 ; RV64I-NEXT: #NO_APP
2477 ; RV32I-MEDIUM-LABEL: constraint_A_with_global_3:
2478 ; RV32I-MEDIUM: # %bb.0:
2479 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi27:
2480 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
2481 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi27)
2482 ; RV32I-MEDIUM-NEXT: #APP
2483 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
2484 ; RV32I-MEDIUM-NEXT: #NO_APP
2485 ; RV32I-MEDIUM-NEXT: ret
2487 ; RV64I-MEDIUM-LABEL: constraint_A_with_global_3:
2488 ; RV64I-MEDIUM: # %bb.0:
2489 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi27:
2490 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg+8000)
2491 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi27)
2492 ; RV64I-MEDIUM-NEXT: #APP
2493 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
2494 ; RV64I-MEDIUM-NEXT: #NO_APP
2495 ; RV64I-MEDIUM-NEXT: ret
2497 ; RV64I-LARGE-LABEL: constraint_A_with_global_3:
2498 ; RV64I-LARGE: # %bb.0:
2499 ; RV64I-LARGE-NEXT: .Lpcrel_hi27:
2500 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI35_0)
2501 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi27)(a0)
2502 ; RV64I-LARGE-NEXT: lui a1, 2
2503 ; RV64I-LARGE-NEXT: addiw a1, a1, -192
2504 ; RV64I-LARGE-NEXT: add a0, a0, a1
2505 ; RV64I-LARGE-NEXT: #APP
2506 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
2507 ; RV64I-LARGE-NEXT: #NO_APP
2508 ; RV64I-LARGE-NEXT: ret
2509 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @eg, i32 0, i32 2000))
2513 define void @constraint_A_with_extern_weak_global_1() nounwind {
2514 ; RV32I-LABEL: constraint_A_with_extern_weak_global_1:
2516 ; RV32I-NEXT: lui a0, %hi(ewg)
2517 ; RV32I-NEXT: addi a0, a0, %lo(ewg)
2519 ; RV32I-NEXT: sw zero, 0(a0)
2520 ; RV32I-NEXT: #NO_APP
2523 ; RV64I-LABEL: constraint_A_with_extern_weak_global_1:
2525 ; RV64I-NEXT: lui a0, %hi(ewg)
2526 ; RV64I-NEXT: addi a0, a0, %lo(ewg)
2528 ; RV64I-NEXT: sw zero, 0(a0)
2529 ; RV64I-NEXT: #NO_APP
2532 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_1:
2533 ; RV32I-MEDIUM: # %bb.0:
2534 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi28:
2535 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
2536 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi28)(a0)
2537 ; RV32I-MEDIUM-NEXT: #APP
2538 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
2539 ; RV32I-MEDIUM-NEXT: #NO_APP
2540 ; RV32I-MEDIUM-NEXT: ret
2542 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_1:
2543 ; RV64I-MEDIUM: # %bb.0:
2544 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi28:
2545 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
2546 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi28)(a0)
2547 ; RV64I-MEDIUM-NEXT: #APP
2548 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
2549 ; RV64I-MEDIUM-NEXT: #NO_APP
2550 ; RV64I-MEDIUM-NEXT: ret
2552 ; RV64I-LARGE-LABEL: constraint_A_with_extern_weak_global_1:
2553 ; RV64I-LARGE: # %bb.0:
2554 ; RV64I-LARGE-NEXT: .Lpcrel_hi28:
2555 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI36_0)
2556 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi28)(a0)
2557 ; RV64I-LARGE-NEXT: #APP
2558 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
2559 ; RV64I-LARGE-NEXT: #NO_APP
2560 ; RV64I-LARGE-NEXT: ret
2561 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @ewg)
2565 define void @constraint_A_with_extern_weak_global_2() nounwind {
2566 ; RV32I-LABEL: constraint_A_with_extern_weak_global_2:
2568 ; RV32I-NEXT: lui a0, %hi(ewg+4)
2569 ; RV32I-NEXT: addi a0, a0, %lo(ewg+4)
2571 ; RV32I-NEXT: sw zero, 0(a0)
2572 ; RV32I-NEXT: #NO_APP
2575 ; RV64I-LABEL: constraint_A_with_extern_weak_global_2:
2577 ; RV64I-NEXT: lui a0, %hi(ewg+4)
2578 ; RV64I-NEXT: addi a0, a0, %lo(ewg+4)
2580 ; RV64I-NEXT: sw zero, 0(a0)
2581 ; RV64I-NEXT: #NO_APP
2584 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_2:
2585 ; RV32I-MEDIUM: # %bb.0:
2586 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi29:
2587 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
2588 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi29)(a0)
2589 ; RV32I-MEDIUM-NEXT: addi a0, a0, 4
2590 ; RV32I-MEDIUM-NEXT: #APP
2591 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
2592 ; RV32I-MEDIUM-NEXT: #NO_APP
2593 ; RV32I-MEDIUM-NEXT: ret
2595 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_2:
2596 ; RV64I-MEDIUM: # %bb.0:
2597 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi29:
2598 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
2599 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi29)(a0)
2600 ; RV64I-MEDIUM-NEXT: addi a0, a0, 4
2601 ; RV64I-MEDIUM-NEXT: #APP
2602 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
2603 ; RV64I-MEDIUM-NEXT: #NO_APP
2604 ; RV64I-MEDIUM-NEXT: ret
2606 ; RV64I-LARGE-LABEL: constraint_A_with_extern_weak_global_2:
2607 ; RV64I-LARGE: # %bb.0:
2608 ; RV64I-LARGE-NEXT: .Lpcrel_hi29:
2609 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI37_0)
2610 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi29)(a0)
2611 ; RV64I-LARGE-NEXT: addi a0, a0, 4
2612 ; RV64I-LARGE-NEXT: #APP
2613 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
2614 ; RV64I-LARGE-NEXT: #NO_APP
2615 ; RV64I-LARGE-NEXT: ret
2616 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 1))
2620 define void @constraint_A_with_extern_weak_global_3() nounwind {
2621 ; RV32I-LABEL: constraint_A_with_extern_weak_global_3:
2623 ; RV32I-NEXT: lui a0, %hi(ewg+8000)
2624 ; RV32I-NEXT: addi a0, a0, %lo(ewg+8000)
2626 ; RV32I-NEXT: sw zero, 0(a0)
2627 ; RV32I-NEXT: #NO_APP
2630 ; RV64I-LABEL: constraint_A_with_extern_weak_global_3:
2632 ; RV64I-NEXT: lui a0, %hi(ewg+8000)
2633 ; RV64I-NEXT: addi a0, a0, %lo(ewg+8000)
2635 ; RV64I-NEXT: sw zero, 0(a0)
2636 ; RV64I-NEXT: #NO_APP
2639 ; RV32I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_3:
2640 ; RV32I-MEDIUM: # %bb.0:
2641 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi30:
2642 ; RV32I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
2643 ; RV32I-MEDIUM-NEXT: lw a0, %pcrel_lo(.Lpcrel_hi30)(a0)
2644 ; RV32I-MEDIUM-NEXT: lui a1, 2
2645 ; RV32I-MEDIUM-NEXT: addi a1, a1, -192
2646 ; RV32I-MEDIUM-NEXT: add a0, a0, a1
2647 ; RV32I-MEDIUM-NEXT: #APP
2648 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
2649 ; RV32I-MEDIUM-NEXT: #NO_APP
2650 ; RV32I-MEDIUM-NEXT: ret
2652 ; RV64I-MEDIUM-LABEL: constraint_A_with_extern_weak_global_3:
2653 ; RV64I-MEDIUM: # %bb.0:
2654 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi30:
2655 ; RV64I-MEDIUM-NEXT: auipc a0, %got_pcrel_hi(ewg)
2656 ; RV64I-MEDIUM-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi30)(a0)
2657 ; RV64I-MEDIUM-NEXT: lui a1, 2
2658 ; RV64I-MEDIUM-NEXT: addiw a1, a1, -192
2659 ; RV64I-MEDIUM-NEXT: add a0, a0, a1
2660 ; RV64I-MEDIUM-NEXT: #APP
2661 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
2662 ; RV64I-MEDIUM-NEXT: #NO_APP
2663 ; RV64I-MEDIUM-NEXT: ret
2665 ; RV64I-LARGE-LABEL: constraint_A_with_extern_weak_global_3:
2666 ; RV64I-LARGE: # %bb.0:
2667 ; RV64I-LARGE-NEXT: .Lpcrel_hi30:
2668 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI38_0)
2669 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi30)(a0)
2670 ; RV64I-LARGE-NEXT: lui a1, 2
2671 ; RV64I-LARGE-NEXT: addiw a1, a1, -192
2672 ; RV64I-LARGE-NEXT: add a0, a0, a1
2673 ; RV64I-LARGE-NEXT: #APP
2674 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
2675 ; RV64I-LARGE-NEXT: #NO_APP
2676 ; RV64I-LARGE-NEXT: ret
2677 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) getelementptr ([400000 x i32], ptr @ewg, i32 0, i32 2000))
2681 define void @constraint_A_with_multi_asm() nounwind {
2682 ; RV32I-LABEL: constraint_A_with_multi_asm:
2684 ; RV32I-NEXT: lui a0, %hi(eg)
2685 ; RV32I-NEXT: addi a0, a0, %lo(eg)
2687 ; RV32I-NEXT: sw zero, 0(a0)
2688 ; RV32I-NEXT: #NO_APP
2690 ; RV32I-NEXT: sw zero, 0(a0)
2691 ; RV32I-NEXT: #NO_APP
2694 ; RV64I-LABEL: constraint_A_with_multi_asm:
2696 ; RV64I-NEXT: lui a0, %hi(eg)
2697 ; RV64I-NEXT: addi a0, a0, %lo(eg)
2699 ; RV64I-NEXT: sw zero, 0(a0)
2700 ; RV64I-NEXT: #NO_APP
2702 ; RV64I-NEXT: sw zero, 0(a0)
2703 ; RV64I-NEXT: #NO_APP
2706 ; RV32I-MEDIUM-LABEL: constraint_A_with_multi_asm:
2707 ; RV32I-MEDIUM: # %bb.0:
2708 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi31:
2709 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
2710 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi31)
2711 ; RV32I-MEDIUM-NEXT: #APP
2712 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
2713 ; RV32I-MEDIUM-NEXT: #NO_APP
2714 ; RV32I-MEDIUM-NEXT: #APP
2715 ; RV32I-MEDIUM-NEXT: sw zero, 0(a0)
2716 ; RV32I-MEDIUM-NEXT: #NO_APP
2717 ; RV32I-MEDIUM-NEXT: ret
2719 ; RV64I-MEDIUM-LABEL: constraint_A_with_multi_asm:
2720 ; RV64I-MEDIUM: # %bb.0:
2721 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi31:
2722 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
2723 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi31)
2724 ; RV64I-MEDIUM-NEXT: #APP
2725 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
2726 ; RV64I-MEDIUM-NEXT: #NO_APP
2727 ; RV64I-MEDIUM-NEXT: #APP
2728 ; RV64I-MEDIUM-NEXT: sw zero, 0(a0)
2729 ; RV64I-MEDIUM-NEXT: #NO_APP
2730 ; RV64I-MEDIUM-NEXT: ret
2732 ; RV64I-LARGE-LABEL: constraint_A_with_multi_asm:
2733 ; RV64I-LARGE: # %bb.0:
2734 ; RV64I-LARGE-NEXT: .Lpcrel_hi31:
2735 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI39_0)
2736 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi31)(a0)
2737 ; RV64I-LARGE-NEXT: #APP
2738 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
2739 ; RV64I-LARGE-NEXT: #NO_APP
2740 ; RV64I-LARGE-NEXT: #APP
2741 ; RV64I-LARGE-NEXT: sw zero, 0(a0)
2742 ; RV64I-LARGE-NEXT: #NO_APP
2743 ; RV64I-LARGE-NEXT: ret
2744 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
2745 call void asm "sw zero, $0", "=*A"(ptr elementtype(i32) @eg)
2749 define i32 @constraint_A_with_callbr_multi_operands(i32 %a) {
2750 ; RV32I-NO-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2751 ; RV32I-NO-INTEGRATED: # %bb.0: # %entry
2752 ; RV32I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
2753 ; RV32I-NO-INTEGRATED-NEXT: addi a1, a1, %lo(eg)
2754 ; RV32I-NO-INTEGRATED-NEXT: #APP
2755 ; RV32I-NO-INTEGRATED-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB40_2
2756 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
2757 ; RV32I-NO-INTEGRATED-NEXT: # %bb.1: # %normal
2758 ; RV32I-NO-INTEGRATED-NEXT: li a0, 0
2759 ; RV32I-NO-INTEGRATED-NEXT: ret
2760 ; RV32I-NO-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2761 ; RV32I-NO-INTEGRATED-NEXT: # %fail
2762 ; RV32I-NO-INTEGRATED-NEXT: # Label of block must be emitted
2763 ; RV32I-NO-INTEGRATED-NEXT: li a0, 1
2764 ; RV32I-NO-INTEGRATED-NEXT: ret
2766 ; RV64I-NO-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2767 ; RV64I-NO-INTEGRATED: # %bb.0: # %entry
2768 ; RV64I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
2769 ; RV64I-NO-INTEGRATED-NEXT: addi a1, a1, %lo(eg)
2770 ; RV64I-NO-INTEGRATED-NEXT: #APP
2771 ; RV64I-NO-INTEGRATED-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB40_2
2772 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
2773 ; RV64I-NO-INTEGRATED-NEXT: # %bb.1: # %normal
2774 ; RV64I-NO-INTEGRATED-NEXT: li a0, 0
2775 ; RV64I-NO-INTEGRATED-NEXT: ret
2776 ; RV64I-NO-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2777 ; RV64I-NO-INTEGRATED-NEXT: # %fail
2778 ; RV64I-NO-INTEGRATED-NEXT: # Label of block must be emitted
2779 ; RV64I-NO-INTEGRATED-NEXT: li a0, 1
2780 ; RV64I-NO-INTEGRATED-NEXT: ret
2782 ; RV32I-MEDIUM-NO-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2783 ; RV32I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
2784 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi32:
2785 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
2786 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi32)
2787 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
2788 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB40_2
2789 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
2790 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal
2791 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
2792 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
2793 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2794 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
2795 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
2796 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
2797 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
2799 ; RV64I-MEDIUM-NO-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2800 ; RV64I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
2801 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi32:
2802 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
2803 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi32)
2804 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
2805 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB40_2
2806 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
2807 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal
2808 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
2809 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
2810 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2811 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
2812 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
2813 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
2814 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
2816 ; RV64I-LARGE-NO-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2817 ; RV64I-LARGE-NO-INTEGRATED: # %bb.0: # %entry
2818 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .Lpcrel_hi32:
2819 ; RV64I-LARGE-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI40_0)
2820 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi32)(a1)
2821 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
2822 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); sw zero, 0(a1); beqz a0, .LBB40_2
2823 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
2824 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.1: # %normal
2825 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 0
2826 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
2827 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2828 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %fail
2829 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # Label of block must be emitted
2830 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 1
2831 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
2833 ; RV32I-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2834 ; RV32I-INTEGRATED: # %bb.0: # %entry
2835 ; RV32I-INTEGRATED-NEXT: lui a1, %hi(eg)
2836 ; RV32I-INTEGRATED-NEXT: addi a1, a1, %lo(eg)
2837 ; RV32I-INTEGRATED-NEXT: #APP
2838 ; RV32I-INTEGRATED-NEXT: sw zero, 0(a1)
2839 ; RV32I-INTEGRATED-NEXT: sw zero, 0(a1)
2840 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB40_2
2841 ; RV32I-INTEGRATED-NEXT: #NO_APP
2842 ; RV32I-INTEGRATED-NEXT: # %bb.1: # %normal
2843 ; RV32I-INTEGRATED-NEXT: li a0, 0
2844 ; RV32I-INTEGRATED-NEXT: ret
2845 ; RV32I-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2846 ; RV32I-INTEGRATED-NEXT: # %fail
2847 ; RV32I-INTEGRATED-NEXT: # Label of block must be emitted
2848 ; RV32I-INTEGRATED-NEXT: li a0, 1
2849 ; RV32I-INTEGRATED-NEXT: ret
2851 ; RV64I-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2852 ; RV64I-INTEGRATED: # %bb.0: # %entry
2853 ; RV64I-INTEGRATED-NEXT: lui a1, %hi(eg)
2854 ; RV64I-INTEGRATED-NEXT: addi a1, a1, %lo(eg)
2855 ; RV64I-INTEGRATED-NEXT: #APP
2856 ; RV64I-INTEGRATED-NEXT: sw zero, 0(a1)
2857 ; RV64I-INTEGRATED-NEXT: sw zero, 0(a1)
2858 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB40_2
2859 ; RV64I-INTEGRATED-NEXT: #NO_APP
2860 ; RV64I-INTEGRATED-NEXT: # %bb.1: # %normal
2861 ; RV64I-INTEGRATED-NEXT: li a0, 0
2862 ; RV64I-INTEGRATED-NEXT: ret
2863 ; RV64I-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2864 ; RV64I-INTEGRATED-NEXT: # %fail
2865 ; RV64I-INTEGRATED-NEXT: # Label of block must be emitted
2866 ; RV64I-INTEGRATED-NEXT: li a0, 1
2867 ; RV64I-INTEGRATED-NEXT: ret
2869 ; RV32I-MEDIUM-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2870 ; RV32I-MEDIUM-INTEGRATED: # %bb.0: # %entry
2871 ; RV32I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi32:
2872 ; RV32I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
2873 ; RV32I-MEDIUM-INTEGRATED-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi32)
2874 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
2875 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, 0(a1)
2876 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, 0(a1)
2877 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB40_2
2878 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
2879 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal
2880 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 0
2881 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
2882 ; RV32I-MEDIUM-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2883 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %fail
2884 ; RV32I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
2885 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 1
2886 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
2888 ; RV64I-MEDIUM-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2889 ; RV64I-MEDIUM-INTEGRATED: # %bb.0: # %entry
2890 ; RV64I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi32:
2891 ; RV64I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
2892 ; RV64I-MEDIUM-INTEGRATED-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi32)
2893 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
2894 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, 0(a1)
2895 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, 0(a1)
2896 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB40_2
2897 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
2898 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal
2899 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 0
2900 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
2901 ; RV64I-MEDIUM-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2902 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %fail
2903 ; RV64I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
2904 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 1
2905 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
2907 ; RV64I-LARGE-INTEGRATED-LABEL: constraint_A_with_callbr_multi_operands:
2908 ; RV64I-LARGE-INTEGRATED: # %bb.0: # %entry
2909 ; RV64I-LARGE-INTEGRATED-NEXT: .Lpcrel_hi32:
2910 ; RV64I-LARGE-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI40_0)
2911 ; RV64I-LARGE-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi32)(a1)
2912 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
2913 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
2914 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
2915 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB40_2
2916 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
2917 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.1: # %normal
2918 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 0
2919 ; RV64I-LARGE-INTEGRATED-NEXT: ret
2920 ; RV64I-LARGE-INTEGRATED-NEXT: .LBB40_2: # Block address taken
2921 ; RV64I-LARGE-INTEGRATED-NEXT: # %fail
2922 ; RV64I-LARGE-INTEGRATED-NEXT: # Label of block must be emitted
2923 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 1
2924 ; RV64I-LARGE-INTEGRATED-NEXT: ret
2926 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]
2935 define i32 @constraint_A_with_multi_callbr_asm(i32 %a) {
2936 ; RV32I-NO-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
2937 ; RV32I-NO-INTEGRATED: # %bb.0: # %entry
2938 ; RV32I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
2939 ; RV32I-NO-INTEGRATED-NEXT: addi a1, a1, %lo(eg)
2940 ; RV32I-NO-INTEGRATED-NEXT: #APP
2941 ; RV32I-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
2942 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
2943 ; RV32I-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
2944 ; RV32I-NO-INTEGRATED-NEXT: #APP
2945 ; RV32I-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
2946 ; RV32I-NO-INTEGRATED-NEXT: #NO_APP
2947 ; RV32I-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
2948 ; RV32I-NO-INTEGRATED-NEXT: li a0, 0
2949 ; RV32I-NO-INTEGRATED-NEXT: ret
2950 ; RV32I-NO-INTEGRATED-NEXT: .LBB41_3: # Block address taken
2951 ; RV32I-NO-INTEGRATED-NEXT: # %fail
2952 ; RV32I-NO-INTEGRATED-NEXT: # Label of block must be emitted
2953 ; RV32I-NO-INTEGRATED-NEXT: li a0, 1
2954 ; RV32I-NO-INTEGRATED-NEXT: ret
2956 ; RV64I-NO-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
2957 ; RV64I-NO-INTEGRATED: # %bb.0: # %entry
2958 ; RV64I-NO-INTEGRATED-NEXT: lui a1, %hi(eg)
2959 ; RV64I-NO-INTEGRATED-NEXT: addi a1, a1, %lo(eg)
2960 ; RV64I-NO-INTEGRATED-NEXT: #APP
2961 ; RV64I-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
2962 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
2963 ; RV64I-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
2964 ; RV64I-NO-INTEGRATED-NEXT: #APP
2965 ; RV64I-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
2966 ; RV64I-NO-INTEGRATED-NEXT: #NO_APP
2967 ; RV64I-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
2968 ; RV64I-NO-INTEGRATED-NEXT: li a0, 0
2969 ; RV64I-NO-INTEGRATED-NEXT: ret
2970 ; RV64I-NO-INTEGRATED-NEXT: .LBB41_3: # Block address taken
2971 ; RV64I-NO-INTEGRATED-NEXT: # %fail
2972 ; RV64I-NO-INTEGRATED-NEXT: # Label of block must be emitted
2973 ; RV64I-NO-INTEGRATED-NEXT: li a0, 1
2974 ; RV64I-NO-INTEGRATED-NEXT: ret
2976 ; RV32I-MEDIUM-NO-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
2977 ; RV32I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
2978 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi33:
2979 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
2980 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi33)
2981 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
2982 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
2983 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
2984 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
2985 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #APP
2986 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
2987 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
2988 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
2989 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
2990 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
2991 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: .LBB41_3: # Block address taken
2992 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
2993 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
2994 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
2995 ; RV32I-MEDIUM-NO-INTEGRATED-NEXT: ret
2997 ; RV64I-MEDIUM-NO-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
2998 ; RV64I-MEDIUM-NO-INTEGRATED: # %bb.0: # %entry
2999 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .Lpcrel_hi33:
3000 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
3001 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi33)
3002 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
3003 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
3004 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
3005 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
3006 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #APP
3007 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
3008 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: #NO_APP
3009 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
3010 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 0
3011 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
3012 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: .LBB41_3: # Block address taken
3013 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # %fail
3014 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: # Label of block must be emitted
3015 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: li a0, 1
3016 ; RV64I-MEDIUM-NO-INTEGRATED-NEXT: ret
3018 ; RV64I-LARGE-NO-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
3019 ; RV64I-LARGE-NO-INTEGRATED: # %bb.0: # %entry
3020 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .Lpcrel_hi33:
3021 ; RV64I-LARGE-NO-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI41_0)
3022 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi33)(a1)
3023 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
3024 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
3025 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
3026 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.1: # %normal0
3027 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #APP
3028 ; RV64I-LARGE-NO-INTEGRATED-NEXT: sw zero, 0(a1); beqz a0, .LBB41_3
3029 ; RV64I-LARGE-NO-INTEGRATED-NEXT: #NO_APP
3030 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %bb.2: # %normal1
3031 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 0
3032 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
3033 ; RV64I-LARGE-NO-INTEGRATED-NEXT: .LBB41_3: # Block address taken
3034 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # %fail
3035 ; RV64I-LARGE-NO-INTEGRATED-NEXT: # Label of block must be emitted
3036 ; RV64I-LARGE-NO-INTEGRATED-NEXT: li a0, 1
3037 ; RV64I-LARGE-NO-INTEGRATED-NEXT: ret
3039 ; RV32I-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
3040 ; RV32I-INTEGRATED: # %bb.0: # %entry
3041 ; RV32I-INTEGRATED-NEXT: lui a1, %hi(eg)
3042 ; RV32I-INTEGRATED-NEXT: addi a1, a1, %lo(eg)
3043 ; RV32I-INTEGRATED-NEXT: #APP
3044 ; RV32I-INTEGRATED-NEXT: sw zero, 0(a1)
3045 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB41_3
3046 ; RV32I-INTEGRATED-NEXT: #NO_APP
3047 ; RV32I-INTEGRATED-NEXT: # %bb.1: # %normal0
3048 ; RV32I-INTEGRATED-NEXT: #APP
3049 ; RV32I-INTEGRATED-NEXT: sw zero, 0(a1)
3050 ; RV32I-INTEGRATED-NEXT: beqz a0, .LBB41_3
3051 ; RV32I-INTEGRATED-NEXT: #NO_APP
3052 ; RV32I-INTEGRATED-NEXT: # %bb.2: # %normal1
3053 ; RV32I-INTEGRATED-NEXT: li a0, 0
3054 ; RV32I-INTEGRATED-NEXT: ret
3055 ; RV32I-INTEGRATED-NEXT: .LBB41_3: # Block address taken
3056 ; RV32I-INTEGRATED-NEXT: # %fail
3057 ; RV32I-INTEGRATED-NEXT: # Label of block must be emitted
3058 ; RV32I-INTEGRATED-NEXT: li a0, 1
3059 ; RV32I-INTEGRATED-NEXT: ret
3061 ; RV64I-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
3062 ; RV64I-INTEGRATED: # %bb.0: # %entry
3063 ; RV64I-INTEGRATED-NEXT: lui a1, %hi(eg)
3064 ; RV64I-INTEGRATED-NEXT: addi a1, a1, %lo(eg)
3065 ; RV64I-INTEGRATED-NEXT: #APP
3066 ; RV64I-INTEGRATED-NEXT: sw zero, 0(a1)
3067 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB41_3
3068 ; RV64I-INTEGRATED-NEXT: #NO_APP
3069 ; RV64I-INTEGRATED-NEXT: # %bb.1: # %normal0
3070 ; RV64I-INTEGRATED-NEXT: #APP
3071 ; RV64I-INTEGRATED-NEXT: sw zero, 0(a1)
3072 ; RV64I-INTEGRATED-NEXT: beqz a0, .LBB41_3
3073 ; RV64I-INTEGRATED-NEXT: #NO_APP
3074 ; RV64I-INTEGRATED-NEXT: # %bb.2: # %normal1
3075 ; RV64I-INTEGRATED-NEXT: li a0, 0
3076 ; RV64I-INTEGRATED-NEXT: ret
3077 ; RV64I-INTEGRATED-NEXT: .LBB41_3: # Block address taken
3078 ; RV64I-INTEGRATED-NEXT: # %fail
3079 ; RV64I-INTEGRATED-NEXT: # Label of block must be emitted
3080 ; RV64I-INTEGRATED-NEXT: li a0, 1
3081 ; RV64I-INTEGRATED-NEXT: ret
3083 ; RV32I-MEDIUM-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
3084 ; RV32I-MEDIUM-INTEGRATED: # %bb.0: # %entry
3085 ; RV32I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi33:
3086 ; RV32I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
3087 ; RV32I-MEDIUM-INTEGRATED-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi33)
3088 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
3089 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, 0(a1)
3090 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB41_3
3091 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
3092 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal0
3093 ; RV32I-MEDIUM-INTEGRATED-NEXT: #APP
3094 ; RV32I-MEDIUM-INTEGRATED-NEXT: sw zero, 0(a1)
3095 ; RV32I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB41_3
3096 ; RV32I-MEDIUM-INTEGRATED-NEXT: #NO_APP
3097 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %bb.2: # %normal1
3098 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 0
3099 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
3100 ; RV32I-MEDIUM-INTEGRATED-NEXT: .LBB41_3: # Block address taken
3101 ; RV32I-MEDIUM-INTEGRATED-NEXT: # %fail
3102 ; RV32I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
3103 ; RV32I-MEDIUM-INTEGRATED-NEXT: li a0, 1
3104 ; RV32I-MEDIUM-INTEGRATED-NEXT: ret
3106 ; RV64I-MEDIUM-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
3107 ; RV64I-MEDIUM-INTEGRATED: # %bb.0: # %entry
3108 ; RV64I-MEDIUM-INTEGRATED-NEXT: .Lpcrel_hi33:
3109 ; RV64I-MEDIUM-INTEGRATED-NEXT: auipc a1, %pcrel_hi(eg)
3110 ; RV64I-MEDIUM-INTEGRATED-NEXT: addi a1, a1, %pcrel_lo(.Lpcrel_hi33)
3111 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
3112 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, 0(a1)
3113 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB41_3
3114 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
3115 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.1: # %normal0
3116 ; RV64I-MEDIUM-INTEGRATED-NEXT: #APP
3117 ; RV64I-MEDIUM-INTEGRATED-NEXT: sw zero, 0(a1)
3118 ; RV64I-MEDIUM-INTEGRATED-NEXT: beqz a0, .LBB41_3
3119 ; RV64I-MEDIUM-INTEGRATED-NEXT: #NO_APP
3120 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %bb.2: # %normal1
3121 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 0
3122 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
3123 ; RV64I-MEDIUM-INTEGRATED-NEXT: .LBB41_3: # Block address taken
3124 ; RV64I-MEDIUM-INTEGRATED-NEXT: # %fail
3125 ; RV64I-MEDIUM-INTEGRATED-NEXT: # Label of block must be emitted
3126 ; RV64I-MEDIUM-INTEGRATED-NEXT: li a0, 1
3127 ; RV64I-MEDIUM-INTEGRATED-NEXT: ret
3129 ; RV64I-LARGE-INTEGRATED-LABEL: constraint_A_with_multi_callbr_asm:
3130 ; RV64I-LARGE-INTEGRATED: # %bb.0: # %entry
3131 ; RV64I-LARGE-INTEGRATED-NEXT: .Lpcrel_hi33:
3132 ; RV64I-LARGE-INTEGRATED-NEXT: auipc a1, %pcrel_hi(.LCPI41_0)
3133 ; RV64I-LARGE-INTEGRATED-NEXT: ld a1, %pcrel_lo(.Lpcrel_hi33)(a1)
3134 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
3135 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
3136 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB41_3
3137 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
3138 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.1: # %normal0
3139 ; RV64I-LARGE-INTEGRATED-NEXT: #APP
3140 ; RV64I-LARGE-INTEGRATED-NEXT: sw zero, 0(a1)
3141 ; RV64I-LARGE-INTEGRATED-NEXT: beqz a0, .LBB41_3
3142 ; RV64I-LARGE-INTEGRATED-NEXT: #NO_APP
3143 ; RV64I-LARGE-INTEGRATED-NEXT: # %bb.2: # %normal1
3144 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 0
3145 ; RV64I-LARGE-INTEGRATED-NEXT: ret
3146 ; RV64I-LARGE-INTEGRATED-NEXT: .LBB41_3: # Block address taken
3147 ; RV64I-LARGE-INTEGRATED-NEXT: # %fail
3148 ; RV64I-LARGE-INTEGRATED-NEXT: # Label of block must be emitted
3149 ; RV64I-LARGE-INTEGRATED-NEXT: li a0, 1
3150 ; RV64I-LARGE-INTEGRATED-NEXT: ret
3152 callbr void asm "sw zero, $0; beqz $1, $2", "=*A,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal0 [label %fail]
3155 callbr void asm "sw zero, $0; beqz $1, $2", "=*A,r,!i"(ptr elementtype(i32) @eg, i32 %a) to label %normal1 [label %fail]
3164 define void @constraint_A_with_local_1() nounwind {
3165 ; RV32I-LABEL: constraint_A_with_local_1:
3166 ; RV32I: # %bb.0: # %entry
3167 ; RV32I-NEXT: .Ltmp6: # Block address taken
3168 ; RV32I-NEXT: # %bb.1: # %label
3169 ; RV32I-NEXT: lui a0, %hi(.Ltmp6)
3170 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp6)
3172 ; RV32I-NEXT: lw zero, 0(a0)
3173 ; RV32I-NEXT: #NO_APP
3176 ; RV64I-LABEL: constraint_A_with_local_1:
3177 ; RV64I: # %bb.0: # %entry
3178 ; RV64I-NEXT: .Ltmp6: # Block address taken
3179 ; RV64I-NEXT: # %bb.1: # %label
3180 ; RV64I-NEXT: lui a0, %hi(.Ltmp6)
3181 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp6)
3183 ; RV64I-NEXT: lw zero, 0(a0)
3184 ; RV64I-NEXT: #NO_APP
3187 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_1:
3188 ; RV32I-MEDIUM: # %bb.0: # %entry
3189 ; RV32I-MEDIUM-NEXT: .Ltmp6: # Block address taken
3190 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
3191 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi34:
3192 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp6)
3193 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi34)
3194 ; RV32I-MEDIUM-NEXT: #APP
3195 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
3196 ; RV32I-MEDIUM-NEXT: #NO_APP
3197 ; RV32I-MEDIUM-NEXT: ret
3199 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_1:
3200 ; RV64I-MEDIUM: # %bb.0: # %entry
3201 ; RV64I-MEDIUM-NEXT: .Ltmp6: # Block address taken
3202 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
3203 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi34:
3204 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp6)
3205 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi34)
3206 ; RV64I-MEDIUM-NEXT: #APP
3207 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
3208 ; RV64I-MEDIUM-NEXT: #NO_APP
3209 ; RV64I-MEDIUM-NEXT: ret
3211 ; RV64I-LARGE-LABEL: constraint_A_with_local_1:
3212 ; RV64I-LARGE: # %bb.0: # %entry
3213 ; RV64I-LARGE-NEXT: .Ltmp6: # Block address taken
3214 ; RV64I-LARGE-NEXT: # %bb.1: # %label
3215 ; RV64I-LARGE-NEXT: .Lpcrel_hi34:
3216 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp6)
3217 ; RV64I-LARGE-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi34)
3218 ; RV64I-LARGE-NEXT: #APP
3219 ; RV64I-LARGE-NEXT: lw zero, 0(a0)
3220 ; RV64I-LARGE-NEXT: #NO_APP
3221 ; RV64I-LARGE-NEXT: ret
3226 tail call void asm sideeffect "lw zero, $0", "*A"(ptr elementtype(ptr) blockaddress(@constraint_A_with_local_1, %label))
3230 define void @constraint_A_with_local_2() nounwind {
3231 ; RV32I-LABEL: constraint_A_with_local_2:
3232 ; RV32I: # %bb.0: # %entry
3233 ; RV32I-NEXT: .Ltmp7: # Block address taken
3234 ; RV32I-NEXT: # %bb.1: # %label
3235 ; RV32I-NEXT: lui a0, %hi(.Ltmp7+4)
3236 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp7+4)
3238 ; RV32I-NEXT: lw zero, 0(a0)
3239 ; RV32I-NEXT: #NO_APP
3242 ; RV64I-LABEL: constraint_A_with_local_2:
3243 ; RV64I: # %bb.0: # %entry
3244 ; RV64I-NEXT: .Ltmp7: # Block address taken
3245 ; RV64I-NEXT: # %bb.1: # %label
3246 ; RV64I-NEXT: lui a0, %hi(.Ltmp7+4)
3247 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp7+4)
3249 ; RV64I-NEXT: lw zero, 0(a0)
3250 ; RV64I-NEXT: #NO_APP
3253 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_2:
3254 ; RV32I-MEDIUM: # %bb.0: # %entry
3255 ; RV32I-MEDIUM-NEXT: .Ltmp7: # Block address taken
3256 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
3257 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi35:
3258 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp7+4)
3259 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi35)
3260 ; RV32I-MEDIUM-NEXT: #APP
3261 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
3262 ; RV32I-MEDIUM-NEXT: #NO_APP
3263 ; RV32I-MEDIUM-NEXT: ret
3265 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_2:
3266 ; RV64I-MEDIUM: # %bb.0: # %entry
3267 ; RV64I-MEDIUM-NEXT: .Ltmp7: # Block address taken
3268 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
3269 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi35:
3270 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp7+4)
3271 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi35)
3272 ; RV64I-MEDIUM-NEXT: #APP
3273 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
3274 ; RV64I-MEDIUM-NEXT: #NO_APP
3275 ; RV64I-MEDIUM-NEXT: ret
3277 ; RV64I-LARGE-LABEL: constraint_A_with_local_2:
3278 ; RV64I-LARGE: # %bb.0: # %entry
3279 ; RV64I-LARGE-NEXT: .Ltmp7: # Block address taken
3280 ; RV64I-LARGE-NEXT: # %bb.1: # %label
3281 ; RV64I-LARGE-NEXT: .Lpcrel_hi35:
3282 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp7+4)
3283 ; RV64I-LARGE-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi35)
3284 ; RV64I-LARGE-NEXT: #APP
3285 ; RV64I-LARGE-NEXT: lw zero, 0(a0)
3286 ; RV64I-LARGE-NEXT: #NO_APP
3287 ; RV64I-LARGE-NEXT: ret
3292 call void asm "lw zero, $0", "*A"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_A_with_local_2, %label), i32 4))
3296 define void @constraint_A_with_local_3() nounwind {
3297 ; RV32I-LABEL: constraint_A_with_local_3:
3298 ; RV32I: # %bb.0: # %entry
3299 ; RV32I-NEXT: .Ltmp8: # Block address taken
3300 ; RV32I-NEXT: # %bb.1: # %label
3301 ; RV32I-NEXT: lui a0, %hi(.Ltmp8+2000)
3302 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp8+2000)
3304 ; RV32I-NEXT: lw zero, 0(a0)
3305 ; RV32I-NEXT: #NO_APP
3308 ; RV64I-LABEL: constraint_A_with_local_3:
3309 ; RV64I: # %bb.0: # %entry
3310 ; RV64I-NEXT: .Ltmp8: # Block address taken
3311 ; RV64I-NEXT: # %bb.1: # %label
3312 ; RV64I-NEXT: lui a0, %hi(.Ltmp8+2000)
3313 ; RV64I-NEXT: addi a0, a0, %lo(.Ltmp8+2000)
3315 ; RV64I-NEXT: lw zero, 0(a0)
3316 ; RV64I-NEXT: #NO_APP
3319 ; RV32I-MEDIUM-LABEL: constraint_A_with_local_3:
3320 ; RV32I-MEDIUM: # %bb.0: # %entry
3321 ; RV32I-MEDIUM-NEXT: .Ltmp8: # Block address taken
3322 ; RV32I-MEDIUM-NEXT: # %bb.1: # %label
3323 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi36:
3324 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp8+2000)
3325 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi36)
3326 ; RV32I-MEDIUM-NEXT: #APP
3327 ; RV32I-MEDIUM-NEXT: lw zero, 0(a0)
3328 ; RV32I-MEDIUM-NEXT: #NO_APP
3329 ; RV32I-MEDIUM-NEXT: ret
3331 ; RV64I-MEDIUM-LABEL: constraint_A_with_local_3:
3332 ; RV64I-MEDIUM: # %bb.0: # %entry
3333 ; RV64I-MEDIUM-NEXT: .Ltmp8: # Block address taken
3334 ; RV64I-MEDIUM-NEXT: # %bb.1: # %label
3335 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi36:
3336 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(.Ltmp8+2000)
3337 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi36)
3338 ; RV64I-MEDIUM-NEXT: #APP
3339 ; RV64I-MEDIUM-NEXT: lw zero, 0(a0)
3340 ; RV64I-MEDIUM-NEXT: #NO_APP
3341 ; RV64I-MEDIUM-NEXT: ret
3343 ; RV64I-LARGE-LABEL: constraint_A_with_local_3:
3344 ; RV64I-LARGE: # %bb.0: # %entry
3345 ; RV64I-LARGE-NEXT: .Ltmp8: # Block address taken
3346 ; RV64I-LARGE-NEXT: # %bb.1: # %label
3347 ; RV64I-LARGE-NEXT: .Lpcrel_hi36:
3348 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.Ltmp8+2000)
3349 ; RV64I-LARGE-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi36)
3350 ; RV64I-LARGE-NEXT: #APP
3351 ; RV64I-LARGE-NEXT: lw zero, 0(a0)
3352 ; RV64I-LARGE-NEXT: #NO_APP
3353 ; RV64I-LARGE-NEXT: ret
3358 call void asm "lw zero, $0", "*A"(ptr elementtype(i32) getelementptr (i8, ptr blockaddress(@constraint_A_with_local_3, %label), i32 2000))
3362 @_ZN5repro9MY_BUFFER17hb0f674501d5980a6E = external global <{ [16 x i8] }>
3364 ; Address is not used by a memory constraint.
3365 define void @should_not_fold() {
3366 ; RV32I-LABEL: should_not_fold:
3367 ; RV32I: # %bb.0: # %start
3368 ; RV32I-NEXT: lui a0, %hi(_ZN5repro9MY_BUFFER17hb0f674501d5980a6E)
3369 ; RV32I-NEXT: addi a0, a0, %lo(_ZN5repro9MY_BUFFER17hb0f674501d5980a6E)
3372 ; RV32I-NEXT: #NO_APP
3375 ; RV64I-LABEL: should_not_fold:
3376 ; RV64I: # %bb.0: # %start
3377 ; RV64I-NEXT: lui a0, %hi(_ZN5repro9MY_BUFFER17hb0f674501d5980a6E)
3378 ; RV64I-NEXT: addi a0, a0, %lo(_ZN5repro9MY_BUFFER17hb0f674501d5980a6E)
3381 ; RV64I-NEXT: #NO_APP
3384 ; RV32I-MEDIUM-LABEL: should_not_fold:
3385 ; RV32I-MEDIUM: # %bb.0: # %start
3386 ; RV32I-MEDIUM-NEXT: .Lpcrel_hi37:
3387 ; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(_ZN5repro9MY_BUFFER17hb0f674501d5980a6E)
3388 ; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi37)
3389 ; RV32I-MEDIUM-NEXT: #APP
3390 ; RV32I-MEDIUM-NEXT: ecall
3391 ; RV32I-MEDIUM-NEXT: #NO_APP
3392 ; RV32I-MEDIUM-NEXT: ret
3394 ; RV64I-MEDIUM-LABEL: should_not_fold:
3395 ; RV64I-MEDIUM: # %bb.0: # %start
3396 ; RV64I-MEDIUM-NEXT: .Lpcrel_hi37:
3397 ; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(_ZN5repro9MY_BUFFER17hb0f674501d5980a6E)
3398 ; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi37)
3399 ; RV64I-MEDIUM-NEXT: #APP
3400 ; RV64I-MEDIUM-NEXT: ecall
3401 ; RV64I-MEDIUM-NEXT: #NO_APP
3402 ; RV64I-MEDIUM-NEXT: ret
3404 ; RV64I-LARGE-LABEL: should_not_fold:
3405 ; RV64I-LARGE: # %bb.0: # %start
3406 ; RV64I-LARGE-NEXT: .Lpcrel_hi37:
3407 ; RV64I-LARGE-NEXT: auipc a0, %pcrel_hi(.LCPI45_0)
3408 ; RV64I-LARGE-NEXT: ld a0, %pcrel_lo(.Lpcrel_hi37)(a0)
3409 ; RV64I-LARGE-NEXT: #APP
3410 ; RV64I-LARGE-NEXT: ecall
3411 ; RV64I-LARGE-NEXT: #NO_APP
3412 ; RV64I-LARGE-NEXT: ret
3414 %0 = tail call ptr asm sideeffect alignstack "ecall", "=&{x10},0,~{vtype},~{vl},~{vxsat},~{vxrm},~{memory}"(ptr @_ZN5repro9MY_BUFFER17hb0f674501d5980a6E)