Fixup module renaming

This commit is contained in:
Justin Ethier 2016-05-16 23:41:23 -04:00
parent 86fb869c5a
commit dad7a459ce
4 changed files with 24 additions and 16 deletions

View file

@ -104,7 +104,7 @@ bootstrap: icyc
cp icyc.scm $(BOOTSTRAP_DIR) cp icyc.scm $(BOOTSTRAP_DIR)
cp tests/unit-tests.scm $(BOOTSTRAP_DIR) cp tests/unit-tests.scm $(BOOTSTRAP_DIR)
cp scheme/cyclone/ast.c $(BOOTSTRAP_DIR)/scheme/cyclone cp scheme/cyclone/ast.c $(BOOTSTRAP_DIR)/scheme/cyclone
cp scheme/cyclone/optimize-cps.c $(BOOTSTRAP_DIR)/scheme/cyclone cp scheme/cyclone/cps-optimizations.c $(BOOTSTRAP_DIR)/scheme/cyclone
cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone
cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone
cp scheme/cyclone/pretty-print.c $(BOOTSTRAP_DIR)/scheme/cyclone cp scheme/cyclone/pretty-print.c $(BOOTSTRAP_DIR)/scheme/cyclone

View file

@ -18,7 +18,7 @@
(scheme cyclone util) (scheme cyclone util)
(scheme cyclone cgen) (scheme cyclone cgen)
(scheme cyclone transforms) (scheme cyclone transforms)
(scheme cyclone cps-optimizations) ; (scheme cyclone cps-optimizations)
(scheme cyclone macros) (scheme cyclone macros)
(scheme cyclone libraries)) (scheme cyclone libraries))
@ -222,11 +222,6 @@
(trace:info "---------------- after CPS:") (trace:info "---------------- after CPS:")
(trace:info input-program) ;pretty-print (trace:info input-program) ;pretty-print
;; TODO: do not run this if eval is in play, or (better) only do opts that are safe in that case (will be much more limited)
;; because of this, programs such as icyc can only be so optimized. it would be much more beneficial if modules like
;; eval.scm could be compiled separately and then linked to by a program such as icyc.scm. that would save a *lot* of compile
;; time. in fact, it might be more beneficial than adding these optimizations.
;; ;;
;; TODO: run CPS optimization (not all of these phases may apply) ;; TODO: run CPS optimization (not all of these phases may apply)
;; phase 1 - constant folding, function-argument expansion, beta-contraction of functions called once, ;; phase 1 - constant folding, function-argument expansion, beta-contraction of functions called once,
@ -240,9 +235,10 @@
;; TODO: re-run phases again until program is stable (less than n opts made, more than r rounds performed, etc) ;; TODO: re-run phases again until program is stable (less than n opts made, more than r rounds performed, etc)
;; END CPS optimization ;; END CPS optimization
(analyze-cps input-program) ; (set! input-program
(trace:info "---------------- cps analysis db:") ; (optimize-cps input-program))
(trace:info (adb:get-db)) ; (trace:info "---------------- after cps optimizations:")
; (trace:info input-program)
; (set! input-program ; (set! input-program
; (map ; (map

View file

@ -26,6 +26,7 @@
(srfi 69)) (srfi 69))
(export (export
analyze-cps analyze-cps
opt:contract
;adb:init! ;adb:init!
adb:get adb:get
adb:get/default adb:get/default
@ -81,11 +82,6 @@
(define (adb:make-fnc) (define (adb:make-fnc)
(%adb:make-fnc '? '?)) (%adb:make-fnc '? '?))
(define (analyze-cps exp)
(analyze exp -1) ;; Top-level is lambda ID -1
(analyze2 exp) ;; Second pass
)
(define (analyze exp lid) (define (analyze exp lid)
;(tre:error `(analyze ,lid ,exp)) ;(tre:error `(analyze ,lid ,exp))
(cond (cond
@ -230,4 +226,20 @@
formals) formals)
(not (any-nonlocal-refs? id formals)) (not (any-nonlocal-refs? id formals))
))) )))
;; Perform contraction phase of CPS optimizations
(define (opt:contract ast)
ast) ;'TODO)
(define (analyze-cps exp)
(analyze exp -1) ;; Top-level is lambda ID -1
(analyze2 exp) ;; Second pass
)
(define (optimize-cps ast)
(analyze-cps input-program)
(trace:info "---------------- cps analysis db:")
(trace:info (adb:get-db))
(opt:contract ast)
)
)) ))

View file

@ -19,7 +19,7 @@
(scheme cyclone common) (scheme cyclone common)
(scheme cyclone libraries) (scheme cyclone libraries)
(scheme cyclone macros) (scheme cyclone macros)
(scheme cyclone optimize-cps) ;(scheme cyclone optimize-cps)
(scheme cyclone pretty-print) (scheme cyclone pretty-print)
(scheme cyclone util) (scheme cyclone util)
) )