brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.3 KiB · 01971c9 Raw
164 lines · plain
1target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"2target triple = "aarch64-unknown-linux"3 4attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }5 6define dso_local void @Write1(ptr %p) #0 {7entry:8  store i8 0, ptr %p, align 19  ret void10}11 12define dso_local void @Write4(ptr %p) #0 {13entry:14  store i32 0, ptr %p, align 115  ret void16}17 18define dso_local void @Write4_2(ptr %p, ptr %q) #0 {19entry:20  store i32 0, ptr %p, align 121  store i32 0, ptr %q, align 122  ret void23}24 25define dso_local void @Write8(ptr %p) #0 {26entry:27  store i64 0, ptr %p, align 128  ret void29}30 31define dso_local ptr @WriteAndReturn8(ptr %p) #0 {32entry:33  store i8 0, ptr %p, align 134  ret ptr %p35}36 37declare dso_local void @ExternalCall(ptr %p)38 39define dso_preemptable void @PreemptableWrite1(ptr %p) #0 {40entry:41  store i8 0, ptr %p, align 142  ret void43}44 45define linkonce dso_local void @InterposableWrite1(ptr %p) #0 {46entry:47  store i8 0, ptr %p, align 148  ret void49}50 51define dso_local ptr @ReturnDependent(ptr %p) #0 {52entry:53  %p2 = getelementptr i8, ptr %p, i64 254  ret ptr %p255}56 57; access range [2, 6)58define dso_local void @Rec0(ptr %p) #0 {59entry:60  %p1 = getelementptr i8, ptr %p, i64 261  call void @Write4(ptr %p1)62  ret void63}64 65; access range [3, 7)66define dso_local void @Rec1(ptr %p) #0 {67entry:68  %p1 = getelementptr i8, ptr %p, i64 169  call void @Rec0(ptr %p1)70  ret void71}72 73; access range [-2, 2)74define dso_local void @Rec2(ptr %p) #0 {75entry:76  %p1 = getelementptr i8, ptr %p, i64 -577  call void @Rec1(ptr %p1)78  ret void79}80 81; Recursive function that passes %acc unchanged => access range [0, 4).82define dso_local void @RecursiveNoOffset(ptr %p, i32 %size, ptr %acc) {83entry:84  %cmp = icmp eq i32 %size, 085  br i1 %cmp, label %return, label %if.end86 87if.end:88  %load0 = load i32, ptr %p, align 489  %load1 = load i32, ptr %acc, align 490  %add = add nsw i32 %load1, %load091  store i32 %add, ptr %acc, align 492  %add.ptr = getelementptr inbounds i32, ptr %p, i64 193  %sub = add nsw i32 %size, -194  tail call void @RecursiveNoOffset(ptr %add.ptr, i32 %sub, ptr %acc)95  ret void96 97return:98  ret void99}100 101; Recursive function that advances %acc on each iteration => access range unlimited.102define dso_local void @RecursiveWithOffset(i32 %size, ptr %acc) {103entry:104  %cmp = icmp eq i32 %size, 0105  br i1 %cmp, label %return, label %if.end106 107if.end:108  store i32 0, ptr %acc, align 4109  %acc2 = getelementptr inbounds i32, ptr %acc, i64 1110  %sub = add nsw i32 %size, -1111  tail call void @RecursiveWithOffset(i32 %sub, ptr %acc2)112  ret void113 114return:115  ret void116}117 118define dso_local ptr @ReturnAlloca() {119entry:120  %x = alloca i64, align 4121  ret ptr %x122}123 124define dso_local void @Write1Private(ptr %p) #0 {125entry:126  call void @Private(ptr %p)127  ret void128}129 130define dso_local void @Write1SameModule(ptr %p) #0 {131entry:132  call void @Write1(ptr %p)133  ret void134}135 136declare void @Write1Module0(ptr %p)137 138define dso_local void @Write1DiffModule(ptr %p) #0 {139entry:140  call void @Write1Module0(ptr %p)141  ret void142}143 144define private dso_local void @Private(ptr %p) #0 {145entry:146  %p1 = getelementptr i8, ptr %p, i64 -1147  store i8 0, ptr %p1, align 1148  ret void149}150 151define dso_local void @Write1Weak(ptr %p) #0 {152entry:153  call void @Weak(ptr %p)154  ret void155}156 157define weak dso_local void @Weak(ptr %p) #0 {158entry:159  %p1 = getelementptr i8, ptr %p, i64 -1160  store i8 0, ptr %p1, align 1161  ret void162}163 164