mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 23:18:48 +00:00
Update ir examples
This commit is contained in:
@@ -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*
|
||||
|
||||
@@ -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]**
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]**
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user