Prepare for Spring 2025.

This commit is contained in:
Janggun Lee
2025-02-24 17:31:17 +09:00
parent a8e0aa5e69
commit fad9d02fea
53 changed files with 3442 additions and 1679 deletions

19
examples/opt/lost_copy.ir Normal file
View File

@@ -0,0 +1,19 @@
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
j b1(0:i32)
block b1:
%b1:p0:i32:i
%b1:i0:i32 = add %b1:p0:i32 1:i32
%b1:i1:u1 = cmp lt %b1:i0:i32 4:i32
br %b1:i1:u1, b1(%b1:i0:i32), b3()
block b3:
ret %b1:p0:i32
}

View File

@@ -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:

View File

@@ -1,5 +1,5 @@
struct %t1 : { a:i8, %anon:struct %t0, c:i64 }
struct %t0 : { b:[4 x i32] }
struct %t1 : { a:i8, %anon:struct %t0, c:i64 }
fun i32 @main () {
init:

21
examples/opt/swap.ir Normal file
View File

@@ -0,0 +1,21 @@
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
j b1(1:i32, 2:i32)
block b1:
%b1:p0:i32:a
%b1:p1:i32:b
%b1:i0:u1 = cmp eq %b1:p0:i32 1:i32
br %b1:i0:u1, b1(%b1:p1:i32, %b1:p0:i32), b3()
block b3:
%b3:i0:i32 = mul %b1:p1:i32 10:i32
%b3:i1:i32 = add %b3:i0:i32 %b1:p0:i32
ret %b3:i1:i32
}