diff --git a/examples/asmgen/array.ir b/examples/asmgen/array.ir index 242bf1a..3673852 100644 --- a/examples/asmgen/array.ir +++ b/examples/asmgen/array.ir @@ -59,6 +59,8 @@ init: %l3:i32:i block b0: + %b0:p0:i32:len + %b0:p1:i32*:p %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32* %l1:i32** %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/asmgen/array2.ir b/examples/asmgen/array2.ir index d196857..2a4b3dd 100644 --- a/examples/asmgen/array2.ir +++ b/examples/asmgen/array2.ir @@ -10,6 +10,9 @@ init: %l4:i32:j block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:a %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:[5 x i32]* %l2:[5 x i32]** diff --git a/examples/asmgen/array3.ir b/examples/asmgen/array3.ir index 25000a0..1ae0155 100644 --- a/examples/asmgen/array3.ir +++ b/examples/asmgen/array3.ir @@ -6,6 +6,7 @@ init: %l0:i32*:a block b0: + %b0:p0:i32*:a %b0:i0:unit = store %b0:p0:i32* %l0:i32** %b0:i1:i32* = load %l0:i32** ret %b0:i1:i32* diff --git a/examples/asmgen/bar.ir b/examples/asmgen/bar.ir index f719fe0..5d87e3b 100644 --- a/examples/asmgen/bar.ir +++ b/examples/asmgen/bar.ir @@ -10,6 +10,9 @@ init: %l4:i32:ugly_mean block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/asmgen/cmp.ir b/examples/asmgen/cmp.ir index 39b994a..4f70e45 100644 --- a/examples/asmgen/cmp.ir +++ b/examples/asmgen/cmp.ir @@ -7,6 +7,8 @@ init: %l1:u8:j block b0: + %b0:p0:i8:i + %b0:p1:u8:j %b0:i0:unit = store %b0:p0:i8 %l0:i8* %b0:i1:unit = store %b0:p1:u8 %l1:u8* %b0:i2:i8 = load %l0:i8* @@ -40,6 +42,8 @@ init: %l1:u32:j block b0: + %b0:p0:i32:i + %b0:p1:u32:j %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:u32 %l1:u32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/asmgen/fib2.ir b/examples/asmgen/fib2.ir index 6be6cb2..db43f06 100644 --- a/examples/asmgen/fib2.ir +++ b/examples/asmgen/fib2.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/asmgen/fib3.ir b/examples/asmgen/fib3.ir index f1491a2..0863387 100644 --- a/examples/asmgen/fib3.ir +++ b/examples/asmgen/fib3.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/asmgen/fib4.ir b/examples/asmgen/fib4.ir index 5a81726..c8a20b2 100644 --- a/examples/asmgen/fib4.ir +++ b/examples/asmgen/fib4.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/asmgen/fib5.ir b/examples/asmgen/fib5.ir index 872f26b..ad88a79 100644 --- a/examples/asmgen/fib5.ir +++ b/examples/asmgen/fib5.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/asmgen/fibonacci.ir b/examples/asmgen/fibonacci.ir index 6be6cb2..db43f06 100644 --- a/examples/asmgen/fibonacci.ir +++ b/examples/asmgen/fibonacci.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/asmgen/float.ir b/examples/asmgen/float.ir index a0a6bce..611ee65 100644 --- a/examples/asmgen/float.ir +++ b/examples/asmgen/float.ir @@ -9,6 +9,8 @@ init: %l3:i32:i block b0: + %b0:p0:i32:len + %b0:p1:i32*:a %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32* %l1:i32** %b0:i2:unit = store 0:i32 %l2:i32* @@ -62,6 +64,7 @@ init: %l1:f64:t0 block b0: + %b0:p0:f64:a %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:f64 = load %l0:f64* %b0:i2:f64 = typecast 0:i32 to f64 @@ -96,6 +99,8 @@ init: %l2:f64:t0 block b0: + %b0:p0:f64:a + %b0:p1:f64:b %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:unit = store %b0:p1:f64 %l1:f64* %b0:i2:f64 = load %l0:f64* @@ -131,6 +136,10 @@ init: %l3:f64:abs_tol block b0: + %b0:p0:f64:a + %b0:p1:f64:b + %b0:p2:f64:rel_tol + %b0:p3:f64:abs_tol %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:unit = store %b0:p1:f64 %l1:f64* %b0:i2:unit = store %b0:p2:f64 %l2:f64* diff --git a/examples/asmgen/foo.ir b/examples/asmgen/foo.ir index a8726ad..8db5237 100644 --- a/examples/asmgen/foo.ir +++ b/examples/asmgen/foo.ir @@ -8,6 +8,9 @@ init: %l2:i32:z block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/asmgen/foo3.ir b/examples/asmgen/foo3.ir index 50e8495..f08e4f2 100644 --- a/examples/asmgen/foo3.ir +++ b/examples/asmgen/foo3.ir @@ -8,6 +8,8 @@ init: %l1:i32:j block b0: + %b0:p0:i32:i + %b0:p1:i32:j %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/asmgen/foo4.ir b/examples/asmgen/foo4.ir index fe10bc4..4314f2f 100644 --- a/examples/asmgen/foo4.ir +++ b/examples/asmgen/foo4.ir @@ -8,6 +8,9 @@ init: %l2:i32:k block b0: + %b0:p0:i32:i + %b0:p1:i32:j + %b0:p2:i32:k %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/asmgen/gcd.ir b/examples/asmgen/gcd.ir index b19f13e..45a5fcf 100644 --- a/examples/asmgen/gcd.ir +++ b/examples/asmgen/gcd.ir @@ -9,6 +9,8 @@ init: %l3:i32:t1 block b0: + %b0:p0:i32:a + %b0:p1:i32:b %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/asmgen/negate.ir b/examples/asmgen/negate.ir index 099d879..91f4281 100644 --- a/examples/asmgen/negate.ir +++ b/examples/asmgen/negate.ir @@ -8,6 +8,9 @@ init: %l2:i32:z block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/asmgen/pointer.ir b/examples/asmgen/pointer.ir index 0623614..4ad0cf7 100644 --- a/examples/asmgen/pointer.ir +++ b/examples/asmgen/pointer.ir @@ -6,6 +6,7 @@ init: %l0:i32*:a block b0: + %b0:p0:i32*:a %b0:i0:unit = store %b0:p0:i32* %l0:i32** %b0:i1:i32* = load %l0:i32** ret %b0:i1:i32* diff --git a/examples/asmgen/simple_cond.ir b/examples/asmgen/simple_cond.ir index 46d84a2..d468513 100644 --- a/examples/asmgen/simple_cond.ir +++ b/examples/asmgen/simple_cond.ir @@ -6,6 +6,7 @@ init: %l0:i32:x block b0: + %b0:p0:i32:x %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:i32 = add %b0:i1:i32 8:i32 diff --git a/examples/asmgen/simple_if.ir b/examples/asmgen/simple_if.ir index 2ced545..a2b22b4 100644 --- a/examples/asmgen/simple_if.ir +++ b/examples/asmgen/simple_if.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/asmgen/struct.ir b/examples/asmgen/struct.ir index 3bb47aa..3861106 100644 --- a/examples/asmgen/struct.ir +++ b/examples/asmgen/struct.ir @@ -1,5 +1,5 @@ -struct %t0 : { b:[4 x [5 x i32]] } struct %t1 : { a:i8, %anon:struct %t0, c:f64 } +struct %t0 : { b:[4 x [5 x i32]] } fun unit @init (i32, i32, [5 x i32]*) { init: @@ -12,6 +12,9 @@ init: %l4:i32:j block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:arr %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:[5 x i32]* %l2:[5 x i32]** diff --git a/examples/asmgen/struct3.ir b/examples/asmgen/struct3.ir index 023065e..94bc37e 100644 --- a/examples/asmgen/struct3.ir +++ b/examples/asmgen/struct3.ir @@ -1,5 +1,5 @@ -struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } struct Sub : { m1:i64, m2:i64, m3:i64, m4:i64 } +struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } fun struct Big @foo (struct Big) { init: @@ -9,6 +9,7 @@ init: %l1:struct Big:r block b0: + %b0:p0:struct Big:p1 %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* diff --git a/examples/asmgen/temp.ir b/examples/asmgen/temp.ir index bbcb6c8..64d2162 100644 --- a/examples/asmgen/temp.ir +++ b/examples/asmgen/temp.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* j b1() diff --git a/examples/ir0/array.ir b/examples/ir0/array.ir index 242bf1a..3673852 100644 --- a/examples/ir0/array.ir +++ b/examples/ir0/array.ir @@ -59,6 +59,8 @@ init: %l3:i32:i block b0: + %b0:p0:i32:len + %b0:p1:i32*:p %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32* %l1:i32** %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/ir0/array2.ir b/examples/ir0/array2.ir index d196857..2a4b3dd 100644 --- a/examples/ir0/array2.ir +++ b/examples/ir0/array2.ir @@ -10,6 +10,9 @@ init: %l4:i32:j block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:a %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:[5 x i32]* %l2:[5 x i32]** diff --git a/examples/ir0/array3.ir b/examples/ir0/array3.ir index 25000a0..1ae0155 100644 --- a/examples/ir0/array3.ir +++ b/examples/ir0/array3.ir @@ -6,6 +6,7 @@ init: %l0:i32*:a block b0: + %b0:p0:i32*:a %b0:i0:unit = store %b0:p0:i32* %l0:i32** %b0:i1:i32* = load %l0:i32** ret %b0:i1:i32* diff --git a/examples/ir0/bar.ir b/examples/ir0/bar.ir index f719fe0..5d87e3b 100644 --- a/examples/ir0/bar.ir +++ b/examples/ir0/bar.ir @@ -10,6 +10,9 @@ init: %l4:i32:ugly_mean block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/ir0/cmp.ir b/examples/ir0/cmp.ir index 39b994a..4f70e45 100644 --- a/examples/ir0/cmp.ir +++ b/examples/ir0/cmp.ir @@ -7,6 +7,8 @@ init: %l1:u8:j block b0: + %b0:p0:i8:i + %b0:p1:u8:j %b0:i0:unit = store %b0:p0:i8 %l0:i8* %b0:i1:unit = store %b0:p1:u8 %l1:u8* %b0:i2:i8 = load %l0:i8* @@ -40,6 +42,8 @@ init: %l1:u32:j block b0: + %b0:p0:i32:i + %b0:p1:u32:j %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:u32 %l1:u32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/ir0/fib2.ir b/examples/ir0/fib2.ir index 6be6cb2..db43f06 100644 --- a/examples/ir0/fib2.ir +++ b/examples/ir0/fib2.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/ir0/fib3.ir b/examples/ir0/fib3.ir index f1491a2..0863387 100644 --- a/examples/ir0/fib3.ir +++ b/examples/ir0/fib3.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/ir0/fib4.ir b/examples/ir0/fib4.ir index 5a81726..c8a20b2 100644 --- a/examples/ir0/fib4.ir +++ b/examples/ir0/fib4.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/ir0/fib5.ir b/examples/ir0/fib5.ir index 872f26b..ad88a79 100644 --- a/examples/ir0/fib5.ir +++ b/examples/ir0/fib5.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/ir0/fibonacci.ir b/examples/ir0/fibonacci.ir index 6be6cb2..db43f06 100644 --- a/examples/ir0/fibonacci.ir +++ b/examples/ir0/fibonacci.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/ir0/float.ir b/examples/ir0/float.ir index a0a6bce..611ee65 100644 --- a/examples/ir0/float.ir +++ b/examples/ir0/float.ir @@ -9,6 +9,8 @@ init: %l3:i32:i block b0: + %b0:p0:i32:len + %b0:p1:i32*:a %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32* %l1:i32** %b0:i2:unit = store 0:i32 %l2:i32* @@ -62,6 +64,7 @@ init: %l1:f64:t0 block b0: + %b0:p0:f64:a %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:f64 = load %l0:f64* %b0:i2:f64 = typecast 0:i32 to f64 @@ -96,6 +99,8 @@ init: %l2:f64:t0 block b0: + %b0:p0:f64:a + %b0:p1:f64:b %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:unit = store %b0:p1:f64 %l1:f64* %b0:i2:f64 = load %l0:f64* @@ -131,6 +136,10 @@ init: %l3:f64:abs_tol block b0: + %b0:p0:f64:a + %b0:p1:f64:b + %b0:p2:f64:rel_tol + %b0:p3:f64:abs_tol %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:unit = store %b0:p1:f64 %l1:f64* %b0:i2:unit = store %b0:p2:f64 %l2:f64* diff --git a/examples/ir0/foo.ir b/examples/ir0/foo.ir index a8726ad..8db5237 100644 --- a/examples/ir0/foo.ir +++ b/examples/ir0/foo.ir @@ -8,6 +8,9 @@ init: %l2:i32:z block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/ir0/foo3.ir b/examples/ir0/foo3.ir index 50e8495..f08e4f2 100644 --- a/examples/ir0/foo3.ir +++ b/examples/ir0/foo3.ir @@ -8,6 +8,8 @@ init: %l1:i32:j block b0: + %b0:p0:i32:i + %b0:p1:i32:j %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/ir0/foo4.ir b/examples/ir0/foo4.ir index fe10bc4..4314f2f 100644 --- a/examples/ir0/foo4.ir +++ b/examples/ir0/foo4.ir @@ -8,6 +8,9 @@ init: %l2:i32:k block b0: + %b0:p0:i32:i + %b0:p1:i32:j + %b0:p2:i32:k %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/ir0/gcd.ir b/examples/ir0/gcd.ir index b19f13e..45a5fcf 100644 --- a/examples/ir0/gcd.ir +++ b/examples/ir0/gcd.ir @@ -9,6 +9,8 @@ init: %l3:i32:t1 block b0: + %b0:p0:i32:a + %b0:p1:i32:b %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/ir0/negate.ir b/examples/ir0/negate.ir index 099d879..91f4281 100644 --- a/examples/ir0/negate.ir +++ b/examples/ir0/negate.ir @@ -8,6 +8,9 @@ init: %l2:i32:z block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/ir0/pointer.ir b/examples/ir0/pointer.ir index 0623614..4ad0cf7 100644 --- a/examples/ir0/pointer.ir +++ b/examples/ir0/pointer.ir @@ -6,6 +6,7 @@ init: %l0:i32*:a block b0: + %b0:p0:i32*:a %b0:i0:unit = store %b0:p0:i32* %l0:i32** %b0:i1:i32* = load %l0:i32** ret %b0:i1:i32* diff --git a/examples/ir0/simple_cond.ir b/examples/ir0/simple_cond.ir index 46d84a2..d468513 100644 --- a/examples/ir0/simple_cond.ir +++ b/examples/ir0/simple_cond.ir @@ -6,6 +6,7 @@ init: %l0:i32:x block b0: + %b0:p0:i32:x %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:i32 = add %b0:i1:i32 8:i32 diff --git a/examples/ir0/simple_if.ir b/examples/ir0/simple_if.ir index 2ced545..a2b22b4 100644 --- a/examples/ir0/simple_if.ir +++ b/examples/ir0/simple_if.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/ir0/struct.ir b/examples/ir0/struct.ir index 3bb47aa..0aa9a80 100644 --- a/examples/ir0/struct.ir +++ b/examples/ir0/struct.ir @@ -12,6 +12,9 @@ init: %l4:i32:j block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:arr %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:[5 x i32]* %l2:[5 x i32]** diff --git a/examples/ir0/struct2.ir b/examples/ir0/struct2.ir index a3f3ca2..253bff0 100644 --- a/examples/ir0/struct2.ir +++ b/examples/ir0/struct2.ir @@ -1,5 +1,5 @@ -struct %t0 : { b:[4 x i32] } struct %t1 : { a:i8, %anon:struct %t0, c:i64 } +struct %t0 : { b:[4 x i32] } fun i32 @main () { init: diff --git a/examples/ir0/struct3.ir b/examples/ir0/struct3.ir index 023065e..94bc37e 100644 --- a/examples/ir0/struct3.ir +++ b/examples/ir0/struct3.ir @@ -1,5 +1,5 @@ -struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } struct Sub : { m1:i64, m2:i64, m3:i64, m4:i64 } +struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } fun struct Big @foo (struct Big) { init: @@ -9,6 +9,7 @@ init: %l1:struct Big:r block b0: + %b0:p0:struct Big:p1 %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* diff --git a/examples/ir0/temp.ir b/examples/ir0/temp.ir index bbcb6c8..64d2162 100644 --- a/examples/ir0/temp.ir +++ b/examples/ir0/temp.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* j b1() diff --git a/examples/ir1/array.ir b/examples/ir1/array.ir index 9d904ad..9796e4f 100644 --- a/examples/ir1/array.ir +++ b/examples/ir1/array.ir @@ -50,6 +50,8 @@ init: %l3:i32:i block b0: + %b0:p0:i32:len + %b0:p1:i32*:p %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32* %l1:i32** %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/ir1/array2.ir b/examples/ir1/array2.ir index 122a07b..b6106be 100644 --- a/examples/ir1/array2.ir +++ b/examples/ir1/array2.ir @@ -10,6 +10,9 @@ init: %l4:i32:j block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:a %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:[5 x i32]* %l2:[5 x i32]** diff --git a/examples/ir1/array3.ir b/examples/ir1/array3.ir index ea508c9..c6fc4bf 100644 --- a/examples/ir1/array3.ir +++ b/examples/ir1/array3.ir @@ -6,6 +6,7 @@ init: %l0:i32*:a block b0: + %b0:p0:i32*:a %b0:i0:unit = store %b0:p0:i32* %l0:i32** %b0:i1:i32* = load %l0:i32** ret %b0:i1:i32* diff --git a/examples/ir1/bar.ir b/examples/ir1/bar.ir index 9b233f2..1a0d394 100644 --- a/examples/ir1/bar.ir +++ b/examples/ir1/bar.ir @@ -10,6 +10,9 @@ init: %l4:i32:ugly_mean block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/ir1/cmp.ir b/examples/ir1/cmp.ir index f40d9aa..a98e535 100644 --- a/examples/ir1/cmp.ir +++ b/examples/ir1/cmp.ir @@ -7,6 +7,8 @@ init: %l1:u8:j block b0: + %b0:p0:i8:i + %b0:p1:u8:j %b0:i0:unit = store %b0:p0:i8 %l0:i8* %b0:i1:unit = store %b0:p1:u8 %l1:u8* %b0:i2:i8 = load %l0:i8* @@ -31,6 +33,8 @@ init: %l1:u32:j block b0: + %b0:p0:i32:i + %b0:p1:u32:j %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:u32 %l1:u32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/ir1/fib2.ir b/examples/ir1/fib2.ir index 413bb1d..95f56e9 100644 --- a/examples/ir1/fib2.ir +++ b/examples/ir1/fib2.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/ir1/fib3.ir b/examples/ir1/fib3.ir index d882ffc..bde76b8 100644 --- a/examples/ir1/fib3.ir +++ b/examples/ir1/fib3.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/ir1/fib4.ir b/examples/ir1/fib4.ir index 4f5b3da..abdcb59 100644 --- a/examples/ir1/fib4.ir +++ b/examples/ir1/fib4.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/ir1/fib5.ir b/examples/ir1/fib5.ir index 772a7db..8522509 100644 --- a/examples/ir1/fib5.ir +++ b/examples/ir1/fib5.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store 0:i32 %l1:i32* %b0:i2:unit = store 0:i32 %l2:i32* diff --git a/examples/ir1/fibonacci.ir b/examples/ir1/fibonacci.ir index 413bb1d..95f56e9 100644 --- a/examples/ir1/fibonacci.ir +++ b/examples/ir1/fibonacci.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/ir1/float.ir b/examples/ir1/float.ir index 716c9ea..ee68aff 100644 --- a/examples/ir1/float.ir +++ b/examples/ir1/float.ir @@ -9,6 +9,8 @@ init: %l3:i32:i block b0: + %b0:p0:i32:len + %b0:p1:i32*:a %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32* %l1:i32** %b0:i2:unit = store 0:i32 %l2:i32* @@ -53,6 +55,7 @@ init: %l1:f64:t0 block b0: + %b0:p0:f64:a %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:f64 = load %l0:f64* %b0:i2:f64 = typecast 0:i32 to f64 @@ -84,6 +87,8 @@ init: %l2:f64:t0 block b0: + %b0:p0:f64:a + %b0:p1:f64:b %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:unit = store %b0:p1:f64 %l1:f64* %b0:i2:f64 = load %l0:f64* @@ -116,6 +121,10 @@ init: %l3:f64:abs_tol block b0: + %b0:p0:f64:a + %b0:p1:f64:b + %b0:p2:f64:rel_tol + %b0:p3:f64:abs_tol %b0:i0:unit = store %b0:p0:f64 %l0:f64* %b0:i1:unit = store %b0:p1:f64 %l1:f64* %b0:i2:unit = store %b0:p2:f64 %l2:f64* diff --git a/examples/ir1/foo.ir b/examples/ir1/foo.ir index c782898..0a0d592 100644 --- a/examples/ir1/foo.ir +++ b/examples/ir1/foo.ir @@ -8,6 +8,9 @@ init: %l2:i32:z block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/ir1/foo3.ir b/examples/ir1/foo3.ir index 007446b..5c974f8 100644 --- a/examples/ir1/foo3.ir +++ b/examples/ir1/foo3.ir @@ -8,6 +8,8 @@ init: %l1:i32:j block b0: + %b0:p0:i32:i + %b0:p1:i32:j %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/ir1/foo4.ir b/examples/ir1/foo4.ir index 3258669..6d0b894 100644 --- a/examples/ir1/foo4.ir +++ b/examples/ir1/foo4.ir @@ -8,6 +8,9 @@ init: %l2:i32:k block b0: + %b0:p0:i32:i + %b0:p1:i32:j + %b0:p2:i32:k %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/ir1/gcd.ir b/examples/ir1/gcd.ir index d11ff7a..86408e9 100644 --- a/examples/ir1/gcd.ir +++ b/examples/ir1/gcd.ir @@ -9,6 +9,8 @@ init: %l3:i32:t1 block b0: + %b0:p0:i32:a + %b0:p1:i32:b %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/ir1/negate.ir b/examples/ir1/negate.ir index 9dd9eac..663910d 100644 --- a/examples/ir1/negate.ir +++ b/examples/ir1/negate.ir @@ -8,6 +8,9 @@ init: %l2:i32:z block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:i32 %l2:i32* diff --git a/examples/ir1/pointer.ir b/examples/ir1/pointer.ir index d2bbddf..d65137d 100644 --- a/examples/ir1/pointer.ir +++ b/examples/ir1/pointer.ir @@ -6,6 +6,7 @@ init: %l0:i32*:a block b0: + %b0:p0:i32*:a %b0:i0:unit = store %b0:p0:i32* %l0:i32** %b0:i1:i32* = load %l0:i32** ret %b0:i1:i32* diff --git a/examples/ir1/simple_cond.ir b/examples/ir1/simple_cond.ir index f609b13..6a387ad 100644 --- a/examples/ir1/simple_cond.ir +++ b/examples/ir1/simple_cond.ir @@ -6,6 +6,7 @@ init: %l0:i32:x block b0: + %b0:p0:i32:x %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:i32 = add %b0:i1:i32 8:i32 diff --git a/examples/ir1/simple_if.ir b/examples/ir1/simple_if.ir index b4c8230..6de613b 100644 --- a/examples/ir1/simple_if.ir +++ b/examples/ir1/simple_if.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:u1 = cmp lt %b0:i1:i32 2:i32 diff --git a/examples/ir1/struct.ir b/examples/ir1/struct.ir index 4cdb9ea..550cf07 100644 --- a/examples/ir1/struct.ir +++ b/examples/ir1/struct.ir @@ -12,6 +12,9 @@ init: %l4:i32:j block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:arr %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:unit = store %b0:p1:i32 %l1:i32* %b0:i2:unit = store %b0:p2:[5 x i32]* %l2:[5 x i32]** diff --git a/examples/ir1/struct3.ir b/examples/ir1/struct3.ir index 72b4e67..81702b5 100644 --- a/examples/ir1/struct3.ir +++ b/examples/ir1/struct3.ir @@ -1,5 +1,5 @@ -struct Sub : { m1:i64, m2:i64, m3:i64, m4:i64 } struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } +struct Sub : { m1:i64, m2:i64, m3:i64, m4:i64 } fun struct Big @foo (struct Big) { init: @@ -9,6 +9,7 @@ init: %l1:struct Big:r block b0: + %b0:p0:struct Big:p1 %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* diff --git a/examples/ir1/temp.ir b/examples/ir1/temp.ir index 91ed6c1..2cf2385 100644 --- a/examples/ir1/temp.ir +++ b/examples/ir1/temp.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = store %b0:p0:i32 %l0:i32* %b0:i1:i32 = load %l0:i32* %b0:i2:i32 = load %l0:i32* diff --git a/examples/ir2/array.ir b/examples/ir2/array.ir index ee464fd..9803593 100644 --- a/examples/ir2/array.ir +++ b/examples/ir2/array.ir @@ -51,6 +51,8 @@ init: %l3:i32:i block b0: + %b0:p0:i32:len + %b0:p1:i32*:p %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/array2.ir b/examples/ir2/array2.ir index 259252d..c86d49a 100644 --- a/examples/ir2/array2.ir +++ b/examples/ir2/array2.ir @@ -10,6 +10,9 @@ init: %l4:i32:j block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:a %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/array3.ir b/examples/ir2/array3.ir index d389124..b742391 100644 --- a/examples/ir2/array3.ir +++ b/examples/ir2/array3.ir @@ -6,6 +6,7 @@ init: %l0:i32*:a block b0: + %b0:p0:i32*:a %b0:i0:unit = nop %b0:i1:unit = nop ret %b0:p0:i32* diff --git a/examples/ir2/bar.ir b/examples/ir2/bar.ir index c735475..fa7abc7 100644 --- a/examples/ir2/bar.ir +++ b/examples/ir2/bar.ir @@ -10,6 +10,9 @@ init: %l4:i32:ugly_mean block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/cmp.ir b/examples/ir2/cmp.ir index 8ec10a3..ebf34b1 100644 --- a/examples/ir2/cmp.ir +++ b/examples/ir2/cmp.ir @@ -7,6 +7,8 @@ init: %l1:u8:j block b0: + %b0:p0:i8:i + %b0:p1:u8:j %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop @@ -31,6 +33,8 @@ init: %l1:u32:j block b0: + %b0:p0:i32:i + %b0:p1:u32:j %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/fib2.ir b/examples/ir2/fib2.ir index 35a5638..728399d 100644 --- a/examples/ir2/fib2.ir +++ b/examples/ir2/fib2.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:u1 = cmp lt %b0:p0:i32 2:i32 diff --git a/examples/ir2/fib3.ir b/examples/ir2/fib3.ir index fe872f1..9543732 100644 --- a/examples/ir2/fib3.ir +++ b/examples/ir2/fib3.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/fib4.ir b/examples/ir2/fib4.ir index 18c2a6b..7d84cf8 100644 --- a/examples/ir2/fib4.ir +++ b/examples/ir2/fib4.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/fib5.ir b/examples/ir2/fib5.ir index dbbb1d5..7ae3579 100644 --- a/examples/ir2/fib5.ir +++ b/examples/ir2/fib5.ir @@ -10,6 +10,7 @@ init: %l4:i32:next_term block b0: + %b0:p0:i32:n %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/fibonacci.ir b/examples/ir2/fibonacci.ir index 35a5638..728399d 100644 --- a/examples/ir2/fibonacci.ir +++ b/examples/ir2/fibonacci.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:u1 = cmp lt %b0:p0:i32 2:i32 diff --git a/examples/ir2/float.ir b/examples/ir2/float.ir index e8f24b6..b070d44 100644 --- a/examples/ir2/float.ir +++ b/examples/ir2/float.ir @@ -9,6 +9,8 @@ init: %l3:i32:i block b0: + %b0:p0:i32:len + %b0:p1:i32*:a %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop @@ -55,6 +57,7 @@ init: %l1:f64:t0 block b0: + %b0:p0:f64:a %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:f64 = typecast 0:i32 to f64 @@ -87,6 +90,8 @@ init: %l2:f64:t0 block b0: + %b0:p0:f64:a + %b0:p1:f64:b %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop @@ -120,6 +125,10 @@ init: %l3:f64:abs_tol block b0: + %b0:p0:f64:a + %b0:p1:f64:b + %b0:p2:f64:rel_tol + %b0:p3:f64:abs_tol %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/foo.ir b/examples/ir2/foo.ir index 75f34b2..fee92e4 100644 --- a/examples/ir2/foo.ir +++ b/examples/ir2/foo.ir @@ -8,6 +8,9 @@ init: %l2:i32:z block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/foo3.ir b/examples/ir2/foo3.ir index 469b10d..a4cd96b 100644 --- a/examples/ir2/foo3.ir +++ b/examples/ir2/foo3.ir @@ -8,6 +8,8 @@ init: %l1:i32:j block b0: + %b0:p0:i32:i + %b0:p1:i32:j %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/foo4.ir b/examples/ir2/foo4.ir index 55f5106..53527d7 100644 --- a/examples/ir2/foo4.ir +++ b/examples/ir2/foo4.ir @@ -8,6 +8,9 @@ init: %l2:i32:k block b0: + %b0:p0:i32:i + %b0:p1:i32:j + %b0:p2:i32:k %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/gcd.ir b/examples/ir2/gcd.ir index c74cfdb..c07f1b2 100644 --- a/examples/ir2/gcd.ir +++ b/examples/ir2/gcd.ir @@ -9,6 +9,8 @@ init: %l3:i32:t1 block b0: + %b0:p0:i32:a + %b0:p1:i32:b %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/negate.ir b/examples/ir2/negate.ir index 57bcec0..a28101e 100644 --- a/examples/ir2/negate.ir +++ b/examples/ir2/negate.ir @@ -8,6 +8,9 @@ init: %l2:i32:z block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/pointer.ir b/examples/ir2/pointer.ir index f96f16d..b328e3c 100644 --- a/examples/ir2/pointer.ir +++ b/examples/ir2/pointer.ir @@ -6,6 +6,7 @@ init: %l0:i32*:a block b0: + %b0:p0:i32*:a %b0:i0:unit = nop %b0:i1:unit = nop ret %b0:p0:i32* diff --git a/examples/ir2/simple_cond.ir b/examples/ir2/simple_cond.ir index 7a8ee6f..a878231 100644 --- a/examples/ir2/simple_cond.ir +++ b/examples/ir2/simple_cond.ir @@ -6,6 +6,7 @@ init: %l0:i32:x block b0: + %b0:p0:i32:x %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:i32 = add %b0:p0:i32 8:i32 diff --git a/examples/ir2/simple_if.ir b/examples/ir2/simple_if.ir index 8691d17..48d09ac 100644 --- a/examples/ir2/simple_if.ir +++ b/examples/ir2/simple_if.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:u1 = cmp lt %b0:p0:i32 2:i32 diff --git a/examples/ir2/struct.ir b/examples/ir2/struct.ir index d5875fc..3fd8b7c 100644 --- a/examples/ir2/struct.ir +++ b/examples/ir2/struct.ir @@ -1,5 +1,5 @@ -struct %t1 : { a:i8, %anon:struct %t0, c:f64 } struct %t0 : { b:[4 x [5 x i32]] } +struct %t1 : { a:i8, %anon:struct %t0, c:f64 } fun unit @init (i32, i32, [5 x i32]*) { init: @@ -12,6 +12,9 @@ init: %l4:i32:j block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:arr %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir2/struct3.ir b/examples/ir2/struct3.ir index ae3b940..8d426b1 100644 --- a/examples/ir2/struct3.ir +++ b/examples/ir2/struct3.ir @@ -9,6 +9,7 @@ init: %l1:struct Big:r block b0: + %b0:p0:struct Big:p1 %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = store %b0:p0:struct Big %l1:struct Big* diff --git a/examples/ir2/temp.ir b/examples/ir2/temp.ir index 843dcb0..1d18ee5 100644 --- a/examples/ir2/temp.ir +++ b/examples/ir2/temp.ir @@ -6,6 +6,7 @@ init: %l0:i32:n block b0: + %b0:p0:i32:n %b0:i0:unit = nop %b0:i1:unit = nop %b0:i2:unit = nop diff --git a/examples/ir3/array.ir b/examples/ir3/array.ir index 113f686..4430248 100644 --- a/examples/ir3/array.ir +++ b/examples/ir3/array.ir @@ -37,6 +37,8 @@ init: block b0: + %b0:p0:i32:len + %b0:p1:i32*:p j b2(0:i32, 0:i32) block b2: diff --git a/examples/ir3/array2.ir b/examples/ir3/array2.ir index 4917151..974aa52 100644 --- a/examples/ir3/array2.ir +++ b/examples/ir3/array2.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:a j b2(0:i32) block b2: diff --git a/examples/ir3/array3.ir b/examples/ir3/array3.ir index 3a392c0..ef1c005 100644 --- a/examples/ir3/array3.ir +++ b/examples/ir3/array3.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32*:a ret %b0:p0:i32* } diff --git a/examples/ir3/bar.ir b/examples/ir3/bar.ir index f3b123d..5e2cbe0 100644 --- a/examples/ir3/bar.ir +++ b/examples/ir3/bar.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:u1 = cmp eq %b0:p0:i32 %b0:p1:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir3/cmp.ir b/examples/ir3/cmp.ir index 52c6066..718609f 100644 --- a/examples/ir3/cmp.ir +++ b/examples/ir3/cmp.ir @@ -6,6 +6,8 @@ init: block b0: + %b0:p0:i8:i + %b0:p1:u8:j %b0:i0:i32 = typecast %b0:p0:i8 to i32 %b0:i1:i32 = typecast %b0:p1:u8 to i32 %b0:i2:u1 = cmp gt %b0:i0:i32 %b0:i1:i32 @@ -25,6 +27,8 @@ init: block b0: + %b0:p0:i32:i + %b0:p1:u32:j %b0:i0:u32 = typecast %b0:p0:i32 to u32 %b0:i1:u1 = cmp gt %b0:i0:u32 %b0:p1:u32 br %b0:i1:u1, b1(), b2() diff --git a/examples/ir3/fib2.ir b/examples/ir3/fib2.ir index 471e23b..04ee26d 100644 --- a/examples/ir3/fib2.ir +++ b/examples/ir3/fib2.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir3/fib3.ir b/examples/ir3/fib3.ir index 9d57d54..e36bb46 100644 --- a/examples/ir3/fib3.ir +++ b/examples/ir3/fib3.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir3/fib4.ir b/examples/ir3/fib4.ir index 750541f..49cfcb2 100644 --- a/examples/ir3/fib4.ir +++ b/examples/ir3/fib4.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir3/fib5.ir b/examples/ir3/fib5.ir index a585ba8..f61fe34 100644 --- a/examples/ir3/fib5.ir +++ b/examples/ir3/fib5.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir3/fibonacci.ir b/examples/ir3/fibonacci.ir index 471e23b..04ee26d 100644 --- a/examples/ir3/fibonacci.ir +++ b/examples/ir3/fibonacci.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir3/float.ir b/examples/ir3/float.ir index 38589ec..357b96d 100644 --- a/examples/ir3/float.ir +++ b/examples/ir3/float.ir @@ -6,6 +6,8 @@ init: block b0: + %b0:p0:i32:len + %b0:p1:i32*:a j b2(0:i32, 0:i32) block b2: @@ -37,6 +39,7 @@ init: block b0: + %b0:p0:f64:a %b0:i0:f64 = typecast 0:i32 to f64 %b0:i1:u1 = cmp lt %b0:p0:f64 %b0:i0:f64 br %b0:i1:u1, b1(), b2() @@ -60,6 +63,8 @@ init: block b0: + %b0:p0:f64:a + %b0:p1:f64:b %b0:i0:u1 = cmp gt %b0:p0:f64 %b0:p1:f64 br %b0:i0:u1, b1(), b2() @@ -81,6 +86,10 @@ init: block b0: + %b0:p0:f64:a + %b0:p1:f64:b + %b0:p2:f64:rel_tol + %b0:p3:f64:abs_tol %b0:i0:f64 = sub %b0:p0:f64 %b0:p1:f64 %b0:i1:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:i0:f64) %b0:i2:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:p0:f64) diff --git a/examples/ir3/foo.ir b/examples/ir3/foo.ir index 23ff0e6..363bff6 100644 --- a/examples/ir3/foo.ir +++ b/examples/ir3/foo.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:u1 = cmp eq %b0:p0:i32 %b0:p1:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir3/foo3.ir b/examples/ir3/foo3.ir index 63039af..b94e727 100644 --- a/examples/ir3/foo3.ir +++ b/examples/ir3/foo3.ir @@ -7,6 +7,8 @@ init: block b0: + %b0:p0:i32:i + %b0:p1:i32:j %b0:i0:i32 = add %b0:p0:i32 %b0:p1:i32 %b0:i1:i32 = load @g:i32* %b0:i2:i32 = add %b0:i0:i32 %b0:i1:i32 diff --git a/examples/ir3/foo4.ir b/examples/ir3/foo4.ir index 77b6b29..70745af 100644 --- a/examples/ir3/foo4.ir +++ b/examples/ir3/foo4.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:i + %b0:p1:i32:j + %b0:p2:i32:k %b0:i0:i32 = add %b0:p0:i32 %b0:p1:i32 %b0:i1:i32 = add %b0:i0:i32 %b0:p2:i32 ret %b0:i1:i32 diff --git a/examples/ir3/gcd.ir b/examples/ir3/gcd.ir index 240d2ba..6cd9bb9 100644 --- a/examples/ir3/gcd.ir +++ b/examples/ir3/gcd.ir @@ -6,6 +6,8 @@ init: block b0: + %b0:p0:i32:a + %b0:p1:i32:b %b0:i0:u1 = cmp gt %b0:p0:i32 0:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir3/negate.ir b/examples/ir3/negate.ir index dae6f10..a0848c3 100644 --- a/examples/ir3/negate.ir +++ b/examples/ir3/negate.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:u1 = cmp eq %b0:p0:i32 %b0:p1:i32 %b0:i1:u1 = negate %b0:i0:u1 br %b0:i1:u1, b1(), b2() diff --git a/examples/ir3/pointer.ir b/examples/ir3/pointer.ir index bf597a7..3e9bb88 100644 --- a/examples/ir3/pointer.ir +++ b/examples/ir3/pointer.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32*:a ret %b0:p0:i32* } diff --git a/examples/ir3/simple_cond.ir b/examples/ir3/simple_cond.ir index 1031884..7dc642b 100644 --- a/examples/ir3/simple_cond.ir +++ b/examples/ir3/simple_cond.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:x %b0:i0:i32 = add %b0:p0:i32 8:i32 ret %b0:i0:i32 } diff --git a/examples/ir3/simple_if.ir b/examples/ir3/simple_if.ir index 07c3a1b..475a71f 100644 --- a/examples/ir3/simple_if.ir +++ b/examples/ir3/simple_if.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b3(%b0:p0:i32) diff --git a/examples/ir3/struct.ir b/examples/ir3/struct.ir index 28e8151..651acd7 100644 --- a/examples/ir3/struct.ir +++ b/examples/ir3/struct.ir @@ -1,5 +1,5 @@ -struct %t1 : { a:i8, %anon:struct %t0, c:f64 } struct %t0 : { b:[4 x [5 x i32]] } +struct %t1 : { a:i8, %anon:struct %t0, c:f64 } fun unit @init (i32, i32, [5 x i32]*) { init: @@ -8,6 +8,9 @@ init: block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:arr j b2(0:i32) block b2: diff --git a/examples/ir3/struct2.ir b/examples/ir3/struct2.ir index d1c1273..1f2f45b 100644 --- a/examples/ir3/struct2.ir +++ b/examples/ir3/struct2.ir @@ -1,5 +1,5 @@ -struct %t0 : { b:[4 x i32] } struct %t1 : { a:i8, %anon:struct %t0, c:i64 } +struct %t0 : { b:[4 x i32] } fun i32 @main () { init: diff --git a/examples/ir3/struct3.ir b/examples/ir3/struct3.ir index 2180d76..5d1c289 100644 --- a/examples/ir3/struct3.ir +++ b/examples/ir3/struct3.ir @@ -1,5 +1,5 @@ -struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } struct Sub : { m1:i64, m2:i64, m3:i64, m4:i64 } +struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } fun struct Big @foo (struct Big) { init: @@ -8,6 +8,7 @@ init: %l0:struct Big:r block b0: + %b0:p0:struct Big:p1 %b0:i0:unit = store %b0:p0:struct Big %l0:struct Big* %b0:i1:struct Sub* = getelementptr %l0:struct Big* offset 0:i64 %b0:i2:i64* = getelementptr %b0:i1:struct Sub* offset 0:i64 diff --git a/examples/ir3/temp.ir b/examples/ir3/temp.ir index 911eea7..b2487b1 100644 --- a/examples/ir3/temp.ir +++ b/examples/ir3/temp.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:i32 = add %b0:p0:i32 %b0:p0:i32 %b0:i1:u1 = cmp ne %b0:i0:i32 0:i32 br %b0:i1:u1, b2(), b3() diff --git a/examples/ir4/array.ir b/examples/ir4/array.ir index 113f686..4430248 100644 --- a/examples/ir4/array.ir +++ b/examples/ir4/array.ir @@ -37,6 +37,8 @@ init: block b0: + %b0:p0:i32:len + %b0:p1:i32*:p j b2(0:i32, 0:i32) block b2: diff --git a/examples/ir4/array2.ir b/examples/ir4/array2.ir index 0781e00..a33c89c 100644 --- a/examples/ir4/array2.ir +++ b/examples/ir4/array2.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:a j b2(0:i32) block b2: diff --git a/examples/ir4/array3.ir b/examples/ir4/array3.ir index 3a392c0..ef1c005 100644 --- a/examples/ir4/array3.ir +++ b/examples/ir4/array3.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32*:a ret %b0:p0:i32* } diff --git a/examples/ir4/bar.ir b/examples/ir4/bar.ir index f3b123d..5e2cbe0 100644 --- a/examples/ir4/bar.ir +++ b/examples/ir4/bar.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:u1 = cmp eq %b0:p0:i32 %b0:p1:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir4/cmp.ir b/examples/ir4/cmp.ir index f1f6cda..32596f7 100644 --- a/examples/ir4/cmp.ir +++ b/examples/ir4/cmp.ir @@ -6,6 +6,8 @@ init: block b0: + %b0:p0:i8:i + %b0:p1:u8:j %b0:i0:i32 = typecast %b0:p0:i8 to i32 %b0:i1:i32 = typecast %b0:p1:u8 to i32 %b0:i2:u1 = cmp gt %b0:i0:i32 %b0:i1:i32 @@ -25,6 +27,8 @@ init: block b0: + %b0:p0:i32:i + %b0:p1:u32:j %b0:i0:u32 = typecast %b0:p0:i32 to u32 %b0:i1:u1 = cmp gt %b0:i0:u32 %b0:p1:u32 br %b0:i1:u1, b1(), b2() diff --git a/examples/ir4/fib2.ir b/examples/ir4/fib2.ir index 471e23b..04ee26d 100644 --- a/examples/ir4/fib2.ir +++ b/examples/ir4/fib2.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir4/fib3.ir b/examples/ir4/fib3.ir index 9d57d54..e36bb46 100644 --- a/examples/ir4/fib3.ir +++ b/examples/ir4/fib3.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir4/fib4.ir b/examples/ir4/fib4.ir index 750541f..49cfcb2 100644 --- a/examples/ir4/fib4.ir +++ b/examples/ir4/fib4.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir4/fib5.ir b/examples/ir4/fib5.ir index a585ba8..f61fe34 100644 --- a/examples/ir4/fib5.ir +++ b/examples/ir4/fib5.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir4/fibonacci.ir b/examples/ir4/fibonacci.ir index 471e23b..04ee26d 100644 --- a/examples/ir4/fibonacci.ir +++ b/examples/ir4/fibonacci.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir4/float.ir b/examples/ir4/float.ir index 38589ec..357b96d 100644 --- a/examples/ir4/float.ir +++ b/examples/ir4/float.ir @@ -6,6 +6,8 @@ init: block b0: + %b0:p0:i32:len + %b0:p1:i32*:a j b2(0:i32, 0:i32) block b2: @@ -37,6 +39,7 @@ init: block b0: + %b0:p0:f64:a %b0:i0:f64 = typecast 0:i32 to f64 %b0:i1:u1 = cmp lt %b0:p0:f64 %b0:i0:f64 br %b0:i1:u1, b1(), b2() @@ -60,6 +63,8 @@ init: block b0: + %b0:p0:f64:a + %b0:p1:f64:b %b0:i0:u1 = cmp gt %b0:p0:f64 %b0:p1:f64 br %b0:i0:u1, b1(), b2() @@ -81,6 +86,10 @@ init: block b0: + %b0:p0:f64:a + %b0:p1:f64:b + %b0:p2:f64:rel_tol + %b0:p3:f64:abs_tol %b0:i0:f64 = sub %b0:p0:f64 %b0:p1:f64 %b0:i1:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:i0:f64) %b0:i2:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:p0:f64) diff --git a/examples/ir4/foo.ir b/examples/ir4/foo.ir index ab37961..d802871 100644 --- a/examples/ir4/foo.ir +++ b/examples/ir4/foo.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:u1 = cmp eq %b0:p0:i32 %b0:p1:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir4/foo3.ir b/examples/ir4/foo3.ir index 63039af..b94e727 100644 --- a/examples/ir4/foo3.ir +++ b/examples/ir4/foo3.ir @@ -7,6 +7,8 @@ init: block b0: + %b0:p0:i32:i + %b0:p1:i32:j %b0:i0:i32 = add %b0:p0:i32 %b0:p1:i32 %b0:i1:i32 = load @g:i32* %b0:i2:i32 = add %b0:i0:i32 %b0:i1:i32 diff --git a/examples/ir4/foo4.ir b/examples/ir4/foo4.ir index 77b6b29..70745af 100644 --- a/examples/ir4/foo4.ir +++ b/examples/ir4/foo4.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:i + %b0:p1:i32:j + %b0:p2:i32:k %b0:i0:i32 = add %b0:p0:i32 %b0:p1:i32 %b0:i1:i32 = add %b0:i0:i32 %b0:p2:i32 ret %b0:i1:i32 diff --git a/examples/ir4/gcd.ir b/examples/ir4/gcd.ir index 240d2ba..6cd9bb9 100644 --- a/examples/ir4/gcd.ir +++ b/examples/ir4/gcd.ir @@ -6,6 +6,8 @@ init: block b0: + %b0:p0:i32:a + %b0:p1:i32:b %b0:i0:u1 = cmp gt %b0:p0:i32 0:i32 br %b0:i0:u1, b1(), b2() diff --git a/examples/ir4/negate.ir b/examples/ir4/negate.ir index dae6f10..a0848c3 100644 --- a/examples/ir4/negate.ir +++ b/examples/ir4/negate.ir @@ -6,6 +6,9 @@ init: block b0: + %b0:p0:i32:x + %b0:p1:i32:y + %b0:p2:i32:z %b0:i0:u1 = cmp eq %b0:p0:i32 %b0:p1:i32 %b0:i1:u1 = negate %b0:i0:u1 br %b0:i1:u1, b1(), b2() diff --git a/examples/ir4/pointer.ir b/examples/ir4/pointer.ir index bf597a7..3e9bb88 100644 --- a/examples/ir4/pointer.ir +++ b/examples/ir4/pointer.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32*:a ret %b0:p0:i32* } diff --git a/examples/ir4/simple_cond.ir b/examples/ir4/simple_cond.ir index 1031884..7dc642b 100644 --- a/examples/ir4/simple_cond.ir +++ b/examples/ir4/simple_cond.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:x %b0:i0:i32 = add %b0:p0:i32 8:i32 ret %b0:i0:i32 } diff --git a/examples/ir4/simple_if.ir b/examples/ir4/simple_if.ir index 07c3a1b..475a71f 100644 --- a/examples/ir4/simple_if.ir +++ b/examples/ir4/simple_if.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:u1 = cmp lt %b0:p0:i32 2:i32 br %b0:i0:u1, b1(), b3(%b0:p0:i32) diff --git a/examples/ir4/struct.ir b/examples/ir4/struct.ir index f5fede8..651acd7 100644 --- a/examples/ir4/struct.ir +++ b/examples/ir4/struct.ir @@ -8,6 +8,9 @@ init: block b0: + %b0:p0:i32:row + %b0:p1:i32:col + %b0:p2:[5 x i32]*:arr j b2(0:i32) block b2: diff --git a/examples/ir4/struct3.ir b/examples/ir4/struct3.ir index 7a4eb1a..60e07fe 100644 --- a/examples/ir4/struct3.ir +++ b/examples/ir4/struct3.ir @@ -1,5 +1,5 @@ -struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } struct Sub : { m1:i64, m2:i64, m3:i64, m4:i64 } +struct Big : { m1:struct Sub, m2:struct Sub, m3:struct Sub } fun struct Big @foo (struct Big) { init: @@ -8,6 +8,7 @@ init: %l0:struct Big:r block b0: + %b0:p0:struct Big:p1 %b0:i0:unit = store %b0:p0:struct Big %l0:struct Big* %b0:i1:struct Sub* = getelementptr %l0:struct Big* offset 0:i64 %b0:i2:i64* = getelementptr %b0:i1:struct Sub* offset 0:i64 diff --git a/examples/ir4/temp.ir b/examples/ir4/temp.ir index 911eea7..b2487b1 100644 --- a/examples/ir4/temp.ir +++ b/examples/ir4/temp.ir @@ -6,6 +6,7 @@ init: block b0: + %b0:p0:i32:n %b0:i0:i32 = add %b0:p0:i32 %b0:p0:i32 %b0:i1:u1 = cmp ne %b0:i0:i32 0:i32 br %b0:i1:u1, b2(), b3()