mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Added stub for CPS optimizations
This commit is contained in:
parent
f8036a7ee8
commit
caf6f85c7c
1 changed files with 12 additions and 0 deletions
12
cyclone.scm
12
cyclone.scm
|
@ -81,6 +81,18 @@
|
||||||
(trace:info "---------------- after CPS:")
|
(trace:info "---------------- after CPS:")
|
||||||
(trace:info input-program) ;pretty-print
|
(trace:info input-program) ;pretty-print
|
||||||
|
|
||||||
|
|
||||||
|
;; TODO: run CPS optimization (not all of these phases may apply)
|
||||||
|
;; phase 1 - constant folding, function-argument expansion, beta-contraction of functions called once,
|
||||||
|
;; and other "contractions"
|
||||||
|
;; phase 2 - beta expansion
|
||||||
|
;; phase 3 - eta reduction
|
||||||
|
;; phase 4 - hoisting
|
||||||
|
;; phase 5 - common subexpression elimination
|
||||||
|
;; TODO: re-run phases again until program is stable (less than n opts made, more than r rounds performed, etc)
|
||||||
|
;; END CPS optimization
|
||||||
|
|
||||||
|
|
||||||
(set! input-program
|
(set! input-program
|
||||||
(map
|
(map
|
||||||
(lambda (expr)
|
(lambda (expr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue