diff --git a/cyclone.scm b/cyclone.scm index 3bca24ff..142a39e1 100644 --- a/cyclone.scm +++ b/cyclone.scm @@ -222,30 +222,10 @@ (trace:info "---------------- after CPS:") (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". some of this is already done in previous phases. we will leave - ;; that alone for now -; (set! input-program (cps-opt:contractions input-program)) - ;; 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 (optimize-cps input-program)) (trace:info "---------------- after cps optimizations:") (trace:info input-program) - -; (set! input-program -; (map -; cps-optimize-01 -; input-program)) -; (trace:info "---------------- after cps optimizations:") -; (trace:info input-program) ;pretty-print (set! input-program (map diff --git a/scheme/cyclone/cps-optimizations.sld b/scheme/cyclone/cps-optimizations.sld index 101ddf74..24188da1 100644 --- a/scheme/cyclone/cps-optimizations.sld +++ b/scheme/cyclone/cps-optimizations.sld @@ -270,6 +270,19 @@ (analyze2 exp) ;; Second pass ) + ;; NOTES: + ;; + ;; 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". some of this is already done in previous phases. we will leave + ;; that alone for now + ;; 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 notes + (define (optimize-cps ast) (analyze-cps ast) (trace:info "---------------- cps analysis db:")