@@ -3,7 +3,7 @@ source_filename = "channel.go"
3
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
4
target triple = "wasm32-unknown-wasi"
5
5
6
- %runtime.channelBlockedList = type { ptr , ptr , ptr , { ptr , i32 , i32 } }
6
+ %runtime.channelOp = type { ptr , ptr , i32 , ptr }
7
7
%runtime.chanSelectState = type { ptr , ptr }
8
8
9
9
; Function Attrs: allockind("alloc,zeroed") allocsize(0)
@@ -18,64 +18,64 @@ entry:
18
18
}
19
19
20
20
; 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 {
22
22
entry:
23
- %chan.blockedList = alloca %runtime.channelBlockedList , align 8
23
+ %chan.op = alloca %runtime.channelOp , align 8
24
24
%chan.value = alloca i32 , align 4
25
25
call void @llvm.lifetime.start.p0 (i64 4 , ptr nonnull %chan.value )
26
26
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 )
30
30
call void @llvm.lifetime.end.p0 (i64 4 , ptr nonnull %chan.value )
31
31
ret void
32
32
}
33
33
34
34
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
35
35
declare void @llvm.lifetime.start.p0 (i64 immarg, ptr nocapture ) #3
36
36
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
38
38
39
39
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
40
40
declare void @llvm.lifetime.end.p0 (i64 immarg, ptr nocapture ) #3
41
41
42
42
; 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 {
44
44
entry:
45
- %chan.blockedList = alloca %runtime.channelBlockedList , align 8
45
+ %chan.op = alloca %runtime.channelOp , align 8
46
46
%chan.value = alloca i32 , align 4
47
47
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
50
50
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 )
52
52
ret void
53
53
}
54
54
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
56
56
57
57
; 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 {
59
59
entry:
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 )
64
64
ret void
65
65
}
66
66
67
67
; 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 {
69
69
entry:
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 )
74
74
ret void
75
75
}
76
76
77
77
; 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 {
79
79
entry:
80
80
%select.states.alloca = alloca [2 x %runtime.chanSelectState ], align 8
81
81
%select.send.value = alloca i32 , align 4
88
88
store ptr %ch2 , ptr %0 , align 4
89
89
%.repack3 = getelementptr inbounds [2 x %runtime.chanSelectState ], ptr %select.states.alloca , i32 0 , i32 1 , i32 1
90
90
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
92
92
call void @llvm.lifetime.end.p0 (i64 16 , ptr nonnull %select.states.alloca )
93
93
%1 = extractvalue { i32 , i1 } %select.result , 0
94
94
%2 = icmp eq i32 %1 , 0
@@ -105,7 +105,7 @@ select.body: ; preds = %select.next
105
105
br label %select.done
106
106
}
107
107
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
109
109
110
110
attributes #0 = { allockind("alloc,zeroed" ) allocsize(0 ) "alloc-family" ="runtime.alloc" "target-features" ="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
111
111
attributes #1 = { "target-features" ="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
0 commit comments