diff --git a/benchmarks/constant-inlining.lisp b/benchmarks/constant-inlining.lisp new file mode 100644 index 0000000..7f6bca5 --- /dev/null +++ b/benchmarks/constant-inlining.lisp @@ -0,0 +1,6 @@ +(define (g y) + (- y (+ y (- y (+ 5 (+ y (+ y (- y y)))))))) + +(print + (let ((y 8)) + (g (g y)))) diff --git a/benchmarks/constant-prop.lisp b/benchmarks/constant-prop.lisp new file mode 100644 index 0000000..26f4f64 --- /dev/null +++ b/benchmarks/constant-prop.lisp @@ -0,0 +1,7 @@ +(let ((a 7)) + (let ((b 12)) + (let ((c 9)) + (print (+ a (- b (+ c (- 8 (+ b (- a (- c (+ b (- a (+ c 15)))))))))) + ) + ) +)) diff --git a/benchmarks/inlining.lisp b/benchmarks/inlining.lisp new file mode 100644 index 0000000..65a95b9 --- /dev/null +++ b/benchmarks/inlining.lisp @@ -0,0 +1,8 @@ +(define (f1 x) (+ x 5)) +(define (f2 x) (* (f1 x) 2)) +(define (f3 x) (- (f2 x) (f1 x))) +(define (f4 x) (/ (f3 x) 3)) + +(print + (let ((x 10)) + (f4 (f3 (f2 (f1 x))))))