@@ -3,7 +3,7 @@ source_filename = "channel.go"
33target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"
44target triple = "wasm32-unknown-wasi"
55
6- %runtime.channelBlockedList = type { ptr , ptr , ptr , { ptr , i32 , i32 } }
6+ %runtime.channelOp = type { ptr , ptr , i32 , ptr }
77%runtime.chanSelectState = type { ptr , ptr }
88
99; Function Attrs: allockind("alloc,zeroed") allocsize(0)
@@ -18,64 +18,64 @@ entry:
1818}
1919
2020; Function Attrs: nounwind
21- define hidden void @main.chanIntSend (ptr dereferenceable_or_null (32 ) %ch , ptr %context ) unnamed_addr #2 {
21+ define hidden void @main.chanIntSend (ptr dereferenceable_or_null (36 ) %ch , ptr %context ) unnamed_addr #2 {
2222entry:
23- %chan.blockedList = alloca %runtime.channelBlockedList , align 8
23+ %chan.op = alloca %runtime.channelOp , align 8
2424 %chan.value = alloca i32 , align 4
2525 call void @llvm.lifetime.start.p0 (i64 4 , ptr nonnull %chan.value )
2626 store i32 3 , ptr %chan.value , align 4
27- call void @llvm.lifetime.start.p0 (i64 24 , ptr nonnull %chan.blockedList )
28- call void @runtime.chanSend (ptr %ch , ptr nonnull %chan.value , ptr nonnull %chan.blockedList , ptr undef ) #4
29- call void @llvm.lifetime.end.p0 (i64 24 , ptr nonnull %chan.blockedList )
27+ call void @llvm.lifetime.start.p0 (i64 16 , ptr nonnull %chan.op )
28+ call void @runtime.chanSend (ptr %ch , ptr nonnull %chan.value , ptr nonnull %chan.op , ptr undef ) #4
29+ call void @llvm.lifetime.end.p0 (i64 16 , ptr nonnull %chan.op )
3030 call void @llvm.lifetime.end.p0 (i64 4 , ptr nonnull %chan.value )
3131 ret void
3232}
3333
3434; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
3535declare void @llvm.lifetime.start.p0 (i64 immarg, ptr nocapture ) #3
3636
37- declare void @runtime.chanSend (ptr dereferenceable_or_null (32 ), ptr , ptr dereferenceable_or_null (24 ), ptr ) #1
37+ declare void @runtime.chanSend (ptr dereferenceable_or_null (36 ), ptr , ptr dereferenceable_or_null (16 ), ptr ) #1
3838
3939; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
4040declare void @llvm.lifetime.end.p0 (i64 immarg, ptr nocapture ) #3
4141
4242; Function Attrs: nounwind
43- define hidden void @main.chanIntRecv (ptr dereferenceable_or_null (32 ) %ch , ptr %context ) unnamed_addr #2 {
43+ define hidden void @main.chanIntRecv (ptr dereferenceable_or_null (36 ) %ch , ptr %context ) unnamed_addr #2 {
4444entry:
45- %chan.blockedList = alloca %runtime.channelBlockedList , align 8
45+ %chan.op = alloca %runtime.channelOp , align 8
4646 %chan.value = alloca i32 , align 4
4747 call void @llvm.lifetime.start.p0 (i64 4 , ptr nonnull %chan.value )
48- call void @llvm.lifetime.start.p0 (i64 24 , ptr nonnull %chan.blockedList )
49- %0 = call i1 @runtime.chanRecv (ptr %ch , ptr nonnull %chan.value , ptr nonnull %chan.blockedList , ptr undef ) #4
48+ call void @llvm.lifetime.start.p0 (i64 16 , ptr nonnull %chan.op )
49+ %0 = call i1 @runtime.chanRecv (ptr %ch , ptr nonnull %chan.value , ptr nonnull %chan.op , ptr undef ) #4
5050 call void @llvm.lifetime.end.p0 (i64 4 , ptr nonnull %chan.value )
51- call void @llvm.lifetime.end.p0 (i64 24 , ptr nonnull %chan.blockedList )
51+ call void @llvm.lifetime.end.p0 (i64 16 , ptr nonnull %chan.op )
5252 ret void
5353}
5454
55- declare i1 @runtime.chanRecv (ptr dereferenceable_or_null (32 ), ptr , ptr dereferenceable_or_null (24 ), ptr ) #1
55+ declare i1 @runtime.chanRecv (ptr dereferenceable_or_null (36 ), ptr , ptr dereferenceable_or_null (16 ), ptr ) #1
5656
5757; Function Attrs: nounwind
58- define hidden void @main.chanZeroSend (ptr dereferenceable_or_null (32 ) %ch , ptr %context ) unnamed_addr #2 {
58+ define hidden void @main.chanZeroSend (ptr dereferenceable_or_null (36 ) %ch , ptr %context ) unnamed_addr #2 {
5959entry:
60- %chan.blockedList = alloca %runtime.channelBlockedList , align 8
61- call void @llvm.lifetime.start.p0 (i64 24 , ptr nonnull %chan.blockedList )
62- call void @runtime.chanSend (ptr %ch , ptr null , ptr nonnull %chan.blockedList , ptr undef ) #4
63- call void @llvm.lifetime.end.p0 (i64 24 , ptr nonnull %chan.blockedList )
60+ %chan.op = alloca %runtime.channelOp , align 8
61+ call void @llvm.lifetime.start.p0 (i64 16 , ptr nonnull %chan.op )
62+ call void @runtime.chanSend (ptr %ch , ptr null , ptr nonnull %chan.op , ptr undef ) #4
63+ call void @llvm.lifetime.end.p0 (i64 16 , ptr nonnull %chan.op )
6464 ret void
6565}
6666
6767; Function Attrs: nounwind
68- define hidden void @main.chanZeroRecv (ptr dereferenceable_or_null (32 ) %ch , ptr %context ) unnamed_addr #2 {
68+ define hidden void @main.chanZeroRecv (ptr dereferenceable_or_null (36 ) %ch , ptr %context ) unnamed_addr #2 {
6969entry:
70- %chan.blockedList = alloca %runtime.channelBlockedList , align 8
71- call void @llvm.lifetime.start.p0 (i64 24 , ptr nonnull %chan.blockedList )
72- %0 = call i1 @runtime.chanRecv (ptr %ch , ptr null , ptr nonnull %chan.blockedList , ptr undef ) #4
73- call void @llvm.lifetime.end.p0 (i64 24 , ptr nonnull %chan.blockedList )
70+ %chan.op = alloca %runtime.channelOp , align 8
71+ call void @llvm.lifetime.start.p0 (i64 16 , ptr nonnull %chan.op )
72+ %0 = call i1 @runtime.chanRecv (ptr %ch , ptr null , ptr nonnull %chan.op , ptr undef ) #4
73+ call void @llvm.lifetime.end.p0 (i64 16 , ptr nonnull %chan.op )
7474 ret void
7575}
7676
7777; Function Attrs: nounwind
78- define hidden void @main.selectZeroRecv (ptr dereferenceable_or_null (32 ) %ch1 , ptr dereferenceable_or_null (32 ) %ch2 , ptr %context ) unnamed_addr #2 {
78+ define hidden void @main.selectZeroRecv (ptr dereferenceable_or_null (36 ) %ch1 , ptr dereferenceable_or_null (36 ) %ch2 , ptr %context ) unnamed_addr #2 {
7979entry:
8080 %select.states.alloca = alloca [2 x %runtime.chanSelectState ], align 8
8181 %select.send.value = alloca i32 , align 4
8888 store ptr %ch2 , ptr %0 , align 4
8989 %.repack3 = getelementptr inbounds [2 x %runtime.chanSelectState ], ptr %select.states.alloca , i32 0 , i32 1 , i32 1
9090 store ptr null , ptr %.repack3 , align 4
91- %select.result = call { i32 , i1 } @runtime.tryChanSelect (ptr undef , ptr nonnull %select.states.alloca , i32 2 , i32 2 , ptr undef ) #4
91+ %select.result = call { i32 , i1 } @runtime.chanSelect (ptr undef , ptr nonnull %select.states.alloca , i32 2 , i32 2 , ptr null , i32 0 , i32 0 , ptr undef ) #4
9292 call void @llvm.lifetime.end.p0 (i64 16 , ptr nonnull %select.states.alloca )
9393 %1 = extractvalue { i32 , i1 } %select.result , 0
9494 %2 = icmp eq i32 %1 , 0
@@ -105,7 +105,7 @@ select.body: ; preds = %select.next
105105 br label %select.done
106106}
107107
108- declare { i32 , i1 } @runtime.tryChanSelect (ptr , ptr , i32 , i32 , ptr ) #1
108+ declare { i32 , i1 } @runtime.chanSelect (ptr , ptr , i32 , i32 , ptr , i32 , i32 , ptr ) #1
109109
110110attributes #0 = { allockind("alloc,zeroed" ) allocsize(0 ) "alloc-family" ="runtime.alloc" "target-features" ="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
111111attributes #1 = { "target-features" ="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
0 commit comments