mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Removed dead code, consolidated comments
This commit is contained in:
parent
41ec8c5750
commit
308bba3c9b
2 changed files with 13 additions and 20 deletions
20
cyclone.scm
20
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
|
||||
|
|
|
@ -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:")
|
||||
|
|
Loading…
Add table
Reference in a new issue