|
| 1 | +; ModuleID = 'zeromap.go' |
| 2 | +source_filename = "zeromap.go" |
| 3 | +target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" |
| 4 | +target triple = "wasm32-unknown-wasi" |
| 5 | + |
| 6 | +%main.hasPadding = type { i1, i32, i1 } |
| 7 | + |
| 8 | +declare noalias nonnull ptr @runtime.alloc(i32, ptr, ptr) #0 |
| 9 | + |
| 10 | +declare void @runtime.trackPointer(ptr nocapture readonly, ptr, ptr) #0 |
| 11 | + |
| 12 | +; Function Attrs: nounwind |
| 13 | +define hidden void @main.init(ptr %context) unnamed_addr #1 { |
| 14 | +entry: |
| 15 | + ret void |
| 16 | +} |
| 17 | + |
| 18 | +; Function Attrs: nounwind |
| 19 | +define hidden void @main.main(ptr %context) unnamed_addr #1 { |
| 20 | +entry: |
| 21 | + %hashmap.key6 = alloca %main.hasPadding, align 8 |
| 22 | + %hashmap.value5 = alloca i32, align 4 |
| 23 | + %hashmap.key = alloca %main.hasPadding, align 8 |
| 24 | + %hashmap.value = alloca i32, align 4 |
| 25 | + %s = alloca %main.hasPadding, align 8 |
| 26 | + %stackalloc = alloca i8, align 1 |
| 27 | + %0 = call ptr @runtime.hashmapMake(i32 12, i32 4, i32 8, i8 0, ptr undef) #3 |
| 28 | + call void @runtime.trackPointer(ptr %0, ptr nonnull %stackalloc, ptr undef) #3 |
| 29 | + store %main.hasPadding zeroinitializer, ptr %s, align 8 |
| 30 | + call void @runtime.trackPointer(ptr nonnull %s, ptr nonnull %stackalloc, ptr undef) #3 |
| 31 | + br label %for.loop |
| 32 | + |
| 33 | +for.loop: ; preds = %store.next4, %entry |
| 34 | + %1 = phi i32 [ 0, %entry ], [ %17, %store.next4 ] |
| 35 | + %2 = icmp slt i32 %1, 10 |
| 36 | + br i1 %2, label %for.body, label %for.done |
| 37 | + |
| 38 | +for.body: ; preds = %for.loop |
| 39 | + br i1 false, label %store.throw, label %store.next |
| 40 | + |
| 41 | +store.next: ; preds = %for.body |
| 42 | + %3 = and i32 %1, 1 |
| 43 | + %4 = icmp eq i32 %3, 0 |
| 44 | + store i1 %4, ptr %s, align 8 |
| 45 | + br i1 false, label %store.throw1, label %store.next2 |
| 46 | + |
| 47 | +store.next2: ; preds = %store.next |
| 48 | + %5 = getelementptr inbounds %main.hasPadding, ptr %s, i32 0, i32 1 |
| 49 | + store i32 %1, ptr %5, align 4 |
| 50 | + br i1 false, label %store.throw3, label %store.next4 |
| 51 | + |
| 52 | +store.next4: ; preds = %store.next2 |
| 53 | + %6 = getelementptr inbounds %main.hasPadding, ptr %s, i32 0, i32 2 |
| 54 | + %7 = and i32 %1, 1 |
| 55 | + %8 = icmp ne i32 %7, 0 |
| 56 | + store i1 %8, ptr %6, align 8 |
| 57 | + %9 = load %main.hasPadding, ptr %s, align 8 |
| 58 | + call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hashmap.value) |
| 59 | + call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %hashmap.key) |
| 60 | + store %main.hasPadding %9, ptr %hashmap.key, align 8 |
| 61 | + %10 = getelementptr inbounds i8, ptr %hashmap.key, i32 1 |
| 62 | + call void @runtime.memzero(ptr nonnull %10, i32 3, ptr undef) #3 |
| 63 | + %11 = getelementptr inbounds i8, ptr %hashmap.key, i32 9 |
| 64 | + call void @runtime.memzero(ptr nonnull %11, i32 3, ptr undef) #3 |
| 65 | + %12 = call i1 @runtime.hashmapBinaryGet(ptr %0, ptr nonnull %hashmap.key, ptr nonnull %hashmap.value, i32 4, ptr undef) #3 |
| 66 | + call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %hashmap.key) |
| 67 | + %13 = load i32, ptr %hashmap.value, align 4 |
| 68 | + call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hashmap.value) |
| 69 | + %14 = add i32 %13, 1 |
| 70 | + call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hashmap.value5) |
| 71 | + store i32 %14, ptr %hashmap.value5, align 4 |
| 72 | + call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %hashmap.key6) |
| 73 | + store %main.hasPadding %9, ptr %hashmap.key6, align 8 |
| 74 | + %15 = getelementptr inbounds i8, ptr %hashmap.key6, i32 1 |
| 75 | + call void @runtime.memzero(ptr nonnull %15, i32 3, ptr undef) #3 |
| 76 | + %16 = getelementptr inbounds i8, ptr %hashmap.key6, i32 9 |
| 77 | + call void @runtime.memzero(ptr nonnull %16, i32 3, ptr undef) #3 |
| 78 | + call void @runtime.hashmapBinarySet(ptr %0, ptr nonnull %hashmap.key6, ptr nonnull %hashmap.value5, ptr undef) #3 |
| 79 | + call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %hashmap.key6) |
| 80 | + call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hashmap.value5) |
| 81 | + %17 = add i32 %1, 1 |
| 82 | + br label %for.loop |
| 83 | + |
| 84 | +for.done: ; preds = %for.loop |
| 85 | + %len = call i32 @runtime.hashmapLen(ptr %0, ptr undef) #3 |
| 86 | + call void @runtime.printint32(i32 %len, ptr undef) #3 |
| 87 | + call void @runtime.printnl(ptr undef) #3 |
| 88 | + ret void |
| 89 | + |
| 90 | +store.throw: ; preds = %for.body |
| 91 | + unreachable |
| 92 | + |
| 93 | +store.throw1: ; preds = %store.next |
| 94 | + unreachable |
| 95 | + |
| 96 | +store.throw3: ; preds = %store.next2 |
| 97 | + unreachable |
| 98 | +} |
| 99 | + |
| 100 | +declare ptr @runtime.hashmapMake(i32, i32, i32, i8, ptr) #0 |
| 101 | + |
| 102 | +declare void @runtime.nilPanic(ptr) #0 |
| 103 | + |
| 104 | +; Function Attrs: argmemonly nocallback nofree nosync nounwind willreturn |
| 105 | +declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 |
| 106 | + |
| 107 | +declare void @runtime.memzero(ptr, i32, ptr) #0 |
| 108 | + |
| 109 | +declare i1 @runtime.hashmapBinaryGet(ptr dereferenceable_or_null(40), ptr, ptr, i32, ptr) #0 |
| 110 | + |
| 111 | +; Function Attrs: argmemonly nocallback nofree nosync nounwind willreturn |
| 112 | +declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 |
| 113 | + |
| 114 | +declare void @runtime.hashmapBinarySet(ptr dereferenceable_or_null(40), ptr, ptr, ptr) #0 |
| 115 | + |
| 116 | +declare i32 @runtime.hashmapLen(ptr dereferenceable_or_null(40), ptr) #0 |
| 117 | + |
| 118 | +declare void @runtime.printint32(i32, ptr) #0 |
| 119 | + |
| 120 | +declare void @runtime.printnl(ptr) #0 |
| 121 | + |
| 122 | +attributes #0 = { "target-features"="+bulk-memory,+nontrapping-fptoint,+sign-ext" } |
| 123 | +attributes #1 = { nounwind "target-features"="+bulk-memory,+nontrapping-fptoint,+sign-ext" } |
| 124 | +attributes #2 = { argmemonly nocallback nofree nosync nounwind willreturn } |
| 125 | +attributes #3 = { nounwind } |
0 commit comments