From 0fca39ef2e982b7db8a14a428b7d9fda49e6c5ce Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Mon, 2 Dec 2024 18:34:48 +0000 Subject: [PATCH] add benchmarks --- benchmarks/heuristics.lisp | 11 +++++++++++ benchmarks/new_leaf.lisp | 5 +++++ benchmarks/prop_constants_simple.lisp | 4 ++++ config.json | 12 ++---------- 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 benchmarks/heuristics.lisp create mode 100644 benchmarks/new_leaf.lisp create mode 100644 benchmarks/prop_constants_simple.lisp diff --git a/benchmarks/heuristics.lisp b/benchmarks/heuristics.lisp new file mode 100644 index 0000000..2d3bef1 --- /dev/null +++ b/benchmarks/heuristics.lisp @@ -0,0 +1,11 @@ +(define (g x y a b) (< (+ x y) (- a b))) +(define (f x) (+ x 3)) +(print (let ((z (f 4))) ( + pair (g 1 2 3 4) ( + pair (g 1 2 3 4) ( + pair (g 1 2 3 4) ( + pair (g 1 2 3 4) ( + pair (g 1 2 3 4) ( + pair (g 1 2 3 4) ( + pair (g 1 2 3 4) () +))))))))) diff --git a/benchmarks/new_leaf.lisp b/benchmarks/new_leaf.lisp new file mode 100644 index 0000000..9a9ccf7 --- /dev/null +++ b/benchmarks/new_leaf.lisp @@ -0,0 +1,5 @@ +(define (g x y) (+ (f x) (f y))) +(define (f x) (+ x 3)) +(print (let ((z -1)) ( + if (= (g z z) 4) (+ z 3) (+ z (- (+ 1 3) 5)) +))) diff --git a/benchmarks/prop_constants_simple.lisp b/benchmarks/prop_constants_simple.lisp new file mode 100644 index 0000000..d30edc4 --- /dev/null +++ b/benchmarks/prop_constants_simple.lisp @@ -0,0 +1,4 @@ +(define (f x) (+ x 3)) +(print (let ((z -1)) ( + if (= (f z) 2) (+ z 3) (+ z (- (+ 1 3) 5)) +))) diff --git a/config.json b/config.json index 073ee94..2049e60 100644 --- a/config.json +++ b/config.json @@ -1,19 +1,11 @@ { "No optimizations": [], - "Inlining": [ - "uniquify-variables", - "inline" + "Constant Propagation": [ + "propagate-constants" ], "Constant propagation and inlining": [ "uniquify-variables", "inline", "propagate-constants" - ], - "All optimizations": [ - "uniquify-variables", - "inline", - "propagate-constants", - "eliminate-common-subexpressions", - "peephole" ] } \ No newline at end of file