@@ -3,9 +3,7 @@ source_filename = "generics.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- %main.Point = type { %runtime._interface , %runtime._interface }
7- %runtime._interface = type { i32 , i8* }
8- %main.Point.0 = type { float , float }
6+ %main.Point = type { float , float }
97
108declare noalias nonnull i8* @runtime.alloc (i32 , i8* , i8* ) #0
119
@@ -17,78 +15,76 @@ entry:
1715 ret void
1816}
1917
20- declare %main.Point @main.Add (%main.Point , %main.Point , i8* ) #0
21-
2218; Function Attrs: nounwind
2319define hidden void @main.main (i8* %context ) unnamed_addr #1 {
2420entry:
25- %bf = alloca %main.Point.0 , align 8
26- %af = alloca %main.Point.0 , align 8
27- %af.repack = getelementptr inbounds %main.Point.0 , %main.Point.0 * %af , i32 0 , i32 0
21+ %bf = alloca %main.Point , align 8
22+ %af = alloca %main.Point , align 8
23+ %af.repack = getelementptr inbounds %main.Point , %main.Point* %af , i32 0 , i32 0
2824 store float 0 .000000e+00 , float * %af.repack , align 8
29- %af.repack1 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %af , i32 0 , i32 1
25+ %af.repack1 = getelementptr inbounds %main.Point , %main.Point* %af , i32 0 , i32 1
3026 store float 0 .000000e+00 , float * %af.repack1 , align 4
31- %0 = bitcast %main.Point.0 * %af to i8*
27+ %0 = bitcast %main.Point* %af to i8*
3228 call void @runtime.trackPointer (i8* nonnull %0 , i8* undef ) #2
33- %bf.repack = getelementptr inbounds %main.Point.0 , %main.Point.0 * %bf , i32 0 , i32 0
29+ %bf.repack = getelementptr inbounds %main.Point , %main.Point* %bf , i32 0 , i32 0
3430 store float 0 .000000e+00 , float * %bf.repack , align 8
35- %bf.repack2 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %bf , i32 0 , i32 1
31+ %bf.repack2 = getelementptr inbounds %main.Point , %main.Point* %bf , i32 0 , i32 1
3632 store float 0 .000000e+00 , float * %bf.repack2 , align 4
37- %1 = bitcast %main.Point.0 * %bf to i8*
33+ %1 = bitcast %main.Point* %bf to i8*
3834 call void @runtime.trackPointer (i8* nonnull %1 , i8* undef ) #2
39- %.elt = getelementptr inbounds %main.Point.0 , %main.Point.0 * %af , i32 0 , i32 0
35+ %.elt = getelementptr inbounds %main.Point , %main.Point* %af , i32 0 , i32 0
4036 %.unpack = load float , float * %.elt , align 8
41- %.elt3 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %af , i32 0 , i32 1
37+ %.elt3 = getelementptr inbounds %main.Point , %main.Point* %af , i32 0 , i32 1
4238 %.unpack4 = load float , float * %.elt3 , align 4
43- %.elt5 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %bf , i32 0 , i32 0
39+ %.elt5 = getelementptr inbounds %main.Point , %main.Point* %bf , i32 0 , i32 0
4440 %.unpack6 = load float , float * %.elt5 , align 8
45- %.elt7 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %bf , i32 0 , i32 1
41+ %.elt7 = getelementptr inbounds %main.Point , %main.Point* %bf , i32 0 , i32 1
4642 %.unpack8 = load float , float * %.elt7 , align 4
47- %2 = call %main.Point.0 @"main.Add[float32]" (float %.unpack , float %.unpack4 , float %.unpack6 , float %.unpack8 , i8* undef )
43+ %2 = call %main.Point @"main.Add[float32]" (float %.unpack , float %.unpack4 , float %.unpack6 , float %.unpack8 , i8* undef )
4844 ret void
4945}
5046
5147; Function Attrs: nounwind
52- define linkonce_odr hidden %main.Point.0 @"main.Add[float32]" (float %a.X , float %a.Y , float %b.X , float %b.Y , i8* %context ) unnamed_addr #1 {
48+ define linkonce_odr hidden %main.Point @"main.Add[float32]" (float %a.X , float %a.Y , float %b.X , float %b.Y , i8* %context ) unnamed_addr #1 {
5349entry:
54- %complit = alloca %main.Point.0 , align 8
55- %b = alloca %main.Point.0 , align 8
56- %a = alloca %main.Point.0 , align 8
57- %a.repack = getelementptr inbounds %main.Point.0 , %main.Point.0 * %a , i32 0 , i32 0
50+ %complit = alloca %main.Point , align 8
51+ %b = alloca %main.Point , align 8
52+ %a = alloca %main.Point , align 8
53+ %a.repack = getelementptr inbounds %main.Point , %main.Point* %a , i32 0 , i32 0
5854 store float 0 .000000e+00 , float * %a.repack , align 8
59- %a.repack9 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %a , i32 0 , i32 1
55+ %a.repack9 = getelementptr inbounds %main.Point , %main.Point* %a , i32 0 , i32 1
6056 store float 0 .000000e+00 , float * %a.repack9 , align 4
61- %0 = bitcast %main.Point.0 * %a to i8*
57+ %0 = bitcast %main.Point* %a to i8*
6258 call void @runtime.trackPointer (i8* nonnull %0 , i8* undef ) #2
63- %a.repack10 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %a , i32 0 , i32 0
59+ %a.repack10 = getelementptr inbounds %main.Point , %main.Point* %a , i32 0 , i32 0
6460 store float %a.X , float * %a.repack10 , align 8
65- %a.repack11 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %a , i32 0 , i32 1
61+ %a.repack11 = getelementptr inbounds %main.Point , %main.Point* %a , i32 0 , i32 1
6662 store float %a.Y , float * %a.repack11 , align 4
67- %b.repack = getelementptr inbounds %main.Point.0 , %main.Point.0 * %b , i32 0 , i32 0
63+ %b.repack = getelementptr inbounds %main.Point , %main.Point* %b , i32 0 , i32 0
6864 store float 0 .000000e+00 , float * %b.repack , align 8
69- %b.repack13 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %b , i32 0 , i32 1
65+ %b.repack13 = getelementptr inbounds %main.Point , %main.Point* %b , i32 0 , i32 1
7066 store float 0 .000000e+00 , float * %b.repack13 , align 4
71- %1 = bitcast %main.Point.0 * %b to i8*
67+ %1 = bitcast %main.Point* %b to i8*
7268 call void @runtime.trackPointer (i8* nonnull %1 , i8* undef ) #2
73- %b.repack14 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %b , i32 0 , i32 0
69+ %b.repack14 = getelementptr inbounds %main.Point , %main.Point* %b , i32 0 , i32 0
7470 store float %b.X , float * %b.repack14 , align 8
75- %b.repack15 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %b , i32 0 , i32 1
71+ %b.repack15 = getelementptr inbounds %main.Point , %main.Point* %b , i32 0 , i32 1
7672 store float %b.Y , float * %b.repack15 , align 4
77- %complit.repack = getelementptr inbounds %main.Point.0 , %main.Point.0 * %complit , i32 0 , i32 0
73+ %complit.repack = getelementptr inbounds %main.Point , %main.Point* %complit , i32 0 , i32 0
7874 store float 0 .000000e+00 , float * %complit.repack , align 8
79- %complit.repack17 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %complit , i32 0 , i32 1
75+ %complit.repack17 = getelementptr inbounds %main.Point , %main.Point* %complit , i32 0 , i32 1
8076 store float 0 .000000e+00 , float * %complit.repack17 , align 4
81- %2 = bitcast %main.Point.0 * %complit to i8*
77+ %2 = bitcast %main.Point* %complit to i8*
8278 call void @runtime.trackPointer (i8* nonnull %2 , i8* undef ) #2
83- %3 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %complit , i32 0 , i32 0
79+ %3 = getelementptr inbounds %main.Point , %main.Point* %complit , i32 0 , i32 0
8480 br i1 false , label %deref.throw , label %deref.next
8581
8682deref.next: ; preds = %entry
8783 br i1 false , label %deref.throw1 , label %deref.next2
8884
8985deref.next2: ; preds = %deref.next
90- %4 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %b , i32 0 , i32 0
91- %5 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %a , i32 0 , i32 0
86+ %4 = getelementptr inbounds %main.Point , %main.Point* %b , i32 0 , i32 0
87+ %5 = getelementptr inbounds %main.Point , %main.Point* %a , i32 0 , i32 0
9288 %6 = load float , float * %5 , align 8
9389 %7 = load float , float * %4 , align 8
9490 %8 = fadd float %6 , %7
@@ -98,8 +94,8 @@ deref.next4: ; preds = %deref.next2
9894 br i1 false , label %deref.throw5 , label %deref.next6
9995
10096deref.next6: ; preds = %deref.next4
101- %9 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %b , i32 0 , i32 1
102- %10 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %a , i32 0 , i32 1
97+ %9 = getelementptr inbounds %main.Point , %main.Point* %b , i32 0 , i32 1
98+ %10 = getelementptr inbounds %main.Point , %main.Point* %a , i32 0 , i32 1
10399 %11 = load float , float * %10 , align 4
104100 %12 = load float , float * %9 , align 4
105101 br i1 false , label %store.throw , label %store.next
@@ -109,14 +105,14 @@ store.next: ; preds = %deref.next6
109105 br i1 false , label %store.throw7 , label %store.next8
110106
111107store .next8: ; preds = %store.next
112- %13 = getelementptr inbounds %main.Point.0 , %main.Point.0 * %complit , i32 0 , i32 1
108+ %13 = getelementptr inbounds %main.Point , %main.Point* %complit , i32 0 , i32 1
113109 %14 = fadd float %11 , %12
114110 store float %14 , float * %13 , align 4
115- %.elt = getelementptr inbounds %main.Point.0 , %main.Point.0 * %complit , i32 0 , i32 0
111+ %.elt = getelementptr inbounds %main.Point , %main.Point* %complit , i32 0 , i32 0
116112 %.unpack = load float , float * %.elt , align 8
117- %15 = insertvalue %main.Point.0 undef , float %.unpack , 0
118- %16 = insertvalue %main.Point.0 %15 , float %14 , 1
119- ret %main.Point.0 %16
113+ %15 = insertvalue %main.Point undef , float %.unpack , 0
114+ %16 = insertvalue %main.Point %15 , float %14 , 1
115+ ret %main.Point %16
120116
121117deref.throw: ; preds = %entry
122118 unreachable
0 commit comments