Skip to content

Commit

Permalink
Add some regression data
Browse files Browse the repository at this point in the history
  • Loading branch information
Delaunay committed Apr 1, 2024
1 parent ec3eb65 commit bdcb46a
Show file tree
Hide file tree
Showing 42 changed files with 724 additions and 259 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ imgui.ini

.vscode/
dependencies/icu
out.txt
out.txt

code/llvm/current/*.ll
11 changes: 11 additions & 0 deletions code/llvm/AnnAssign_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun() -> bool:
; a: bool = True
; return a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i1 @fun() {
entry:
ret i1 true
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/AnnAssign_1.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun() -> i32:
; a: i32 = 1
; return a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun() {
entry:
ret i32 1
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/Assign_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(b: i32) -> i32:
; a = b
; return a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %b) {
entry:
ret i32 %b
ret void
}
12 changes: 12 additions & 0 deletions code/llvm/AugAssign_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; def fun(a: i32, b: i32) -> i32:
; a += b
; return a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a, i32 %b) {
entry:
%addtmp = add i32 %b, %a
ret i32 %addtmp
ret void
}
12 changes: 12 additions & 0 deletions code/llvm/AugAssign_1.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; def fun(a: i32, b: i32) -> i32:
; a -= b
; return a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a, i32 %b) {
entry:
%subtmp = sub i32 %a, %b
ret i32 %subtmp
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/BinOp_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(a: f64, b: f64) -> f64:
; return a + b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define double @fun(double %a, double %b) {
entry:
%addtmp = fadd double %a, %b
ret double %addtmp
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/BinOp_1.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(a: f64, b: f64) -> f64:
; return a - b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define double @fun(double %a, double %b) {
entry:
%subtmp = fsub double %a, %b
ret double %subtmp
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/BinOp_2.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(a: f64, b: f64) -> f64:
; return a * b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define double @fun(double %a, double %b) {
entry:
%multtmp = fmul double %a, %b
ret double %multtmp
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/BinOp_3.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(a: i32, b: i32) -> i32:
; return a << b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a, i32 %b) {
entry:
%addtmp = lshr i32 %a, %b
ret i32 %addtmp
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/BinOp_4.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(a: i32, b: i32) -> i32:
; return a ^ b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a, i32 %b) {
entry:
%bitxortmp = xor i32 %b, %a
ret i32 %bitxortmp
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/BoolOp_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(a: bool, b: bool) -> bool:
; return a and b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i1 @fun(i1 %a, i1 %b) {
entry:
%andtmp = and i1 %a, %b
ret i1 %andtmp
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/BoolOp_1.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(a: bool, b: bool) -> bool:
; return a or b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i1 @fun(i1 %a, i1 %b) {
entry:
%ortmp = or i1 %a, %b
ret i1 %ortmp
ret void
}
12 changes: 12 additions & 0 deletions code/llvm/BoolOp_2.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; def fun(a: bool, b: bool, c: bool) -> bool:
; return a or b or c
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i1 @fun(i1 %a, i1 %b, i1 %c) {
entry:
%ortmp = or i1 %a, %b
%ortmp7 = or i1 %ortmp, %c
ret i1 %ortmp7
ret void
}
21 changes: 21 additions & 0 deletions code/llvm/Call_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; def myfunction(a: f64, b: f64) -> f64:
; return a + b
;
; def fun():
; return myfunction(1.0, 2.0)
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define double @myfunction(double %a, double %b) {
entry:
%addtmp = fadd double %a, %b
ret double %addtmp
ret void
}

define void @fun() {
entry:
%calltmp = call double @myfunction(double 1.000000e+00, double 2.000000e+00)
ret double %calltmp
ret void
}
15 changes: 15 additions & 0 deletions code/llvm/Compare_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; def fun(a: i32, b: i32, c: i32, d: i32) -> bool:
; return a < b > c != d
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i1 @fun(i32 %a, i32 %b, i32 %c, i32 %d) {
entry:
%0 = icmp slt i32 %a, %b
%1 = icmp sgt i32 %b, %c
%2 = icmp ne i32 %c, %d
%3 = and i1 %0, %1
%4 = and i1 %3, %2
ret i1 %4
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/Constant_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun():
; return 1
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun() {
entry:
ret i32 1
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/Constant_1.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun():
; return 2.1
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun() {
entry:
ret double 2.100000e+00
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/Constant_2.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun():
; return None
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun() {
entry:
ret void
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/Constant_3.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun():
; return True
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun() {
entry:
ret i1 true
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/Constant_4.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun():
; return False
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun() {
entry:
ret i1 false
ret void
}
9 changes: 9 additions & 0 deletions code/llvm/Delete_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; def fun(a: i32, b: i32):
; del a, b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun(i32 %a, i32 %b) {
entry:
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/DictExpr_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun():
; return {1: 2, 3: 4}
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun() {
entry:
ret void
ret void
}
12 changes: 12 additions & 0 deletions code/llvm/IfExp_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; def fun(a: i32, b: i32) -> i32:
; return a if True else b
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a, i32 %b) {
entry:
%a1 = alloca i32, align 4
store i32 %a, ptr %a1, align 4
ret i32 %a
ret void
}
18 changes: 18 additions & 0 deletions code/llvm/If_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; def fun(a: bool, b: bool) -> f64:
; if a:
; return 0.0
; elif b:
; return 1.0
; else:
; return 3.0
; return 2.0
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define double @fun(i1 %a, i1 %b) {
entry:
%b2 = alloca i1, align 1
store i1 %b, ptr %b2, align 1
ret double 2.000000e+00
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/Name_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun(a: i32) -> i32:
; return a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a) {
entry:
ret i32 %a
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/NamedExpr_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun(c: i32):
; return a := c
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun(i32 %c) {
entry:
ret i32 %c
ret void
}
9 changes: 9 additions & 0 deletions code/llvm/Pass_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; def fun():
; pass
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun() {
entry:
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/Return_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun(a: i32) -> i32:
; return a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a) {
entry:
ret i32 %a
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/SetExpr_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun():
; return {1, 2}
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define void @fun() {
entry:
ret void
ret void
}
10 changes: 10 additions & 0 deletions code/llvm/UnaryOp_0.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; def fun(a: i32) -> i32:
; return + a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a) {
entry:
ret i32 %a
ret void
}
11 changes: 11 additions & 0 deletions code/llvm/UnaryOp_1.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; def fun(a: i32) -> i32:
; return - a
; ModuleID = 'KiwiJIT'
source_filename = "KiwiJIT"

define i32 @fun(i32 %a) {
entry:
%subtmp = sub i32 0, %a
ret i32 %subtmp
ret void
}
Loading

0 comments on commit bdcb46a

Please sign in to comment.