1 ; RUN: llc -mtriple=aarch64 -mattr=+v8.9a --global-isel=0 < %s | FileCheck %s
2 ; RUN: llc -mtriple=aarch64 -mattr=+v8.9a --global-isel=1 --global-isel-abort=1 < %s | FileCheck %s
4 @a = internal global ptr null, align 8
5 @b = external global ptr, align 8
7 define void @test(ptr %i, i32 %j) nounwind ssp {
10 %j.addr = alloca i32, align 4
11 store i32 %j, ptr %j.addr, align 4, !tbaa !0
12 %tmp = bitcast ptr %j.addr to ptr
14 %i.next = getelementptr i8, ptr %i, i64 2
16 ; Verify prefetching works for all the different kinds of pointers we might
19 ; CHECK: prfm pldl1keep,
20 call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 0, i32 0, i32 1)
22 ; CHECK: prfum pldl1keep,
23 call void @llvm.aarch64.prefetch(ptr %tmp, i32 0, i32 0, i32 0, i32 1)
25 ; CHECK: prfm pldl1keep,
26 call void @llvm.aarch64.prefetch(ptr %i, i32 0, i32 0, i32 0, i32 1)
28 ; CHECK: prfum pldl1keep,
29 call void @llvm.aarch64.prefetch(ptr %i.next, i32 0, i32 0, i32 0, i32 1)
31 ; CHECK: prfm pldl1keep,
32 call void @llvm.aarch64.prefetch(ptr @a, i32 0, i32 0, i32 0, i32 1)
34 ; CHECK: prfm pldl1keep,
35 call void @llvm.aarch64.prefetch(ptr @b, i32 0, i32 0, i32 0, i32 1)
37 ; Verify that we can generate every single valid prefetch value.
39 ; CHECK: prfm pstl1keep,
40 call void @llvm.aarch64.prefetch(ptr null, i32 1, i32 0, i32 0, i32 1)
42 ; CHECK: prfm pldl2keep,
43 call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 1, i32 0, i32 1)
45 ; CHECK: prfm pldl3keep,
46 call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 2, i32 0, i32 1)
48 ; CHECK: prfm pldslckeep,
49 call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 3, i32 0, i32 1)
51 ; CHECK: prfm pldl1strm,
52 call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 0, i32 1, i32 1)
54 ; CHECK: prfm plil1keep,
55 call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 0, i32 0, i32 0)
60 declare void @llvm.aarch64.prefetch(ptr readonly, i32 immarg, i32 immarg, i32 immarg, i32 immarg) #0
62 attributes #0 = { inaccessiblemem_or_argmemonly nounwind willreturn }
65 !1 = !{!"omnipotent char", !2}
66 !2 = !{!"Simple C/C++ TBAA"}
67 !3 = !{!"any pointer", !1}