1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32I %s
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV64I %s
6 ; RUN: llc -mtriple=riscv32 -mattr=+zicbop -verify-machineinstrs < %s \
7 ; RUN: | FileCheck -check-prefix=RV32ZICBOP %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+zicbop -verify-machineinstrs < %s \
9 ; RUN: | FileCheck -check-prefix=RV64ZICBOP %s
10 ; RUN: llc -mtriple=riscv64 -mattr=+zicbop,+zihintntl -verify-machineinstrs < %s \
11 ; RUN: | FileCheck -check-prefix=RV64ZICBOPZIHINTNTL %s
13 declare void @llvm.prefetch(ptr, i32, i32, i32)
15 define void @test_prefetch_read_locality_0(ptr %a) nounwind {
16 ; RV32I-LABEL: test_prefetch_read_locality_0:
20 ; RV64I-LABEL: test_prefetch_read_locality_0:
24 ; RV32ZICBOP-LABEL: test_prefetch_read_locality_0:
25 ; RV32ZICBOP: # %bb.0:
26 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
27 ; RV32ZICBOP-NEXT: ret
29 ; RV64ZICBOP-LABEL: test_prefetch_read_locality_0:
30 ; RV64ZICBOP: # %bb.0:
31 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
32 ; RV64ZICBOP-NEXT: ret
34 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_read_locality_0:
35 ; RV64ZICBOPZIHINTNTL: # %bb.0:
36 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
37 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
38 ; RV64ZICBOPZIHINTNTL-NEXT: ret
39 call void @llvm.prefetch(ptr %a, i32 0, i32 0, i32 1)
43 define void @test_prefetch_write_locality_0(ptr %a) nounwind {
44 ; RV32I-LABEL: test_prefetch_write_locality_0:
48 ; RV64I-LABEL: test_prefetch_write_locality_0:
52 ; RV32ZICBOP-LABEL: test_prefetch_write_locality_0:
53 ; RV32ZICBOP: # %bb.0:
54 ; RV32ZICBOP-NEXT: prefetch.w 0(a0)
55 ; RV32ZICBOP-NEXT: ret
57 ; RV64ZICBOP-LABEL: test_prefetch_write_locality_0:
58 ; RV64ZICBOP: # %bb.0:
59 ; RV64ZICBOP-NEXT: prefetch.w 0(a0)
60 ; RV64ZICBOP-NEXT: ret
62 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_write_locality_0:
63 ; RV64ZICBOPZIHINTNTL: # %bb.0:
64 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
65 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.w 0(a0)
66 ; RV64ZICBOPZIHINTNTL-NEXT: ret
67 call void @llvm.prefetch(ptr %a, i32 1, i32 0, i32 1)
71 define void @test_prefetch_instruction_locality_0(ptr %a) nounwind {
72 ; RV32I-LABEL: test_prefetch_instruction_locality_0:
76 ; RV64I-LABEL: test_prefetch_instruction_locality_0:
80 ; RV32ZICBOP-LABEL: test_prefetch_instruction_locality_0:
81 ; RV32ZICBOP: # %bb.0:
82 ; RV32ZICBOP-NEXT: prefetch.i 0(a0)
83 ; RV32ZICBOP-NEXT: ret
85 ; RV64ZICBOP-LABEL: test_prefetch_instruction_locality_0:
86 ; RV64ZICBOP: # %bb.0:
87 ; RV64ZICBOP-NEXT: prefetch.i 0(a0)
88 ; RV64ZICBOP-NEXT: ret
90 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_instruction_locality_0:
91 ; RV64ZICBOPZIHINTNTL: # %bb.0:
92 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
93 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.i 0(a0)
94 ; RV64ZICBOPZIHINTNTL-NEXT: ret
95 call void @llvm.prefetch(ptr %a, i32 0, i32 0, i32 0)
99 define void @test_prefetch_read_locality_1(ptr %a) nounwind {
100 ; RV32I-LABEL: test_prefetch_read_locality_1:
104 ; RV64I-LABEL: test_prefetch_read_locality_1:
108 ; RV32ZICBOP-LABEL: test_prefetch_read_locality_1:
109 ; RV32ZICBOP: # %bb.0:
110 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
111 ; RV32ZICBOP-NEXT: ret
113 ; RV64ZICBOP-LABEL: test_prefetch_read_locality_1:
114 ; RV64ZICBOP: # %bb.0:
115 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
116 ; RV64ZICBOP-NEXT: ret
118 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_read_locality_1:
119 ; RV64ZICBOPZIHINTNTL: # %bb.0:
120 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.pall
121 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
122 ; RV64ZICBOPZIHINTNTL-NEXT: ret
123 call void @llvm.prefetch(ptr %a, i32 0, i32 1, i32 1)
127 define void @test_prefetch_write_locality_1(ptr %a) nounwind {
128 ; RV32I-LABEL: test_prefetch_write_locality_1:
132 ; RV64I-LABEL: test_prefetch_write_locality_1:
136 ; RV32ZICBOP-LABEL: test_prefetch_write_locality_1:
137 ; RV32ZICBOP: # %bb.0:
138 ; RV32ZICBOP-NEXT: prefetch.w 0(a0)
139 ; RV32ZICBOP-NEXT: ret
141 ; RV64ZICBOP-LABEL: test_prefetch_write_locality_1:
142 ; RV64ZICBOP: # %bb.0:
143 ; RV64ZICBOP-NEXT: prefetch.w 0(a0)
144 ; RV64ZICBOP-NEXT: ret
146 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_write_locality_1:
147 ; RV64ZICBOPZIHINTNTL: # %bb.0:
148 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.pall
149 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.w 0(a0)
150 ; RV64ZICBOPZIHINTNTL-NEXT: ret
151 call void @llvm.prefetch(ptr %a, i32 1, i32 1, i32 1)
155 define void @test_prefetch_instruction_locality_1(ptr %a) nounwind {
156 ; RV32I-LABEL: test_prefetch_instruction_locality_1:
160 ; RV64I-LABEL: test_prefetch_instruction_locality_1:
164 ; RV32ZICBOP-LABEL: test_prefetch_instruction_locality_1:
165 ; RV32ZICBOP: # %bb.0:
166 ; RV32ZICBOP-NEXT: prefetch.i 0(a0)
167 ; RV32ZICBOP-NEXT: ret
169 ; RV64ZICBOP-LABEL: test_prefetch_instruction_locality_1:
170 ; RV64ZICBOP: # %bb.0:
171 ; RV64ZICBOP-NEXT: prefetch.i 0(a0)
172 ; RV64ZICBOP-NEXT: ret
174 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_instruction_locality_1:
175 ; RV64ZICBOPZIHINTNTL: # %bb.0:
176 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.pall
177 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.i 0(a0)
178 ; RV64ZICBOPZIHINTNTL-NEXT: ret
179 call void @llvm.prefetch(ptr %a, i32 0, i32 1, i32 0)
183 define void @test_prefetch_read_locality_2(ptr %a) nounwind {
184 ; RV32I-LABEL: test_prefetch_read_locality_2:
188 ; RV64I-LABEL: test_prefetch_read_locality_2:
192 ; RV32ZICBOP-LABEL: test_prefetch_read_locality_2:
193 ; RV32ZICBOP: # %bb.0:
194 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
195 ; RV32ZICBOP-NEXT: ret
197 ; RV64ZICBOP-LABEL: test_prefetch_read_locality_2:
198 ; RV64ZICBOP: # %bb.0:
199 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
200 ; RV64ZICBOP-NEXT: ret
202 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_read_locality_2:
203 ; RV64ZICBOPZIHINTNTL: # %bb.0:
204 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.p1
205 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
206 ; RV64ZICBOPZIHINTNTL-NEXT: ret
207 call void @llvm.prefetch(ptr %a, i32 0, i32 2, i32 1)
211 define void @test_prefetch_write_locality_2(ptr %a) nounwind {
212 ; RV32I-LABEL: test_prefetch_write_locality_2:
216 ; RV64I-LABEL: test_prefetch_write_locality_2:
220 ; RV32ZICBOP-LABEL: test_prefetch_write_locality_2:
221 ; RV32ZICBOP: # %bb.0:
222 ; RV32ZICBOP-NEXT: prefetch.w 0(a0)
223 ; RV32ZICBOP-NEXT: ret
225 ; RV64ZICBOP-LABEL: test_prefetch_write_locality_2:
226 ; RV64ZICBOP: # %bb.0:
227 ; RV64ZICBOP-NEXT: prefetch.w 0(a0)
228 ; RV64ZICBOP-NEXT: ret
230 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_write_locality_2:
231 ; RV64ZICBOPZIHINTNTL: # %bb.0:
232 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.p1
233 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.w 0(a0)
234 ; RV64ZICBOPZIHINTNTL-NEXT: ret
235 call void @llvm.prefetch(ptr %a, i32 1, i32 2, i32 1)
239 define void @test_prefetch_instruction_locality_2(ptr %a) nounwind {
240 ; RV32I-LABEL: test_prefetch_instruction_locality_2:
244 ; RV64I-LABEL: test_prefetch_instruction_locality_2:
248 ; RV32ZICBOP-LABEL: test_prefetch_instruction_locality_2:
249 ; RV32ZICBOP: # %bb.0:
250 ; RV32ZICBOP-NEXT: prefetch.i 0(a0)
251 ; RV32ZICBOP-NEXT: ret
253 ; RV64ZICBOP-LABEL: test_prefetch_instruction_locality_2:
254 ; RV64ZICBOP: # %bb.0:
255 ; RV64ZICBOP-NEXT: prefetch.i 0(a0)
256 ; RV64ZICBOP-NEXT: ret
258 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_instruction_locality_2:
259 ; RV64ZICBOPZIHINTNTL: # %bb.0:
260 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.p1
261 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.i 0(a0)
262 ; RV64ZICBOPZIHINTNTL-NEXT: ret
263 call void @llvm.prefetch(ptr %a, i32 0, i32 2, i32 0)
268 define void @test_prefetch_read_locality_3(ptr %a) nounwind {
269 ; RV32I-LABEL: test_prefetch_read_locality_3:
273 ; RV64I-LABEL: test_prefetch_read_locality_3:
277 ; RV32ZICBOP-LABEL: test_prefetch_read_locality_3:
278 ; RV32ZICBOP: # %bb.0:
279 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
280 ; RV32ZICBOP-NEXT: ret
282 ; RV64ZICBOP-LABEL: test_prefetch_read_locality_3:
283 ; RV64ZICBOP: # %bb.0:
284 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
285 ; RV64ZICBOP-NEXT: ret
287 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_read_locality_3:
288 ; RV64ZICBOPZIHINTNTL: # %bb.0:
289 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
290 ; RV64ZICBOPZIHINTNTL-NEXT: ret
291 call void @llvm.prefetch(ptr %a, i32 0, i32 3, i32 1)
295 define void @test_prefetch_write_locality_3(ptr %a) nounwind {
296 ; RV32I-LABEL: test_prefetch_write_locality_3:
300 ; RV64I-LABEL: test_prefetch_write_locality_3:
304 ; RV32ZICBOP-LABEL: test_prefetch_write_locality_3:
305 ; RV32ZICBOP: # %bb.0:
306 ; RV32ZICBOP-NEXT: prefetch.w 0(a0)
307 ; RV32ZICBOP-NEXT: ret
309 ; RV64ZICBOP-LABEL: test_prefetch_write_locality_3:
310 ; RV64ZICBOP: # %bb.0:
311 ; RV64ZICBOP-NEXT: prefetch.w 0(a0)
312 ; RV64ZICBOP-NEXT: ret
314 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_write_locality_3:
315 ; RV64ZICBOPZIHINTNTL: # %bb.0:
316 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.w 0(a0)
317 ; RV64ZICBOPZIHINTNTL-NEXT: ret
318 call void @llvm.prefetch(ptr %a, i32 1, i32 3, i32 1)
322 define void @test_prefetch_instruction_locality_3(ptr %a) nounwind {
323 ; RV32I-LABEL: test_prefetch_instruction_locality_3:
327 ; RV64I-LABEL: test_prefetch_instruction_locality_3:
331 ; RV32ZICBOP-LABEL: test_prefetch_instruction_locality_3:
332 ; RV32ZICBOP: # %bb.0:
333 ; RV32ZICBOP-NEXT: prefetch.i 0(a0)
334 ; RV32ZICBOP-NEXT: ret
336 ; RV64ZICBOP-LABEL: test_prefetch_instruction_locality_3:
337 ; RV64ZICBOP: # %bb.0:
338 ; RV64ZICBOP-NEXT: prefetch.i 0(a0)
339 ; RV64ZICBOP-NEXT: ret
341 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_instruction_locality_3:
342 ; RV64ZICBOPZIHINTNTL: # %bb.0:
343 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.i 0(a0)
344 ; RV64ZICBOPZIHINTNTL-NEXT: ret
345 call void @llvm.prefetch(ptr %a, i32 0, i32 3, i32 0)
349 define void @test_prefetch_offsetable_0(ptr %a) nounwind {
350 ; RV32I-LABEL: test_prefetch_offsetable_0:
354 ; RV64I-LABEL: test_prefetch_offsetable_0:
358 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_0:
359 ; RV32ZICBOP: # %bb.0:
360 ; RV32ZICBOP-NEXT: prefetch.r 2016(a0)
361 ; RV32ZICBOP-NEXT: ret
363 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_0:
364 ; RV64ZICBOP: # %bb.0:
365 ; RV64ZICBOP-NEXT: prefetch.r 2016(a0)
366 ; RV64ZICBOP-NEXT: ret
368 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_0:
369 ; RV64ZICBOPZIHINTNTL: # %bb.0:
370 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
371 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 2016(a0)
372 ; RV64ZICBOPZIHINTNTL-NEXT: ret
373 %addr = getelementptr i8, ptr %a, i64 2016
374 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
378 define void @test_prefetch_offsetable_1(ptr %a) nounwind {
379 ; RV32I-LABEL: test_prefetch_offsetable_1:
383 ; RV64I-LABEL: test_prefetch_offsetable_1:
387 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_1:
388 ; RV32ZICBOP: # %bb.0:
389 ; RV32ZICBOP-NEXT: prefetch.r -2048(a0)
390 ; RV32ZICBOP-NEXT: ret
392 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_1:
393 ; RV64ZICBOP: # %bb.0:
394 ; RV64ZICBOP-NEXT: prefetch.r -2048(a0)
395 ; RV64ZICBOP-NEXT: ret
397 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_1:
398 ; RV64ZICBOPZIHINTNTL: # %bb.0:
399 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
400 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -2048(a0)
401 ; RV64ZICBOPZIHINTNTL-NEXT: ret
402 %addr = getelementptr i8, ptr %a, i64 -2048
403 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
407 define void @test_prefetch_offsetable_2(ptr %a) nounwind {
408 ; RV32I-LABEL: test_prefetch_offsetable_2:
412 ; RV64I-LABEL: test_prefetch_offsetable_2:
416 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_2:
417 ; RV32ZICBOP: # %bb.0:
418 ; RV32ZICBOP-NEXT: prefetch.r 32(a0)
419 ; RV32ZICBOP-NEXT: ret
421 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_2:
422 ; RV64ZICBOP: # %bb.0:
423 ; RV64ZICBOP-NEXT: prefetch.r 32(a0)
424 ; RV64ZICBOP-NEXT: ret
426 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_2:
427 ; RV64ZICBOPZIHINTNTL: # %bb.0:
428 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
429 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 32(a0)
430 ; RV64ZICBOPZIHINTNTL-NEXT: ret
431 %addr = getelementptr i8, ptr %a, i64 32
432 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
436 define void @test_prefetch_offsetable_3(ptr %a) nounwind {
437 ; RV32I-LABEL: test_prefetch_offsetable_3:
441 ; RV64I-LABEL: test_prefetch_offsetable_3:
445 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_3:
446 ; RV32ZICBOP: # %bb.0:
447 ; RV32ZICBOP-NEXT: prefetch.r -32(a0)
448 ; RV32ZICBOP-NEXT: ret
450 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_3:
451 ; RV64ZICBOP: # %bb.0:
452 ; RV64ZICBOP-NEXT: prefetch.r -32(a0)
453 ; RV64ZICBOP-NEXT: ret
455 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_3:
456 ; RV64ZICBOPZIHINTNTL: # %bb.0:
457 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
458 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -32(a0)
459 ; RV64ZICBOPZIHINTNTL-NEXT: ret
460 %addr = getelementptr i8, ptr %a, i64 -32
461 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
465 define void @test_prefetch_offsetable_4(ptr %a) nounwind {
466 ; RV32I-LABEL: test_prefetch_offsetable_4:
470 ; RV64I-LABEL: test_prefetch_offsetable_4:
474 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_4:
475 ; RV32ZICBOP: # %bb.0:
476 ; RV32ZICBOP-NEXT: addi a0, a0, 32
477 ; RV32ZICBOP-NEXT: prefetch.r 2016(a0)
478 ; RV32ZICBOP-NEXT: ret
480 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_4:
481 ; RV64ZICBOP: # %bb.0:
482 ; RV64ZICBOP-NEXT: addi a0, a0, 32
483 ; RV64ZICBOP-NEXT: prefetch.r 2016(a0)
484 ; RV64ZICBOP-NEXT: ret
486 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_4:
487 ; RV64ZICBOPZIHINTNTL: # %bb.0:
488 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, 32
489 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
490 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 2016(a0)
491 ; RV64ZICBOPZIHINTNTL-NEXT: ret
492 %addr = getelementptr i8, ptr %a, i64 2048
493 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
497 define void @test_prefetch_offsetable_5(ptr %a) nounwind {
498 ; RV32I-LABEL: test_prefetch_offsetable_5:
502 ; RV64I-LABEL: test_prefetch_offsetable_5:
506 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_5:
507 ; RV32ZICBOP: # %bb.0:
508 ; RV32ZICBOP-NEXT: addi a0, a0, -1
509 ; RV32ZICBOP-NEXT: prefetch.r -2048(a0)
510 ; RV32ZICBOP-NEXT: ret
512 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_5:
513 ; RV64ZICBOP: # %bb.0:
514 ; RV64ZICBOP-NEXT: addi a0, a0, -1
515 ; RV64ZICBOP-NEXT: prefetch.r -2048(a0)
516 ; RV64ZICBOP-NEXT: ret
518 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_5:
519 ; RV64ZICBOPZIHINTNTL: # %bb.0:
520 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, -1
521 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
522 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -2048(a0)
523 ; RV64ZICBOPZIHINTNTL-NEXT: ret
524 %addr = getelementptr i8, ptr %a, i64 -2049
525 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
529 define void @test_prefetch_offsetable_6(ptr %a) nounwind {
530 ; RV32I-LABEL: test_prefetch_offsetable_6:
534 ; RV64I-LABEL: test_prefetch_offsetable_6:
538 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_6:
539 ; RV32ZICBOP: # %bb.0:
540 ; RV32ZICBOP-NEXT: addi a0, a0, 16
541 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
542 ; RV32ZICBOP-NEXT: ret
544 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_6:
545 ; RV64ZICBOP: # %bb.0:
546 ; RV64ZICBOP-NEXT: addi a0, a0, 16
547 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
548 ; RV64ZICBOP-NEXT: ret
550 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_6:
551 ; RV64ZICBOPZIHINTNTL: # %bb.0:
552 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, 16
553 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
554 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
555 ; RV64ZICBOPZIHINTNTL-NEXT: ret
556 %addr = getelementptr i8, ptr %a, i64 16
557 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
561 define void @test_prefetch_offsetable_7(ptr %a) nounwind {
562 ; RV32I-LABEL: test_prefetch_offsetable_7:
566 ; RV64I-LABEL: test_prefetch_offsetable_7:
570 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_7:
571 ; RV32ZICBOP: # %bb.0:
572 ; RV32ZICBOP-NEXT: addi a0, a0, -16
573 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
574 ; RV32ZICBOP-NEXT: ret
576 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_7:
577 ; RV64ZICBOP: # %bb.0:
578 ; RV64ZICBOP-NEXT: addi a0, a0, -16
579 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
580 ; RV64ZICBOP-NEXT: ret
582 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_7:
583 ; RV64ZICBOPZIHINTNTL: # %bb.0:
584 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, -16
585 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
586 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
587 ; RV64ZICBOPZIHINTNTL-NEXT: ret
588 %addr = getelementptr i8, ptr %a, i64 -16
589 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
593 define void @test_prefetch_offsetable_9(ptr %a) nounwind {
594 ; RV32I-LABEL: test_prefetch_offsetable_9:
598 ; RV64I-LABEL: test_prefetch_offsetable_9:
602 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_9:
603 ; RV32ZICBOP: # %bb.0:
604 ; RV32ZICBOP-NEXT: lui a1, 1
605 ; RV32ZICBOP-NEXT: add a0, a0, a1
606 ; RV32ZICBOP-NEXT: prefetch.r 64(a0)
607 ; RV32ZICBOP-NEXT: ret
609 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_9:
610 ; RV64ZICBOP: # %bb.0:
611 ; RV64ZICBOP-NEXT: lui a1, 1
612 ; RV64ZICBOP-NEXT: add a0, a0, a1
613 ; RV64ZICBOP-NEXT: prefetch.r 64(a0)
614 ; RV64ZICBOP-NEXT: ret
616 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_9:
617 ; RV64ZICBOPZIHINTNTL: # %bb.0:
618 ; RV64ZICBOPZIHINTNTL-NEXT: lui a1, 1
619 ; RV64ZICBOPZIHINTNTL-NEXT: add a0, a0, a1
620 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
621 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 64(a0)
622 ; RV64ZICBOPZIHINTNTL-NEXT: ret
623 %addr = getelementptr i8, ptr %a, i64 4160
624 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
628 define void @test_prefetch_offsetable_8(ptr %a) nounwind {
629 ; RV32I-LABEL: test_prefetch_offsetable_8:
633 ; RV64I-LABEL: test_prefetch_offsetable_8:
637 ; RV32ZICBOP-LABEL: test_prefetch_offsetable_8:
638 ; RV32ZICBOP: # %bb.0:
639 ; RV32ZICBOP-NEXT: lui a1, 1048575
640 ; RV32ZICBOP-NEXT: add a0, a0, a1
641 ; RV32ZICBOP-NEXT: prefetch.r -64(a0)
642 ; RV32ZICBOP-NEXT: ret
644 ; RV64ZICBOP-LABEL: test_prefetch_offsetable_8:
645 ; RV64ZICBOP: # %bb.0:
646 ; RV64ZICBOP-NEXT: lui a1, 1048575
647 ; RV64ZICBOP-NEXT: add a0, a0, a1
648 ; RV64ZICBOP-NEXT: prefetch.r -64(a0)
649 ; RV64ZICBOP-NEXT: ret
651 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_offsetable_8:
652 ; RV64ZICBOPZIHINTNTL: # %bb.0:
653 ; RV64ZICBOPZIHINTNTL-NEXT: lui a1, 1048575
654 ; RV64ZICBOPZIHINTNTL-NEXT: add a0, a0, a1
655 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
656 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -64(a0)
657 ; RV64ZICBOPZIHINTNTL-NEXT: ret
658 %addr = getelementptr i8, ptr %a, i64 -4160
659 call void @llvm.prefetch(ptr %addr, i32 0, i32 0, i32 1)
663 define void @test_prefetch_frameindex_0() nounwind {
664 ; RV32I-LABEL: test_prefetch_frameindex_0:
666 ; RV32I-NEXT: addi sp, sp, -512
667 ; RV32I-NEXT: addi sp, sp, 512
670 ; RV64I-LABEL: test_prefetch_frameindex_0:
672 ; RV64I-NEXT: addi sp, sp, -512
673 ; RV64I-NEXT: addi sp, sp, 512
676 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_0:
677 ; RV32ZICBOP: # %bb.0:
678 ; RV32ZICBOP-NEXT: addi sp, sp, -512
679 ; RV32ZICBOP-NEXT: prefetch.r 0(sp)
680 ; RV32ZICBOP-NEXT: addi sp, sp, 512
681 ; RV32ZICBOP-NEXT: ret
683 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_0:
684 ; RV64ZICBOP: # %bb.0:
685 ; RV64ZICBOP-NEXT: addi sp, sp, -512
686 ; RV64ZICBOP-NEXT: prefetch.r 0(sp)
687 ; RV64ZICBOP-NEXT: addi sp, sp, 512
688 ; RV64ZICBOP-NEXT: ret
690 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_0:
691 ; RV64ZICBOPZIHINTNTL: # %bb.0:
692 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
693 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
694 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(sp)
695 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
696 ; RV64ZICBOPZIHINTNTL-NEXT: ret
697 %data = alloca [128 x i32], align 4
698 %base = bitcast [128 x i32]* %data to i8*
699 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 0
700 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
704 define void @test_prefetch_frameindex_1() nounwind {
705 ; RV32I-LABEL: test_prefetch_frameindex_1:
707 ; RV32I-NEXT: lui a0, 1
708 ; RV32I-NEXT: addi a0, a0, 16
709 ; RV32I-NEXT: sub sp, sp, a0
710 ; RV32I-NEXT: lui a0, 1
711 ; RV32I-NEXT: addi a0, a0, 16
712 ; RV32I-NEXT: add sp, sp, a0
715 ; RV64I-LABEL: test_prefetch_frameindex_1:
717 ; RV64I-NEXT: lui a0, 1
718 ; RV64I-NEXT: addiw a0, a0, 16
719 ; RV64I-NEXT: sub sp, sp, a0
720 ; RV64I-NEXT: lui a0, 1
721 ; RV64I-NEXT: addiw a0, a0, 16
722 ; RV64I-NEXT: add sp, sp, a0
725 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_1:
726 ; RV32ZICBOP: # %bb.0:
727 ; RV32ZICBOP-NEXT: lui a0, 1
728 ; RV32ZICBOP-NEXT: addi a0, a0, 16
729 ; RV32ZICBOP-NEXT: sub sp, sp, a0
730 ; RV32ZICBOP-NEXT: addi a0, sp, 16
731 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
732 ; RV32ZICBOP-NEXT: lui a0, 1
733 ; RV32ZICBOP-NEXT: addi a0, a0, 16
734 ; RV32ZICBOP-NEXT: add sp, sp, a0
735 ; RV32ZICBOP-NEXT: ret
737 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_1:
738 ; RV64ZICBOP: # %bb.0:
739 ; RV64ZICBOP-NEXT: lui a0, 1
740 ; RV64ZICBOP-NEXT: addiw a0, a0, 16
741 ; RV64ZICBOP-NEXT: sub sp, sp, a0
742 ; RV64ZICBOP-NEXT: addi a0, sp, 16
743 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
744 ; RV64ZICBOP-NEXT: lui a0, 1
745 ; RV64ZICBOP-NEXT: addiw a0, a0, 16
746 ; RV64ZICBOP-NEXT: add sp, sp, a0
747 ; RV64ZICBOP-NEXT: ret
749 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_1:
750 ; RV64ZICBOPZIHINTNTL: # %bb.0:
751 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, 1
752 ; RV64ZICBOPZIHINTNTL-NEXT: addiw a0, a0, 16
753 ; RV64ZICBOPZIHINTNTL-NEXT: sub sp, sp, a0
754 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, sp, 16
755 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
756 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
757 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, 1
758 ; RV64ZICBOPZIHINTNTL-NEXT: addiw a0, a0, 16
759 ; RV64ZICBOPZIHINTNTL-NEXT: add sp, sp, a0
760 ; RV64ZICBOPZIHINTNTL-NEXT: ret
761 %data = alloca [1024 x i32], align 4
762 %ptr = bitcast [1024 x i32]* %data to i8*
763 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
767 define void @test_prefetch_frameindex_2() nounwind {
768 ; RV32I-LABEL: test_prefetch_frameindex_2:
770 ; RV32I-NEXT: addi sp, sp, -512
771 ; RV32I-NEXT: addi sp, sp, 512
774 ; RV64I-LABEL: test_prefetch_frameindex_2:
776 ; RV64I-NEXT: addi sp, sp, -512
777 ; RV64I-NEXT: addi sp, sp, 512
780 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_2:
781 ; RV32ZICBOP: # %bb.0:
782 ; RV32ZICBOP-NEXT: addi sp, sp, -512
783 ; RV32ZICBOP-NEXT: addi a0, sp, 16
784 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
785 ; RV32ZICBOP-NEXT: addi sp, sp, 512
786 ; RV32ZICBOP-NEXT: ret
788 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_2:
789 ; RV64ZICBOP: # %bb.0:
790 ; RV64ZICBOP-NEXT: addi sp, sp, -512
791 ; RV64ZICBOP-NEXT: addi a0, sp, 16
792 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
793 ; RV64ZICBOP-NEXT: addi sp, sp, 512
794 ; RV64ZICBOP-NEXT: ret
796 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_2:
797 ; RV64ZICBOPZIHINTNTL: # %bb.0:
798 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
799 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, sp, 16
800 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
801 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
802 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
803 ; RV64ZICBOPZIHINTNTL-NEXT: ret
804 %data = alloca [128 x i32], align 4
805 %base = bitcast [128 x i32]* %data to i8*
806 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 4
807 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
811 define void @test_prefetch_frameindex_3() nounwind {
812 ; RV32I-LABEL: test_prefetch_frameindex_3:
814 ; RV32I-NEXT: addi sp, sp, -512
815 ; RV32I-NEXT: addi sp, sp, 512
818 ; RV64I-LABEL: test_prefetch_frameindex_3:
820 ; RV64I-NEXT: addi sp, sp, -512
821 ; RV64I-NEXT: addi sp, sp, 512
824 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_3:
825 ; RV32ZICBOP: # %bb.0:
826 ; RV32ZICBOP-NEXT: addi sp, sp, -512
827 ; RV32ZICBOP-NEXT: addi a0, sp, -16
828 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
829 ; RV32ZICBOP-NEXT: addi sp, sp, 512
830 ; RV32ZICBOP-NEXT: ret
832 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_3:
833 ; RV64ZICBOP: # %bb.0:
834 ; RV64ZICBOP-NEXT: addi sp, sp, -512
835 ; RV64ZICBOP-NEXT: addi a0, sp, -16
836 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
837 ; RV64ZICBOP-NEXT: addi sp, sp, 512
838 ; RV64ZICBOP-NEXT: ret
840 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_3:
841 ; RV64ZICBOPZIHINTNTL: # %bb.0:
842 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
843 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, sp, -16
844 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
845 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
846 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
847 ; RV64ZICBOPZIHINTNTL-NEXT: ret
848 %data = alloca [128 x i32], align 4
849 %base = bitcast [128 x i32]* %data to i8*
850 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 -4
851 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
855 define void @test_prefetch_frameindex_4() nounwind {
856 ; RV32I-LABEL: test_prefetch_frameindex_4:
858 ; RV32I-NEXT: addi sp, sp, -512
859 ; RV32I-NEXT: addi sp, sp, 512
862 ; RV64I-LABEL: test_prefetch_frameindex_4:
864 ; RV64I-NEXT: addi sp, sp, -512
865 ; RV64I-NEXT: addi sp, sp, 512
868 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_4:
869 ; RV32ZICBOP: # %bb.0:
870 ; RV32ZICBOP-NEXT: addi sp, sp, -512
871 ; RV32ZICBOP-NEXT: prefetch.r 32(sp)
872 ; RV32ZICBOP-NEXT: addi sp, sp, 512
873 ; RV32ZICBOP-NEXT: ret
875 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_4:
876 ; RV64ZICBOP: # %bb.0:
877 ; RV64ZICBOP-NEXT: addi sp, sp, -512
878 ; RV64ZICBOP-NEXT: prefetch.r 32(sp)
879 ; RV64ZICBOP-NEXT: addi sp, sp, 512
880 ; RV64ZICBOP-NEXT: ret
882 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_4:
883 ; RV64ZICBOPZIHINTNTL: # %bb.0:
884 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
885 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
886 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 32(sp)
887 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
888 ; RV64ZICBOPZIHINTNTL-NEXT: ret
889 %data = alloca [128 x i32], align 4
890 %base = bitcast [128 x i32]* %data to i8*
891 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 8
892 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
896 define void @test_prefetch_frameindex_5() nounwind {
897 ; RV32I-LABEL: test_prefetch_frameindex_5:
899 ; RV32I-NEXT: addi sp, sp, -512
900 ; RV32I-NEXT: addi sp, sp, 512
903 ; RV64I-LABEL: test_prefetch_frameindex_5:
905 ; RV64I-NEXT: addi sp, sp, -512
906 ; RV64I-NEXT: addi sp, sp, 512
909 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_5:
910 ; RV32ZICBOP: # %bb.0:
911 ; RV32ZICBOP-NEXT: addi sp, sp, -512
912 ; RV32ZICBOP-NEXT: prefetch.r -32(sp)
913 ; RV32ZICBOP-NEXT: addi sp, sp, 512
914 ; RV32ZICBOP-NEXT: ret
916 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_5:
917 ; RV64ZICBOP: # %bb.0:
918 ; RV64ZICBOP-NEXT: addi sp, sp, -512
919 ; RV64ZICBOP-NEXT: prefetch.r -32(sp)
920 ; RV64ZICBOP-NEXT: addi sp, sp, 512
921 ; RV64ZICBOP-NEXT: ret
923 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_5:
924 ; RV64ZICBOPZIHINTNTL: # %bb.0:
925 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
926 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
927 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -32(sp)
928 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
929 ; RV64ZICBOPZIHINTNTL-NEXT: ret
930 %data = alloca [128 x i32], align 4
931 %base = bitcast [128 x i32]* %data to i8*
932 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 -8
933 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
937 define void @test_prefetch_frameindex_6() nounwind {
938 ; RV32I-LABEL: test_prefetch_frameindex_6:
940 ; RV32I-NEXT: addi sp, sp, -512
941 ; RV32I-NEXT: addi sp, sp, 512
944 ; RV64I-LABEL: test_prefetch_frameindex_6:
946 ; RV64I-NEXT: addi sp, sp, -512
947 ; RV64I-NEXT: addi sp, sp, 512
950 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_6:
951 ; RV32ZICBOP: # %bb.0:
952 ; RV32ZICBOP-NEXT: addi sp, sp, -512
953 ; RV32ZICBOP-NEXT: prefetch.r 2016(sp)
954 ; RV32ZICBOP-NEXT: addi sp, sp, 512
955 ; RV32ZICBOP-NEXT: ret
957 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_6:
958 ; RV64ZICBOP: # %bb.0:
959 ; RV64ZICBOP-NEXT: addi sp, sp, -512
960 ; RV64ZICBOP-NEXT: prefetch.r 2016(sp)
961 ; RV64ZICBOP-NEXT: addi sp, sp, 512
962 ; RV64ZICBOP-NEXT: ret
964 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_6:
965 ; RV64ZICBOPZIHINTNTL: # %bb.0:
966 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
967 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
968 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 2016(sp)
969 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
970 ; RV64ZICBOPZIHINTNTL-NEXT: ret
971 %data = alloca [128 x i32], align 4
972 %base = bitcast [128 x i32]* %data to i8*
973 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 504
974 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
978 define void @test_prefetch_frameindex_7() nounwind {
979 ; RV32I-LABEL: test_prefetch_frameindex_7:
981 ; RV32I-NEXT: addi sp, sp, -512
982 ; RV32I-NEXT: addi sp, sp, 512
985 ; RV64I-LABEL: test_prefetch_frameindex_7:
987 ; RV64I-NEXT: addi sp, sp, -512
988 ; RV64I-NEXT: addi sp, sp, 512
991 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_7:
992 ; RV32ZICBOP: # %bb.0:
993 ; RV32ZICBOP-NEXT: addi sp, sp, -512
994 ; RV32ZICBOP-NEXT: prefetch.r -2048(sp)
995 ; RV32ZICBOP-NEXT: addi sp, sp, 512
996 ; RV32ZICBOP-NEXT: ret
998 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_7:
999 ; RV64ZICBOP: # %bb.0:
1000 ; RV64ZICBOP-NEXT: addi sp, sp, -512
1001 ; RV64ZICBOP-NEXT: prefetch.r -2048(sp)
1002 ; RV64ZICBOP-NEXT: addi sp, sp, 512
1003 ; RV64ZICBOP-NEXT: ret
1005 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_7:
1006 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1007 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
1008 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1009 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -2048(sp)
1010 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
1011 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1012 %data = alloca [128 x i32], align 4
1013 %base = bitcast [128 x i32]* %data to i8*
1014 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 -512
1015 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1019 define void @test_prefetch_frameindex_8() nounwind {
1020 ; RV32I-LABEL: test_prefetch_frameindex_8:
1022 ; RV32I-NEXT: addi sp, sp, -512
1023 ; RV32I-NEXT: addi sp, sp, 512
1026 ; RV64I-LABEL: test_prefetch_frameindex_8:
1028 ; RV64I-NEXT: addi sp, sp, -512
1029 ; RV64I-NEXT: addi sp, sp, 512
1032 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_8:
1033 ; RV32ZICBOP: # %bb.0:
1034 ; RV32ZICBOP-NEXT: addi sp, sp, -512
1035 ; RV32ZICBOP-NEXT: addi a0, sp, 2020
1036 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
1037 ; RV32ZICBOP-NEXT: addi sp, sp, 512
1038 ; RV32ZICBOP-NEXT: ret
1040 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_8:
1041 ; RV64ZICBOP: # %bb.0:
1042 ; RV64ZICBOP-NEXT: addi sp, sp, -512
1043 ; RV64ZICBOP-NEXT: addi a0, sp, 2020
1044 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
1045 ; RV64ZICBOP-NEXT: addi sp, sp, 512
1046 ; RV64ZICBOP-NEXT: ret
1048 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_8:
1049 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1050 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
1051 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, sp, 2020
1052 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1053 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
1054 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
1055 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1056 %data = alloca [128 x i32], align 4
1057 %base = bitcast [128 x i32]* %data to i8*
1058 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 505
1059 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1063 define void @test_prefetch_frameindex_9() nounwind {
1064 ; RV32I-LABEL: test_prefetch_frameindex_9:
1066 ; RV32I-NEXT: addi sp, sp, -512
1067 ; RV32I-NEXT: addi sp, sp, 512
1070 ; RV64I-LABEL: test_prefetch_frameindex_9:
1072 ; RV64I-NEXT: addi sp, sp, -512
1073 ; RV64I-NEXT: addi sp, sp, 512
1076 ; RV32ZICBOP-LABEL: test_prefetch_frameindex_9:
1077 ; RV32ZICBOP: # %bb.0:
1078 ; RV32ZICBOP-NEXT: addi sp, sp, -512
1079 ; RV32ZICBOP-NEXT: mv a0, sp
1080 ; RV32ZICBOP-NEXT: addi a0, a0, -4
1081 ; RV32ZICBOP-NEXT: prefetch.r -2048(a0)
1082 ; RV32ZICBOP-NEXT: addi sp, sp, 512
1083 ; RV32ZICBOP-NEXT: ret
1085 ; RV64ZICBOP-LABEL: test_prefetch_frameindex_9:
1086 ; RV64ZICBOP: # %bb.0:
1087 ; RV64ZICBOP-NEXT: addi sp, sp, -512
1088 ; RV64ZICBOP-NEXT: mv a0, sp
1089 ; RV64ZICBOP-NEXT: addi a0, a0, -4
1090 ; RV64ZICBOP-NEXT: prefetch.r -2048(a0)
1091 ; RV64ZICBOP-NEXT: addi sp, sp, 512
1092 ; RV64ZICBOP-NEXT: ret
1094 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_frameindex_9:
1095 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1096 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, -512
1097 ; RV64ZICBOPZIHINTNTL-NEXT: mv a0, sp
1098 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, -4
1099 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1100 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -2048(a0)
1101 ; RV64ZICBOPZIHINTNTL-NEXT: addi sp, sp, 512
1102 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1103 %data = alloca [128 x i32], align 4
1104 %base = bitcast [128 x i32]* %data to i8*
1105 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 -513
1106 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1110 define void @test_prefetch_constant_address_0() nounwind {
1111 ; RV32I-LABEL: test_prefetch_constant_address_0:
1115 ; RV64I-LABEL: test_prefetch_constant_address_0:
1119 ; RV32ZICBOP-LABEL: test_prefetch_constant_address_0:
1120 ; RV32ZICBOP: # %bb.0:
1121 ; RV32ZICBOP-NEXT: lui a0, 1
1122 ; RV32ZICBOP-NEXT: prefetch.r 32(a0)
1123 ; RV32ZICBOP-NEXT: ret
1125 ; RV64ZICBOP-LABEL: test_prefetch_constant_address_0:
1126 ; RV64ZICBOP: # %bb.0:
1127 ; RV64ZICBOP-NEXT: lui a0, 1
1128 ; RV64ZICBOP-NEXT: prefetch.r 32(a0)
1129 ; RV64ZICBOP-NEXT: ret
1131 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_constant_address_0:
1132 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1133 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, 1
1134 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1135 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 32(a0)
1136 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1137 %ptr = inttoptr i64 4128 to i8*
1138 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1142 define void @test_prefetch_constant_address_1() nounwind {
1143 ; RV32I-LABEL: test_prefetch_constant_address_1:
1147 ; RV64I-LABEL: test_prefetch_constant_address_1:
1151 ; RV32ZICBOP-LABEL: test_prefetch_constant_address_1:
1152 ; RV32ZICBOP: # %bb.0:
1153 ; RV32ZICBOP-NEXT: lui a0, 1
1154 ; RV32ZICBOP-NEXT: addi a0, a0, 31
1155 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
1156 ; RV32ZICBOP-NEXT: ret
1158 ; RV64ZICBOP-LABEL: test_prefetch_constant_address_1:
1159 ; RV64ZICBOP: # %bb.0:
1160 ; RV64ZICBOP-NEXT: lui a0, 1
1161 ; RV64ZICBOP-NEXT: addiw a0, a0, 31
1162 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
1163 ; RV64ZICBOP-NEXT: ret
1165 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_constant_address_1:
1166 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1167 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, 1
1168 ; RV64ZICBOPZIHINTNTL-NEXT: addiw a0, a0, 31
1169 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1170 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
1171 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1172 %ptr = inttoptr i64 4127 to i8*
1173 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1177 define void @test_prefetch_constant_address_2() nounwind {
1178 ; RV32I-LABEL: test_prefetch_constant_address_2:
1182 ; RV64I-LABEL: test_prefetch_constant_address_2:
1186 ; RV32ZICBOP-LABEL: test_prefetch_constant_address_2:
1187 ; RV32ZICBOP: # %bb.0:
1188 ; RV32ZICBOP-NEXT: lui a0, 1048561
1189 ; RV32ZICBOP-NEXT: prefetch.r 32(a0)
1190 ; RV32ZICBOP-NEXT: ret
1192 ; RV64ZICBOP-LABEL: test_prefetch_constant_address_2:
1193 ; RV64ZICBOP: # %bb.0:
1194 ; RV64ZICBOP-NEXT: lui a0, 1048561
1195 ; RV64ZICBOP-NEXT: prefetch.r 32(a0)
1196 ; RV64ZICBOP-NEXT: ret
1198 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_constant_address_2:
1199 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1200 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, 1048561
1201 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1202 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 32(a0)
1203 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1204 %ptr = inttoptr i64 18446744073709490208 to i8*
1205 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1209 define void @test_prefetch_constant_address_3() nounwind {
1210 ; RV32I-LABEL: test_prefetch_constant_address_3:
1214 ; RV64I-LABEL: test_prefetch_constant_address_3:
1218 ; RV32ZICBOP-LABEL: test_prefetch_constant_address_3:
1219 ; RV32ZICBOP: # %bb.0:
1220 ; RV32ZICBOP-NEXT: lui a0, 1048561
1221 ; RV32ZICBOP-NEXT: addi a0, a0, 31
1222 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
1223 ; RV32ZICBOP-NEXT: ret
1225 ; RV64ZICBOP-LABEL: test_prefetch_constant_address_3:
1226 ; RV64ZICBOP: # %bb.0:
1227 ; RV64ZICBOP-NEXT: lui a0, 1048561
1228 ; RV64ZICBOP-NEXT: addiw a0, a0, 31
1229 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
1230 ; RV64ZICBOP-NEXT: ret
1232 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_constant_address_3:
1233 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1234 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, 1048561
1235 ; RV64ZICBOPZIHINTNTL-NEXT: addiw a0, a0, 31
1236 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1237 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
1238 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1239 %ptr = inttoptr i64 18446744073709490207 to i8*
1240 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1244 @g = external global [1024 x i32], align 4
1246 define void @test_prefetch_global_0() nounwind {
1247 ; RV32I-LABEL: test_prefetch_global_0:
1251 ; RV64I-LABEL: test_prefetch_global_0:
1255 ; RV32ZICBOP-LABEL: test_prefetch_global_0:
1256 ; RV32ZICBOP: # %bb.0:
1257 ; RV32ZICBOP-NEXT: lui a0, %hi(g)
1258 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g)
1259 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
1260 ; RV32ZICBOP-NEXT: ret
1262 ; RV64ZICBOP-LABEL: test_prefetch_global_0:
1263 ; RV64ZICBOP: # %bb.0:
1264 ; RV64ZICBOP-NEXT: lui a0, %hi(g)
1265 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g)
1266 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
1267 ; RV64ZICBOP-NEXT: ret
1269 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_0:
1270 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1271 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g)
1272 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g)
1273 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1274 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
1275 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1276 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 0
1277 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1281 define void @test_prefetch_global_1() nounwind {
1282 ; RV32I-LABEL: test_prefetch_global_1:
1286 ; RV64I-LABEL: test_prefetch_global_1:
1290 ; RV32ZICBOP-LABEL: test_prefetch_global_1:
1291 ; RV32ZICBOP: # %bb.0:
1292 ; RV32ZICBOP-NEXT: lui a0, %hi(g+16)
1293 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g+16)
1294 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
1295 ; RV32ZICBOP-NEXT: ret
1297 ; RV64ZICBOP-LABEL: test_prefetch_global_1:
1298 ; RV64ZICBOP: # %bb.0:
1299 ; RV64ZICBOP-NEXT: lui a0, %hi(g+16)
1300 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g+16)
1301 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
1302 ; RV64ZICBOP-NEXT: ret
1304 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_1:
1305 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1306 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g+16)
1307 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g+16)
1308 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1309 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
1310 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1311 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 4
1312 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1316 define void @test_prefetch_global_2() nounwind {
1317 ; RV32I-LABEL: test_prefetch_global_2:
1321 ; RV64I-LABEL: test_prefetch_global_2:
1325 ; RV32ZICBOP-LABEL: test_prefetch_global_2:
1326 ; RV32ZICBOP: # %bb.0:
1327 ; RV32ZICBOP-NEXT: lui a0, %hi(g-16)
1328 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g-16)
1329 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
1330 ; RV32ZICBOP-NEXT: ret
1332 ; RV64ZICBOP-LABEL: test_prefetch_global_2:
1333 ; RV64ZICBOP: # %bb.0:
1334 ; RV64ZICBOP-NEXT: lui a0, %hi(g-16)
1335 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g-16)
1336 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
1337 ; RV64ZICBOP-NEXT: ret
1339 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_2:
1340 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1341 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g-16)
1342 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g-16)
1343 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1344 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
1345 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1346 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 -4
1347 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1351 define void @test_prefetch_global_3() nounwind {
1352 ; RV32I-LABEL: test_prefetch_global_3:
1356 ; RV64I-LABEL: test_prefetch_global_3:
1360 ; RV32ZICBOP-LABEL: test_prefetch_global_3:
1361 ; RV32ZICBOP: # %bb.0:
1362 ; RV32ZICBOP-NEXT: lui a0, %hi(g)
1363 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g)
1364 ; RV32ZICBOP-NEXT: prefetch.r 32(a0)
1365 ; RV32ZICBOP-NEXT: ret
1367 ; RV64ZICBOP-LABEL: test_prefetch_global_3:
1368 ; RV64ZICBOP: # %bb.0:
1369 ; RV64ZICBOP-NEXT: lui a0, %hi(g)
1370 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g)
1371 ; RV64ZICBOP-NEXT: prefetch.r 32(a0)
1372 ; RV64ZICBOP-NEXT: ret
1374 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_3:
1375 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1376 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g)
1377 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g)
1378 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1379 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 32(a0)
1380 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1381 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 8
1382 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1386 define void @test_prefetch_global_4() nounwind {
1387 ; RV32I-LABEL: test_prefetch_global_4:
1391 ; RV64I-LABEL: test_prefetch_global_4:
1395 ; RV32ZICBOP-LABEL: test_prefetch_global_4:
1396 ; RV32ZICBOP: # %bb.0:
1397 ; RV32ZICBOP-NEXT: lui a0, %hi(g)
1398 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g)
1399 ; RV32ZICBOP-NEXT: prefetch.r -32(a0)
1400 ; RV32ZICBOP-NEXT: ret
1402 ; RV64ZICBOP-LABEL: test_prefetch_global_4:
1403 ; RV64ZICBOP: # %bb.0:
1404 ; RV64ZICBOP-NEXT: lui a0, %hi(g)
1405 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g)
1406 ; RV64ZICBOP-NEXT: prefetch.r -32(a0)
1407 ; RV64ZICBOP-NEXT: ret
1409 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_4:
1410 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1411 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g)
1412 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g)
1413 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1414 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -32(a0)
1415 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1416 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 -8
1417 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1421 define void @test_prefetch_global_5() nounwind {
1422 ; RV32I-LABEL: test_prefetch_global_5:
1426 ; RV64I-LABEL: test_prefetch_global_5:
1430 ; RV32ZICBOP-LABEL: test_prefetch_global_5:
1431 ; RV32ZICBOP: # %bb.0:
1432 ; RV32ZICBOP-NEXT: lui a0, %hi(g)
1433 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g)
1434 ; RV32ZICBOP-NEXT: prefetch.r 2016(a0)
1435 ; RV32ZICBOP-NEXT: ret
1437 ; RV64ZICBOP-LABEL: test_prefetch_global_5:
1438 ; RV64ZICBOP: # %bb.0:
1439 ; RV64ZICBOP-NEXT: lui a0, %hi(g)
1440 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g)
1441 ; RV64ZICBOP-NEXT: prefetch.r 2016(a0)
1442 ; RV64ZICBOP-NEXT: ret
1444 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_5:
1445 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1446 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g)
1447 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g)
1448 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1449 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 2016(a0)
1450 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1451 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 504
1452 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1456 define void @test_prefetch_global_6() nounwind {
1457 ; RV32I-LABEL: test_prefetch_global_6:
1461 ; RV64I-LABEL: test_prefetch_global_6:
1465 ; RV32ZICBOP-LABEL: test_prefetch_global_6:
1466 ; RV32ZICBOP: # %bb.0:
1467 ; RV32ZICBOP-NEXT: lui a0, %hi(g)
1468 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g)
1469 ; RV32ZICBOP-NEXT: prefetch.r -2048(a0)
1470 ; RV32ZICBOP-NEXT: ret
1472 ; RV64ZICBOP-LABEL: test_prefetch_global_6:
1473 ; RV64ZICBOP: # %bb.0:
1474 ; RV64ZICBOP-NEXT: lui a0, %hi(g)
1475 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g)
1476 ; RV64ZICBOP-NEXT: prefetch.r -2048(a0)
1477 ; RV64ZICBOP-NEXT: ret
1479 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_6:
1480 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1481 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g)
1482 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g)
1483 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1484 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -2048(a0)
1485 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1486 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 -512
1487 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1491 define void @test_prefetch_global_7() nounwind {
1492 ; RV32I-LABEL: test_prefetch_global_7:
1496 ; RV64I-LABEL: test_prefetch_global_7:
1500 ; RV32ZICBOP-LABEL: test_prefetch_global_7:
1501 ; RV32ZICBOP: # %bb.0:
1502 ; RV32ZICBOP-NEXT: lui a0, %hi(g+2020)
1503 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g+2020)
1504 ; RV32ZICBOP-NEXT: prefetch.r 0(a0)
1505 ; RV32ZICBOP-NEXT: ret
1507 ; RV64ZICBOP-LABEL: test_prefetch_global_7:
1508 ; RV64ZICBOP: # %bb.0:
1509 ; RV64ZICBOP-NEXT: lui a0, %hi(g+2020)
1510 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g+2020)
1511 ; RV64ZICBOP-NEXT: prefetch.r 0(a0)
1512 ; RV64ZICBOP-NEXT: ret
1514 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_7:
1515 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1516 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g+2020)
1517 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g+2020)
1518 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1519 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r 0(a0)
1520 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1521 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 505
1522 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)
1526 define void @test_prefetch_global_8() nounwind {
1527 ; RV32I-LABEL: test_prefetch_global_8:
1531 ; RV64I-LABEL: test_prefetch_global_8:
1535 ; RV32ZICBOP-LABEL: test_prefetch_global_8:
1536 ; RV32ZICBOP: # %bb.0:
1537 ; RV32ZICBOP-NEXT: lui a0, %hi(g-4)
1538 ; RV32ZICBOP-NEXT: addi a0, a0, %lo(g-4)
1539 ; RV32ZICBOP-NEXT: prefetch.r -2048(a0)
1540 ; RV32ZICBOP-NEXT: ret
1542 ; RV64ZICBOP-LABEL: test_prefetch_global_8:
1543 ; RV64ZICBOP: # %bb.0:
1544 ; RV64ZICBOP-NEXT: lui a0, %hi(g-4)
1545 ; RV64ZICBOP-NEXT: addi a0, a0, %lo(g-4)
1546 ; RV64ZICBOP-NEXT: prefetch.r -2048(a0)
1547 ; RV64ZICBOP-NEXT: ret
1549 ; RV64ZICBOPZIHINTNTL-LABEL: test_prefetch_global_8:
1550 ; RV64ZICBOPZIHINTNTL: # %bb.0:
1551 ; RV64ZICBOPZIHINTNTL-NEXT: lui a0, %hi(g-4)
1552 ; RV64ZICBOPZIHINTNTL-NEXT: addi a0, a0, %lo(g-4)
1553 ; RV64ZICBOPZIHINTNTL-NEXT: ntl.all
1554 ; RV64ZICBOPZIHINTNTL-NEXT: prefetch.r -2048(a0)
1555 ; RV64ZICBOPZIHINTNTL-NEXT: ret
1556 %ptr = getelementptr [1024 x i32], ptr @g, i32 0, i32 -513
1557 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)