Update skeleton

This commit is contained in:
Jeehoon Kang
2020-06-05 00:54:00 +09:00
parent 62c5208631
commit 7bb9ed11b5
123 changed files with 49554 additions and 868 deletions

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -22,11 +22,11 @@ block b2:
br %b2:i2:u1, b3(), b5()
block b3:
%b3:i0:*i32 = getelementptr %l0 offset 0
%b3:i0:*i32 = getelementptr %l0:*[5 x i32] offset 0:i32
%b3:i1:i32 = load %l2:*i32
%b3:i2:i64 = typecast %b3:i1:i32 to i64
%b3:i3:i64 = mul %b3:i2:i64 4:i64
%b3:i4:*i32 = getelementptr %b3:i0 offset %b3:i3
%b3:i4:*i32 = getelementptr %b3:i0:*i32 offset %b3:i3:i64
%b3:i5:i32 = load %l2:*i32
%b3:i6:unit = store %b3:i5:i32 %b3:i4:*i32
j b4()
@@ -39,8 +39,8 @@ block b4:
block b5:
%b5:i0:i32 = load %l1:*i32
%b5:i1:*i32 = getelementptr %l0 offset 0
%b5:i2:i32 = call @sum(%b5:i0:i32, %b5:i1:*i32)
%b5:i1:*i32 = getelementptr %l0:*[5 x i32] offset 0:i32
%b5:i2:i32 = call @sum:*[ret:i32 params:(i32, *i32)](%b5:i0:i32, %b5:i1:*i32)
%b5:i3:u1 = cmp eq %b5:i2:i32 10:i32
%b5:i4:i32 = typecast %b5:i3:u1 to i32
ret %b5:i4:i32
@@ -49,7 +49,7 @@ block b6:
ret 0:i32
}
fun i32 @sum {
fun i32 @sum (i32, *i32) {
init:
bid: b0
allocations:
@@ -80,7 +80,7 @@ block b3:
%b3:i2:i32 = load %l3:*i32
%b3:i3:i64 = typecast %b3:i2:i32 to i64
%b3:i4:i64 = mul %b3:i3:i64 4:i64
%b3:i5:*i32 = getelementptr %b3:i1 offset %b3:i4
%b3:i5:*i32 = getelementptr %b3:i1:*i32 offset %b3:i4:i64
%b3:i6:i32 = load %b3:i5:*i32
%b3:i7:i32 = add %b3:i0:i32 %b3:i6:i32
%b3:i8:unit = store %b3:i7:i32 %l2:*i32

View File

@@ -1,5 +1,5 @@
fun unit @init {
fun unit @init (i32, i32, *[5 x i32]) {
init:
bid: b0
allocations:
@@ -52,12 +52,12 @@ block b8:
%b8:i1:i32 = load %l3:*i32
%b8:i2:i64 = typecast %b8:i1:i32 to i64
%b8:i3:i64 = mul %b8:i2:i64 20:i64
%b8:i4:*[5 x i32] = getelementptr %b8:i0 offset %b8:i3
%b8:i5:*i32 = getelementptr %b8:i4 offset 0
%b8:i4:*[5 x i32] = getelementptr %b8:i0:*[5 x i32] offset %b8:i3:i64
%b8:i5:*i32 = getelementptr %b8:i4:*[5 x i32] offset 0:i32
%b8:i6:i32 = load %l4:*i32
%b8:i7:i64 = typecast %b8:i6:i32 to i64
%b8:i8:i64 = mul %b8:i7:i64 4:i64
%b8:i9:*i32 = getelementptr %b8:i5 offset %b8:i8
%b8:i9:*i32 = getelementptr %b8:i5:*i32 offset %b8:i8:i64
%b8:i10:i32 = load %l3:*i32
%b8:i11:i32 = load %l4:*i32
%b8:i12:i32 = mul %b8:i10:i32 %b8:i11:i32
@@ -74,7 +74,7 @@ block b10:
j b4()
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -87,16 +87,16 @@ block b0:
%b0:i1:unit = store 5:i32 %l2:*i32
%b0:i2:i32 = load %l1:*i32
%b0:i3:i32 = load %l2:*i32
%b0:i4:*[5 x i32] = getelementptr %l0 offset 0
%b0:i5:unit = call @init(%b0:i2:i32, %b0:i3:i32, %b0:i4:*[5 x i32])
%b0:i6:*[5 x i32] = getelementptr %l0 offset 0
%b0:i4:*[5 x i32] = getelementptr %l0:*[4 x [5 x i32]] offset 0:i32
%b0:i5:unit = call @init:*[ret:unit params:(i32, i32, *[5 x i32])](%b0:i2:i32, %b0:i3:i32, %b0:i4:*[5 x i32])
%b0:i6:*[5 x i32] = getelementptr %l0:*[4 x [5 x i32]] offset 0:i32
%b0:i7:i64 = typecast 2:i32 to i64
%b0:i8:i64 = mul %b0:i7:i64 20:i64
%b0:i9:*[5 x i32] = getelementptr %b0:i6 offset %b0:i8
%b0:i10:*i32 = getelementptr %b0:i9 offset 0
%b0:i9:*[5 x i32] = getelementptr %b0:i6:*[5 x i32] offset %b0:i8:i64
%b0:i10:*i32 = getelementptr %b0:i9:*[5 x i32] offset 0:i32
%b0:i11:i64 = typecast 3:i32 to i64
%b0:i12:i64 = mul %b0:i11:i64 4:i64
%b0:i13:*i32 = getelementptr %b0:i10 offset %b0:i12
%b0:i13:*i32 = getelementptr %b0:i10:*i32 offset %b0:i12:i64
%b0:i14:i32 = load %b0:i13:*i32
%b0:i15:u1 = cmp eq %b0:i14:i32 6:i32
%b0:i16:i32 = typecast %b0:i15:u1 to i32

View File

@@ -1,5 +1,5 @@
fun *i32 @foo {
fun *i32 @foo (*i32) {
init:
bid: b0
allocations:
@@ -14,7 +14,7 @@ block b1:
ret undef:*i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -34,12 +34,12 @@ block b2:
br %b2:i1:u1, b3(), b5()
block b3:
%b3:i0:*i32 = getelementptr %l0 offset 0
%b3:i1:*i32 = call @foo(%b3:i0:*i32)
%b3:i0:*i32 = getelementptr %l0:*[10 x i32] offset 0:i32
%b3:i1:*i32 = call @foo:*[ret:*i32 params:(*i32)](%b3:i0:*i32)
%b3:i2:i32 = load %l1:*i32
%b3:i3:i64 = typecast %b3:i2:i32 to i64
%b3:i4:i64 = mul %b3:i3:i64 4:i64
%b3:i5:*i32 = getelementptr %b3:i1 offset %b3:i4
%b3:i5:*i32 = getelementptr %b3:i1:*i32 offset %b3:i4:i64
%b3:i6:i32 = load %l1:*i32
%b3:i7:unit = store %b3:i6:i32 %b3:i5:*i32
j b4()
@@ -51,10 +51,10 @@ block b4:
j b2()
block b5:
%b5:i0:*i32 = getelementptr %l0 offset 0
%b5:i0:*i32 = getelementptr %l0:*[10 x i32] offset 0:i32
%b5:i1:i64 = typecast 5:i32 to i64
%b5:i2:i64 = mul %b5:i1:i64 4:i64
%b5:i3:*i32 = getelementptr %b5:i0 offset %b5:i2
%b5:i3:*i32 = getelementptr %b5:i0:*i32 offset %b5:i2:i64
%b5:i4:i32 = load %b5:i3:*i32
%b5:i5:u1 = cmp eq %b5:i4:i32 5:i32
%b5:i6:i32 = typecast %b5:i5:u1 to i32

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -8,7 +8,7 @@ init:
%l2:i32:i
block b0:
%b0:i0:*i32 = getelementptr %l0 offset 0
%b0:i0:*i32 = getelementptr %l0:*[10 x i32] offset 0:i32
%b0:i1:unit = store %b0:i0:*i32 %l1:**i32
j b1()
@@ -24,7 +24,7 @@ block b2:
block b3:
%b3:i0:*i32 = load %l1:**i32
%b3:i1:i64 = mul 1:i64 4:i64
%b3:i2:*i32 = getelementptr %b3:i0 offset %b3:i1
%b3:i2:*i32 = getelementptr %b3:i0:*i32 offset %b3:i1:i64
%b3:i3:unit = store %b3:i2:*i32 %l1:**i32
%b3:i4:i32 = load %l2:*i32
%b3:i5:unit = store %b3:i4:i32 %b3:i0:*i32
@@ -37,10 +37,10 @@ block b4:
j b2()
block b5:
%b5:i0:*i32 = getelementptr %l0 offset 0
%b5:i0:*i32 = getelementptr %l0:*[10 x i32] offset 0:i32
%b5:i1:i64 = typecast 5:i32 to i64
%b5:i2:i64 = mul %b5:i1:i64 4:i64
%b5:i3:*i32 = getelementptr %b5:i0 offset %b5:i2
%b5:i3:*i32 = getelementptr %b5:i0:*i32 offset %b5:i2:i64
%b5:i4:i32 = load %b5:i3:*i32
%b5:i5:u1 = cmp eq %b5:i4:i32 5:i32
%b5:i6:i32 = typecast %b5:i5:u1 to i32

View File

@@ -1,6 +1,6 @@
var [5 x i32] @g_a = {1, 2, 3}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -11,22 +11,22 @@ init:
block b0:
%b0:i0:unit = store 1:i32 %l0:*i32
%b0:i1:*i32 = getelementptr %l1 offset 0
%b0:i1:*i32 = getelementptr %l1:*[5 x i32] offset 0:i32
%b0:i2:i64 = mul 0:i64 4:i64
%b0:i3:*i32 = getelementptr %b0:i1 offset %b0:i2
%b0:i3:*i32 = getelementptr %b0:i1:*i32 offset %b0:i2:i64
%b0:i4:i32 = load %l0:*i32
%b0:i5:unit = store %b0:i4:i32 %b0:i3:*i32
%b0:i6:i64 = mul 1:i64 4:i64
%b0:i7:*i32 = getelementptr %b0:i1 offset %b0:i6
%b0:i7:*i32 = getelementptr %b0:i1:*i32 offset %b0:i6:i64
%b0:i8:unit = store 2:i32 %b0:i7:*i32
%b0:i9:i64 = mul 2:i64 4:i64
%b0:i10:*i32 = getelementptr %b0:i1 offset %b0:i9
%b0:i10:*i32 = getelementptr %b0:i1:*i32 offset %b0:i9:i64
%b0:i11:unit = store 3:i32 %b0:i10:*i32
%b0:i12:i64 = mul 3:i64 4:i64
%b0:i13:*i32 = getelementptr %b0:i1 offset %b0:i12
%b0:i13:*i32 = getelementptr %b0:i1:*i32 offset %b0:i12:i64
%b0:i14:unit = store 4:i32 %b0:i13:*i32
%b0:i15:i64 = mul 4:i64 4:i64
%b0:i16:*i32 = getelementptr %b0:i1 offset %b0:i15
%b0:i16:*i32 = getelementptr %b0:i1:*i32 offset %b0:i15:i64
%b0:i17:i32 = minus 5:i32
%b0:i18:unit = store %b0:i17:i32 %b0:i16:*i32
%b0:i19:unit = store 0:i32 %l2:*i32
@@ -43,20 +43,20 @@ block b2:
block b3:
%b3:i0:i32 = load %l2:*i32
%b3:i1:*i32 = getelementptr %l1 offset 0
%b3:i1:*i32 = getelementptr %l1:*[5 x i32] offset 0:i32
%b3:i2:i32 = load %l3:*i32
%b3:i3:i64 = typecast %b3:i2:i32 to i64
%b3:i4:i64 = mul %b3:i3:i64 4:i64
%b3:i5:*i32 = getelementptr %b3:i1 offset %b3:i4
%b3:i5:*i32 = getelementptr %b3:i1:*i32 offset %b3:i4:i64
%b3:i6:i32 = load %b3:i5:*i32
%b3:i7:i32 = add %b3:i0:i32 %b3:i6:i32
%b3:i8:unit = store %b3:i7:i32 %l2:*i32
%b3:i9:i32 = load %l2:*i32
%b3:i10:*i32 = getelementptr @g_a offset 0
%b3:i10:*i32 = getelementptr @g_a:*[5 x i32] offset 0:i32
%b3:i11:i32 = load %l3:*i32
%b3:i12:i64 = typecast %b3:i11:i32 to i64
%b3:i13:i64 = mul %b3:i12:i64 4:i64
%b3:i14:*i32 = getelementptr %b3:i10 offset %b3:i13
%b3:i14:*i32 = getelementptr %b3:i10:*i32 offset %b3:i13:i64
%b3:i15:i32 = load %b3:i14:*i32
%b3:i16:i32 = add %b3:i9:i32 %b3:i15:i32
%b3:i17:unit = store %b3:i16:i32 %l2:*i32

View File

@@ -1,5 +1,5 @@
fun i32 @bar {
fun i32 @bar (i32, i32, i32) {
init:
bid: b0
allocations:
@@ -52,7 +52,7 @@ block b5:
j b3()
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @char_greater_than {
fun i32 @char_greater_than (i8, u8) {
init:
bid: b0
allocations:
@@ -32,7 +32,7 @@ block b5:
j b3()
}
fun i32 @int_greater_than {
fun i32 @int_greater_than (i32, u32) {
init:
bid: b0
allocations:
@@ -64,7 +64,7 @@ block b5:
j b3()
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -75,12 +75,12 @@ init:
block b0:
%b0:i0:i32 = minus 1:i32
%b0:i1:u32 = typecast 1:i32 to u32
%b0:i2:i32 = call @int_greater_than(%b0:i0:i32, %b0:i1:u32)
%b0:i2:i32 = call @int_greater_than:*[ret:i32 params:(i32, u32)](%b0:i0:i32, %b0:i1:u32)
%b0:i3:unit = store %b0:i2:i32 %l0:*i32
%b0:i4:i32 = minus 1:i32
%b0:i5:i8 = typecast %b0:i4:i32 to i8
%b0:i6:u8 = typecast 1:i32 to u8
%b0:i7:i32 = call @char_greater_than(%b0:i5:i8, %b0:i6:u8)
%b0:i7:i32 = call @char_greater_than:*[ret:i32 params:(i8, u8)](%b0:i5:i8, %b0:i6:u8)
%b0:i8:unit = store %b0:i7:i32 %l1:*i32
%b0:i9:i32 = load %l0:*i32
%b0:i10:u1 = cmp eq %b0:i9:i32 1:i32

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @fibonacci {
fun i32 @fibonacci (i32) {
init:
bid: b0
allocations:
@@ -21,10 +21,10 @@ block b2:
block b3:
%b3:i0:i32 = load %l0:*i32
%b3:i1:i32 = sub %b3:i0:i32 2:i32
%b3:i2:i32 = call @fibonacci(%b3:i1:i32)
%b3:i2:i32 = call @fibonacci:*[ret:i32 params:(i32)](%b3:i1:i32)
%b3:i3:i32 = load %l0:*i32
%b3:i4:i32 = sub %b3:i3:i32 1:i32
%b3:i5:i32 = call @fibonacci(%b3:i4:i32)
%b3:i5:i32 = call @fibonacci:*[ret:i32 params:(i32)](%b3:i4:i32)
%b3:i6:i32 = add %b3:i2:i32 %b3:i5:i32
ret %b3:i6:i32
@@ -35,14 +35,14 @@ block b5:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = call @fibonacci(9:i32)
%b0:i0:i32 = call @fibonacci:*[ret:i32 params:(i32)](9:i32)
%b0:i1:u1 = cmp eq %b0:i0:i32 34:i32
%b0:i2:i32 = typecast %b0:i1:u1 to i32
ret %b0:i2:i32

View File

@@ -1,5 +1,5 @@
fun i32 @fibonacci {
fun i32 @fibonacci (i32) {
init:
bid: b0
allocations:
@@ -67,14 +67,14 @@ block b10:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = call @fibonacci(9:i32)
%b0:i0:i32 = call @fibonacci:*[ret:i32 params:(i32)](9:i32)
%b0:i1:u1 = cmp eq %b0:i0:i32 34:i32
%b0:i2:i32 = typecast %b0:i1:u1 to i32
ret %b0:i2:i32

View File

@@ -1,5 +1,5 @@
fun i32 @fibonacci {
fun i32 @fibonacci (i32) {
init:
bid: b0
allocations:
@@ -61,14 +61,14 @@ block b8:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = call @fibonacci(9:i32)
%b0:i0:i32 = call @fibonacci:*[ret:i32 params:(i32)](9:i32)
%b0:i1:u1 = cmp eq %b0:i0:i32 34:i32
%b0:i2:i32 = typecast %b0:i1:u1 to i32
ret %b0:i2:i32

View File

@@ -1,5 +1,5 @@
fun i32 @fibonacci {
fun i32 @fibonacci (i32) {
init:
bid: b0
allocations:
@@ -61,14 +61,14 @@ block b8:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = call @fibonacci(9:i32)
%b0:i0:i32 = call @fibonacci:*[ret:i32 params:(i32)](9:i32)
%b0:i1:u1 = cmp eq %b0:i0:i32 34:i32
%b0:i2:i32 = typecast %b0:i1:u1 to i32
ret %b0:i2:i32

View File

@@ -1,5 +1,5 @@
fun i32 @fibonacci {
fun i32 @fibonacci (i32) {
init:
bid: b0
allocations:
@@ -21,10 +21,10 @@ block b2:
block b3:
%b3:i0:i32 = load %l0:*i32
%b3:i1:i32 = sub %b3:i0:i32 2:i32
%b3:i2:i32 = call @fibonacci(%b3:i1:i32)
%b3:i2:i32 = call @fibonacci:*[ret:i32 params:(i32)](%b3:i1:i32)
%b3:i3:i32 = load %l0:*i32
%b3:i4:i32 = sub %b3:i3:i32 1:i32
%b3:i5:i32 = call @fibonacci(%b3:i4:i32)
%b3:i5:i32 = call @fibonacci:*[ret:i32 params:(i32)](%b3:i4:i32)
%b3:i6:i32 = add %b3:i2:i32 %b3:i5:i32
ret %b3:i6:i32
@@ -35,14 +35,14 @@ block b5:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = call @fibonacci(9:i32)
%b0:i0:i32 = call @fibonacci:*[ret:i32 params:(i32)](9:i32)
%b0:i1:u1 = cmp eq %b0:i0:i32 34:i32
%b0:i2:i32 = typecast %b0:i1:u1 to i32
ret %b0:i2:i32

View File

@@ -1,5 +1,5 @@
fun f64 @average {
fun f64 @average (i32, *i32) {
init:
bid: b0
allocations:
@@ -30,7 +30,7 @@ block b3:
%b3:i2:i32 = load %l3:*i32
%b3:i3:i64 = typecast %b3:i2:i32 to i64
%b3:i4:i64 = mul %b3:i3:i64 4:i64
%b3:i5:*i32 = getelementptr %b3:i1 offset %b3:i4
%b3:i5:*i32 = getelementptr %b3:i1:*i32 offset %b3:i4:i64
%b3:i6:i32 = load %b3:i5:*i32
%b3:i7:i32 = add %b3:i0:i32 %b3:i6:i32
%b3:i8:unit = store %b3:i7:i32 %l2:*i32
@@ -54,7 +54,7 @@ block b6:
ret undef:f64
}
fun f64 @custom_abs {
fun f64 @custom_abs (f64) {
init:
bid: b0
allocations:
@@ -87,7 +87,7 @@ block b4:
ret undef:f64
}
fun f64 @custom_max {
fun f64 @custom_max (f64, f64) {
init:
bid: b0
allocations:
@@ -121,7 +121,7 @@ block b4:
ret undef:f64
}
fun i32 @is_close {
fun i32 @is_close (f64, f64, f64, f64) {
init:
bid: b0
allocations:
@@ -138,16 +138,16 @@ block b0:
%b0:i4:f64 = load %l0:*f64
%b0:i5:f64 = load %l1:*f64
%b0:i6:f64 = sub %b0:i4:f64 %b0:i5:f64
%b0:i7:f64 = call @custom_abs(%b0:i6:f64)
%b0:i7:f64 = call @custom_abs:*[ret:f64 params:(f64)](%b0:i6:f64)
%b0:i8:f64 = load %l2:*f64
%b0:i9:f64 = load %l0:*f64
%b0:i10:f64 = call @custom_abs(%b0:i9:f64)
%b0:i10:f64 = call @custom_abs:*[ret:f64 params:(f64)](%b0:i9:f64)
%b0:i11:f64 = load %l1:*f64
%b0:i12:f64 = call @custom_abs(%b0:i11:f64)
%b0:i13:f64 = call @custom_max(%b0:i10:f64, %b0:i12:f64)
%b0:i12:f64 = call @custom_abs:*[ret:f64 params:(f64)](%b0:i11:f64)
%b0:i13:f64 = call @custom_max:*[ret:f64 params:(f64, f64)](%b0:i10:f64, %b0:i12:f64)
%b0:i14:f64 = mul %b0:i8:f64 %b0:i13:f64
%b0:i15:f64 = load %l3:*f64
%b0:i16:f64 = call @custom_max(%b0:i14:f64, %b0:i15:f64)
%b0:i16:f64 = call @custom_max:*[ret:f64 params:(f64, f64)](%b0:i14:f64, %b0:i15:f64)
%b0:i17:u1 = cmp le %b0:i7:f64 %b0:i16:f64
%b0:i18:i32 = typecast %b0:i17:u1 to i32
ret %b0:i18:i32
@@ -156,7 +156,7 @@ block b1:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -180,11 +180,11 @@ block b2:
br %b2:i2:u1, b3(), b5()
block b3:
%b3:i0:*i32 = getelementptr %l0 offset 0
%b3:i0:*i32 = getelementptr %l0:*[10 x i32] offset 0:i32
%b3:i1:i32 = load %l2:*i32
%b3:i2:i64 = typecast %b3:i1:i32 to i64
%b3:i3:i64 = mul %b3:i2:i64 4:i64
%b3:i4:*i32 = getelementptr %b3:i0 offset %b3:i3
%b3:i4:*i32 = getelementptr %b3:i0:*i32 offset %b3:i3:i64
%b3:i5:i32 = load %l2:*i32
%b3:i6:unit = store %b3:i5:i32 %b3:i4:*i32
j b4()
@@ -197,13 +197,13 @@ block b4:
block b5:
%b5:i0:i32 = load %l1:*i32
%b5:i1:*i32 = getelementptr %l0 offset 0
%b5:i2:f64 = call @average(%b5:i0:i32, %b5:i1:*i32)
%b5:i1:*i32 = getelementptr %l0:*[10 x i32] offset 0:i32
%b5:i2:f64 = call @average:*[ret:f64 params:(i32, *i32)](%b5:i0:i32, %b5:i1:*i32)
%b5:i3:f32 = typecast %b5:i2:f64 to f32
%b5:i4:unit = store %b5:i3:f32 %l3:*f32
%b5:i5:f32 = load %l3:*f32
%b5:i6:f64 = typecast %b5:i5:f32 to f64
%b5:i7:i32 = call @is_close(%b5:i6:f64, 4.5:f64, 0.000000001:f64, 0.1:f64)
%b5:i7:i32 = call @is_close:*[ret:i32 params:(f64, f64, f64, f64)](%b5:i6:f64, 4.5:f64, 0.000000001:f64, 0.1:f64)
ret %b5:i7:i32
block b6:

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
fun i32 @foo {
fun i32 @foo (i32, i32, i32) {
init:
bid: b0
allocations:
@@ -34,7 +34,7 @@ block b5:
j b3()
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -42,7 +42,7 @@ init:
block b0:
%b0:i0:i32 = minus 1:i32
%b0:i1:i32 = call @foo(0:i32, 1:i32, %b0:i0:i32)
%b0:i1:i32 = call @foo:*[ret:i32 params:(i32, i32, i32)](0:i32, 1:i32, %b0:i0:i32)
%b0:i2:i32 = minus 1:i32
%b0:i3:u1 = cmp eq %b0:i1:i32 %b0:i2:i32
%b0:i4:i32 = typecast %b0:i3:u1 to i32

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,6 +1,6 @@
var i32 @g = 10
fun i32 @foo {
fun i32 @foo (i32, i32) {
init:
bid: b0
allocations:
@@ -21,7 +21,7 @@ block b1:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -32,7 +32,7 @@ block b0:
%b0:i1:unit = store %b0:i0:i32 %l0:*i32
%b0:i2:i32 = load %l0:*i32
%b0:i3:i32 = load %l0:*i32
%b0:i4:i32 = call @foo(%b0:i2:i32, %b0:i3:i32)
%b0:i4:i32 = call @foo:*[ret:i32 params:(i32, i32)](%b0:i2:i32, %b0:i3:i32)
%b0:i5:u1 = cmp eq %b0:i4:i32 30:i32
%b0:i6:i32 = typecast %b0:i5:u1 to i32
ret %b0:i6:i32

View File

@@ -1,5 +1,5 @@
fun i32 @foo {
fun i32 @foo (i32, i32, i32) {
init:
bid: b0
allocations:
@@ -22,42 +22,42 @@ block b1:
ret undef:i32
}
fun *i32 (i32, i32, i32) @foo2 {
fun *[ret:i32 params:(i32, i32, i32)] @foo2 () {
init:
bid: b0
allocations:
block b0:
ret @foo:*i32 (i32, i32, i32)
ret @foo:*[ret:i32 params:(i32, i32, i32)]
block b1:
ret undef:*i32 (i32, i32, i32)
ret undef:*[ret:i32 params:(i32, i32, i32)]
}
fun **i32 (i32, i32, i32) () @foo3 {
fun *[ret:*[ret:i32 params:(i32, i32, i32)] params:()] @foo3 () {
init:
bid: b0
allocations:
block b0:
ret @foo2:**i32 (i32, i32, i32) ()
ret @foo2:*[ret:*[ret:i32 params:(i32, i32, i32)] params:()]
block b1:
ret undef:**i32 (i32, i32, i32) ()
ret undef:*[ret:*[ret:i32 params:(i32, i32, i32)] params:()]
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:**i32 (i32, i32, i32) () = call @foo3()
%b0:i1:*i32 (i32, i32, i32) = call %b0:i0()
%b0:i2:i32 = call %b0:i1(2:i32, 2:i32, 2:i32)
%b0:i0:*[ret:*[ret:i32 params:(i32, i32, i32)] params:()] = call @foo3:*[ret:*[ret:*[ret:i32 params:(i32, i32, i32)] params:()] params:()]()
%b0:i1:*[ret:i32 params:(i32, i32, i32)] = call %b0:i0:*[ret:*[ret:i32 params:(i32, i32, i32)] params:()]()
%b0:i2:i32 = call %b0:i1:*[ret:i32 params:(i32, i32, i32)](2:i32, 2:i32, 2:i32)
%b0:i3:u1 = cmp eq %b0:i2:i32 6:i32
%b0:i4:i32 = typecast %b0:i3:u1 to i32
ret %b0:i4:i32

View File

@@ -1,5 +1,5 @@
fun i32 @foo {
fun i32 @foo () {
init:
bid: b0
allocations:
@@ -69,14 +69,14 @@ block b14:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = call @foo()
%b0:i0:i32 = call @foo:*[ret:i32 params:()]()
%b0:i1:u1 = cmp eq %b0:i0:i32 7:i32
%b0:i2:i32 = typecast %b0:i1:u1 to i32
ret %b0:i2:i32

View File

@@ -1,5 +1,5 @@
fun i32 @gcd {
fun i32 @gcd (i32, i32) {
init:
bid: b0
allocations:
@@ -86,14 +86,14 @@ block b13:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = call @gcd(18:i32, 21:i32)
%b0:i0:i32 = call @gcd:*[ret:i32 params:(i32, i32)](18:i32, 21:i32)
%b0:i1:u1 = cmp eq %b0:i0:i32 3:i32
%b0:i2:i32 = typecast %b0:i1:u1 to i32
ret %b0:i2:i32

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -3,7 +3,7 @@ var i64 @b = -(1l)
var f32 @c = -(1.5f)
var f64 @d = -(1.5)
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @foo {
fun i32 @foo (i32, i32, i32) {
init:
bid: b0
allocations:
@@ -35,7 +35,7 @@ block b5:
j b3()
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -43,7 +43,7 @@ init:
block b0:
%b0:i0:i32 = minus 1:i32
%b0:i1:i32 = call @foo(0:i32, 1:i32, %b0:i0:i32)
%b0:i1:i32 = call @foo:*[ret:i32 params:(i32, i32, i32)](0:i32, 1:i32, %b0:i0:i32)
%b0:i2:u1 = cmp eq %b0:i1:i32 1:i32
%b0:i3:i32 = typecast %b0:i2:u1 to i32
ret %b0:i3:i32

View File

@@ -1,5 +1,5 @@
fun *i32 @foo {
fun *i32 @foo (*i32) {
init:
bid: b0
allocations:
@@ -14,7 +14,7 @@ block b1:
ret undef:*i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -36,25 +36,25 @@ block b0:
%b0:i9:unit = store %b0:i8:*i32 %l3:**i32
%b0:i10:**i32 = load %l2:***i32
%b0:i11:*i32 = load %b0:i10:**i32
%b0:i12:*i32 = call @foo(%b0:i11:*i32)
%b0:i12:*i32 = call @foo:*[ret:*i32 params:(*i32)](%b0:i11:*i32)
%b0:i13:i32 = load %b0:i12:*i32
%b0:i14:**i32 = load %l2:***i32
%b0:i15:*i32 = load %b0:i14:**i32
%b0:i16:*i32 = call @foo(%b0:i15:*i32)
%b0:i16:*i32 = call @foo:*[ret:*i32 params:(*i32)](%b0:i15:*i32)
%b0:i17:**i32 = load %l2:***i32
%b0:i18:*i32 = load %b0:i17:**i32
%b0:i19:*i32 = call @foo(%b0:i18:*i32)
%b0:i19:*i32 = call @foo:*[ret:*i32 params:(*i32)](%b0:i18:*i32)
%b0:i20:i32 = load %b0:i19:*i32
%b0:i21:**i32 = load %l2:***i32
%b0:i22:*i32 = load %b0:i21:**i32
%b0:i23:*i32 = call @foo(%b0:i22:*i32)
%b0:i23:*i32 = call @foo:*[ret:*i32 params:(*i32)](%b0:i22:*i32)
%b0:i24:i32 = load %b0:i23:*i32
%b0:i25:i32 = add %b0:i24:i32 1:i32
%b0:i26:unit = store %b0:i25:i32 %b0:i16:*i32
%b0:i27:*i32 = load %l3:**i32
%b0:i28:*i32 = call @foo(%b0:i27:*i32)
%b0:i28:*i32 = call @foo:*[ret:*i32 params:(*i32)](%b0:i27:*i32)
%b0:i29:*i32 = load %l3:**i32
%b0:i30:*i32 = call @foo(%b0:i29:*i32)
%b0:i30:*i32 = call @foo:*[ret:*i32 params:(*i32)](%b0:i29:*i32)
%b0:i31:i32 = load %b0:i30:*i32
%b0:i32:i32 = add %b0:i31:i32 1:i32
%b0:i33:unit = store %b0:i32:i32 %b0:i28:*i32

View File

@@ -1,5 +1,5 @@
fun unit @foo {
fun unit @foo () {
init:
bid: b0
allocations:
@@ -9,14 +9,14 @@ block b0:
ret unit:unit
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:unit = call @foo()
%b0:i0:unit = call @foo:*[ret:unit params:()]()
ret 1:i32
block b1:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @f {
fun i32 @f (i32) {
init:
bid: b0
allocations:
@@ -15,7 +15,7 @@ block b1:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -59,7 +59,7 @@ block b5:
block b6:
%b6:i0:i32 = load %l3:*i32
%b6:i1:i32 = call @f(%b6:i0:i32)
%b6:i1:i32 = call @f:*[ret:i32 params:(i32)](%b6:i0:i32)
%b6:i2:u1 = cmp eq %b6:i1:i32 9:i32
%b6:i3:i32 = typecast %b6:i2:u1 to i32
ret %b6:i3:i32

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @fibonacci {
fun i32 @fibonacci (i32) {
init:
bid: b0
allocations:
@@ -23,10 +23,10 @@ block b2:
block b3:
%b3:i0:i32 = load %l0:*i32
%b3:i1:i32 = sub %b3:i0:i32 2:i32
%b3:i2:i32 = call @fibonacci(%b3:i1:i32)
%b3:i2:i32 = call @fibonacci:*[ret:i32 params:(i32)](%b3:i1:i32)
%b3:i3:i32 = load %l0:*i32
%b3:i4:i32 = sub %b3:i3:i32 1:i32
%b3:i5:i32 = call @fibonacci(%b3:i4:i32)
%b3:i5:i32 = call @fibonacci:*[ret:i32 params:(i32)](%b3:i4:i32)
%b3:i6:i32 = add %b3:i2:i32 %b3:i5:i32
ret %b3:i6:i32
@@ -34,7 +34,7 @@ block b4:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,7 +1,7 @@
struct %t1 : { i8, struct %t0, f64 }
struct %t0 : { [4 x [5 x i32]] }
struct %t1 : { i8, struct %t0, f64 }
fun unit @init {
fun unit @init (i32, i32, *[5 x i32]) {
init:
bid: b0
allocations:
@@ -54,12 +54,12 @@ block b8:
%b8:i1:i32 = load %l3:*i32
%b8:i2:i64 = typecast %b8:i1:i32 to i64
%b8:i3:i64 = mul %b8:i2:i64 20:i64
%b8:i4:*[5 x i32] = getelementptr %b8:i0 offset %b8:i3
%b8:i5:*i32 = getelementptr %b8:i4 offset 0
%b8:i4:*[5 x i32] = getelementptr %b8:i0:*[5 x i32] offset %b8:i3:i64
%b8:i5:*i32 = getelementptr %b8:i4:*[5 x i32] offset 0:i32
%b8:i6:i32 = load %l4:*i32
%b8:i7:i64 = typecast %b8:i6:i32 to i64
%b8:i8:i64 = mul %b8:i7:i64 4:i64
%b8:i9:*i32 = getelementptr %b8:i5 offset %b8:i8
%b8:i9:*i32 = getelementptr %b8:i5:*i32 offset %b8:i8:i64
%b8:i10:i32 = load %l3:*i32
%b8:i11:i32 = load %l4:*i32
%b8:i12:i32 = mul %b8:i10:i32 %b8:i11:i32
@@ -76,7 +76,7 @@ block b10:
j b4()
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -90,20 +90,20 @@ block b0:
%b0:i1:unit = store 5:i32 %l2:*i32
%b0:i2:i32 = load %l1:*i32
%b0:i3:i32 = load %l2:*i32
%b0:i4:*[4 x [5 x i32]] = getelementptr %l0 offset 4
%b0:i5:*[5 x i32] = getelementptr %b0:i4 offset 0
%b0:i6:unit = call @init(%b0:i2:i32, %b0:i3:i32, %b0:i5:*[5 x i32])
%b0:i4:*[4 x [5 x i32]] = getelementptr %l0:* struct %t1 offset 4:i64
%b0:i5:*[5 x i32] = getelementptr %b0:i4:*[4 x [5 x i32]] offset 0:i32
%b0:i6:unit = call @init:*[ret:unit params:(i32, i32, *[5 x i32])](%b0:i2:i32, %b0:i3:i32, %b0:i5:*[5 x i32])
%b0:i7: struct %t1 = load %l0:* struct %t1
%b0:i8:unit = store %b0:i7: struct %t1 %l3:* struct %t1
%b0:i9:*[4 x [5 x i32]] = getelementptr %l3 offset 4
%b0:i10:*[5 x i32] = getelementptr %b0:i9 offset 0
%b0:i9:*[4 x [5 x i32]] = getelementptr %l3:* struct %t1 offset 4:i64
%b0:i10:*[5 x i32] = getelementptr %b0:i9:*[4 x [5 x i32]] offset 0:i32
%b0:i11:i64 = typecast 2:i32 to i64
%b0:i12:i64 = mul %b0:i11:i64 20:i64
%b0:i13:*[5 x i32] = getelementptr %b0:i10 offset %b0:i12
%b0:i14:*i32 = getelementptr %b0:i13 offset 0
%b0:i13:*[5 x i32] = getelementptr %b0:i10:*[5 x i32] offset %b0:i12:i64
%b0:i14:*i32 = getelementptr %b0:i13:*[5 x i32] offset 0:i32
%b0:i15:i64 = typecast 3:i32 to i64
%b0:i16:i64 = mul %b0:i15:i64 4:i64
%b0:i17:*i32 = getelementptr %b0:i14 offset %b0:i16
%b0:i17:*i32 = getelementptr %b0:i14:*i32 offset %b0:i16:i64
%b0:i18:i32 = load %b0:i17:*i32
%b0:i19:u1 = cmp eq %b0:i18:i32 6:i32
%b0:i20:i32 = typecast %b0:i19:u1 to i32

View File

@@ -1,7 +1,7 @@
struct %t1 : { i8, struct %t0, i64 }
struct %t0 : { [4 x i32] }
struct %t1 : { i8, struct %t0, i64 }
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -10,40 +10,40 @@ init:
%l2:i32:sum
block b0:
%b0:i0:*i8 = getelementptr %l0 offset 0
%b0:i0:*i8 = getelementptr %l0:*const struct %t1 offset 0:i64
%b0:i1:i8 = typecast 1:i32 to i8
%b0:i2:unit = store %b0:i1:i8 %b0:i0:*i8
%b0:i3:* struct %t0 = getelementptr %l0 offset 4
%b0:i4:*[4 x i32] = getelementptr %b0:i3 offset 0
%b0:i5:*i32 = getelementptr %b0:i4 offset 0
%b0:i3:* struct %t0 = getelementptr %l0:*const struct %t1 offset 4:i64
%b0:i4:*[4 x i32] = getelementptr %b0:i3:* struct %t0 offset 0:i64
%b0:i5:*i32 = getelementptr %b0:i4:*[4 x i32] offset 0:i32
%b0:i6:i64 = mul 0:i64 4:i64
%b0:i7:*i32 = getelementptr %b0:i5 offset %b0:i6
%b0:i7:*i32 = getelementptr %b0:i5:*i32 offset %b0:i6:i64
%b0:i8:unit = store 2:i32 %b0:i7:*i32
%b0:i9:i64 = mul 1:i64 4:i64
%b0:i10:*i32 = getelementptr %b0:i5 offset %b0:i9
%b0:i10:*i32 = getelementptr %b0:i5:*i32 offset %b0:i9:i64
%b0:i11:unit = store 3:i32 %b0:i10:*i32
%b0:i12:i64 = mul 2:i64 4:i64
%b0:i13:*i32 = getelementptr %b0:i5 offset %b0:i12
%b0:i13:*i32 = getelementptr %b0:i5:*i32 offset %b0:i12:i64
%b0:i14:unit = store 4:i32 %b0:i13:*i32
%b0:i15:i64 = mul 3:i64 4:i64
%b0:i16:*i32 = getelementptr %b0:i5 offset %b0:i15
%b0:i16:*i32 = getelementptr %b0:i5:*i32 offset %b0:i15:i64
%b0:i17:unit = store 5:i32 %b0:i16:*i32
%b0:i18:*i64 = getelementptr %l0 offset 24
%b0:i18:*i64 = getelementptr %l0:*const struct %t1 offset 24:i64
%b0:i19:i64 = typecast 6:i32 to i64
%b0:i20:unit = store %b0:i19:i64 %b0:i18:*i64
%b0:i21: struct %t1 = load %l0:*const struct %t1
%b0:i22:unit = store %b0:i21: struct %t1 %l1:* struct %t1
%b0:i23:*i8 = getelementptr %l1 offset 0
%b0:i23:*i8 = getelementptr %l1:* struct %t1 offset 0:i64
%b0:i24:i8 = load %b0:i23:*i8
%b0:i25:*[4 x i32] = getelementptr %l1 offset 4
%b0:i26:*i32 = getelementptr %b0:i25 offset 0
%b0:i25:*[4 x i32] = getelementptr %l1:* struct %t1 offset 4:i64
%b0:i26:*i32 = getelementptr %b0:i25:*[4 x i32] offset 0:i32
%b0:i27:i64 = typecast 2:i32 to i64
%b0:i28:i64 = mul %b0:i27:i64 4:i64
%b0:i29:*i32 = getelementptr %b0:i26 offset %b0:i28
%b0:i29:*i32 = getelementptr %b0:i26:*i32 offset %b0:i28:i64
%b0:i30:i32 = load %b0:i29:*i32
%b0:i31:i32 = typecast %b0:i24:i8 to i32
%b0:i32:i32 = add %b0:i31:i32 %b0:i30:i32
%b0:i33:*i64 = getelementptr %l1 offset 24
%b0:i33:*i64 = getelementptr %l1:* struct %t1 offset 24:i64
%b0:i34:i64 = load %b0:i33:*i64
%b0:i35:i64 = typecast %b0:i32:i32 to i64
%b0:i36:i64 = add %b0:i35:i64 %b0:i34:i64

86
examples/ir/struct3.ir Normal file
View File

@@ -0,0 +1,86 @@
struct Big : { struct Sub, struct Sub, struct Sub }
struct Sub : { i64, i64, i64, i64 }
fun struct Big @foo ( struct Big) {
init:
bid: b0
allocations:
%l0: struct Big:p1
%l1: struct Big:r
block b0:
%b0:i0:unit = store %b0:p0: struct Big %l0:* struct Big
%b0:i1: struct Big = load %l0:* struct Big
%b0:i2:unit = store %b0:i1: struct Big %l1:* struct Big
%b0:i3:* struct Sub = getelementptr %l1:* struct Big offset 0:i64
%b0:i4:*i64 = getelementptr %b0:i3:* struct Sub offset 0:i64
%b0:i5:i64 = typecast 10:i32 to i64
%b0:i6:unit = store %b0:i5:i64 %b0:i4:*i64
%b0:i7: struct Big = load %l1:* struct Big
ret %b0:i7: struct Big
block b1:
ret undef: struct Big
}
fun i32 @main () {
init:
bid: b0
allocations:
%l0: struct Big:a
%l1: struct Big:r
block b0:
%b0:i0:* struct Sub = getelementptr %l0:* struct Big offset 0:i64
%b0:i1:*i64 = getelementptr %b0:i0:* struct Sub offset 0:i64
%b0:i2:i64 = typecast 1:i32 to i64
%b0:i3:unit = store %b0:i2:i64 %b0:i1:*i64
%b0:i4:*i64 = getelementptr %b0:i0:* struct Sub offset 8:i64
%b0:i5:i64 = typecast 2:i32 to i64
%b0:i6:unit = store %b0:i5:i64 %b0:i4:*i64
%b0:i7:*i64 = getelementptr %b0:i0:* struct Sub offset 16:i64
%b0:i8:i64 = typecast 3:i32 to i64
%b0:i9:unit = store %b0:i8:i64 %b0:i7:*i64
%b0:i10:*i64 = getelementptr %b0:i0:* struct Sub offset 24:i64
%b0:i11:i64 = typecast 4:i32 to i64
%b0:i12:unit = store %b0:i11:i64 %b0:i10:*i64
%b0:i13:* struct Sub = getelementptr %l0:* struct Big offset 32:i64
%b0:i14:*i64 = getelementptr %b0:i13:* struct Sub offset 0:i64
%b0:i15:i64 = typecast 2:i32 to i64
%b0:i16:unit = store %b0:i15:i64 %b0:i14:*i64
%b0:i17:*i64 = getelementptr %b0:i13:* struct Sub offset 8:i64
%b0:i18:i64 = typecast 3:i32 to i64
%b0:i19:unit = store %b0:i18:i64 %b0:i17:*i64
%b0:i20:*i64 = getelementptr %b0:i13:* struct Sub offset 16:i64
%b0:i21:i64 = typecast 4:i32 to i64
%b0:i22:unit = store %b0:i21:i64 %b0:i20:*i64
%b0:i23:*i64 = getelementptr %b0:i13:* struct Sub offset 24:i64
%b0:i24:i64 = typecast 5:i32 to i64
%b0:i25:unit = store %b0:i24:i64 %b0:i23:*i64
%b0:i26:* struct Sub = getelementptr %l0:* struct Big offset 64:i64
%b0:i27:*i64 = getelementptr %b0:i26:* struct Sub offset 0:i64
%b0:i28:i64 = typecast 3:i32 to i64
%b0:i29:unit = store %b0:i28:i64 %b0:i27:*i64
%b0:i30:*i64 = getelementptr %b0:i26:* struct Sub offset 8:i64
%b0:i31:i64 = typecast 4:i32 to i64
%b0:i32:unit = store %b0:i31:i64 %b0:i30:*i64
%b0:i33:*i64 = getelementptr %b0:i26:* struct Sub offset 16:i64
%b0:i34:i64 = typecast 5:i32 to i64
%b0:i35:unit = store %b0:i34:i64 %b0:i33:*i64
%b0:i36:*i64 = getelementptr %b0:i26:* struct Sub offset 24:i64
%b0:i37:i64 = typecast 6:i32 to i64
%b0:i38:unit = store %b0:i37:i64 %b0:i36:*i64
%b0:i39: struct Big = load %l0:* struct Big
%b0:i40: struct Big = call @foo:*[ret: struct Big params:( struct Big)](%b0:i39: struct Big)
%b0:i41:unit = store %b0:i40: struct Big %l1:* struct Big
%b0:i42:* struct Sub = getelementptr %l1:* struct Big offset 0:i64
%b0:i43:*i64 = getelementptr %b0:i42:* struct Sub offset 0:i64
%b0:i44:i64 = load %b0:i43:*i64
%b0:i45:i64 = typecast 10:i32 to i64
%b0:i46:u1 = cmp eq %b0:i44:i64 %b0:i45:i64
%b0:i47:i32 = typecast %b0:i46:u1 to i32
ret %b0:i47:i32
block b1:
ret 0:i32
}

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @fibonacci {
fun i32 @fibonacci (i32) {
init:
bid: b0
allocations:
@@ -27,7 +27,7 @@ block b4:
j b1()
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,6 +1,6 @@
struct color : { i32, i8 }
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
@@ -23,13 +23,13 @@ block b0:
%b0:i8:u64 = add %b0:i7:u64 1:u64
%b0:i9:i32 = typecast %b0:i8:u64 to i32
%b0:i10:unit = store %b0:i9:i32 %l0:*i32
%b0:i11:*i32 = getelementptr %l1 offset 0
%b0:i11:*i32 = getelementptr %l1:* struct color offset 0:i64
%b0:i12:unit = store 1:i32 %b0:i11:*i32
%b0:i13:*i8 = getelementptr %l1 offset 4
%b0:i13:*i8 = getelementptr %l1:* struct color offset 4:i64
%b0:i14:i8 = typecast 2:i32 to i8
%b0:i15:unit = store %b0:i14:i8 %b0:i13:*i8
%b0:i16:i32 = load %l0:*i32
%b0:i17:*i8 = getelementptr %l1 offset 4
%b0:i17:*i8 = getelementptr %l1:* struct color offset 4:i64
%b0:i18:i8 = load %b0:i17:*i8
%b0:i19:i32 = typecast %b0:i18:i8 to i32
%b0:i20:i32 = add %b0:i16:i32 %b0:i19:i32
@@ -38,7 +38,7 @@ block b0:
%b0:i23:unit = store %l1:* struct color %l2:** struct color
%b0:i24:i32 = load %l0:*i32
%b0:i25:* struct color = load %l2:** struct color
%b0:i26:*i8 = getelementptr %b0:i25 offset 4
%b0:i26:*i8 = getelementptr %b0:i25:* struct color offset 4:i64
%b0:i27:i8 = load %b0:i26:*i8
%b0:i28:i32 = typecast %b0:i27:i8 to i32
%b0:i29:i32 = add %b0:i24:i32 %b0:i28:i32

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,6 +1,6 @@
var i8 @temp = 0x00l
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:

View File

@@ -1,5 +1,5 @@
fun i32 @foo {
fun i32 @foo () {
init:
bid: b0
allocations:
@@ -65,14 +65,14 @@ block b12:
ret undef:i32
}
fun i32 @main {
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = call @foo()
%b0:i0:i32 = call @foo:*[ret:i32 params:()]()
%b0:i1:u1 = cmp eq %b0:i0:i32 7:i32
%b0:i2:i32 = typecast %b0:i1:u1 to i32
ret %b0:i2:i32