enabled debug-scc flag for debugging the scc pass of the compiler
(not useful for casual users)
This commit is contained in:
parent
2a0e53dcb0
commit
5e02972e7f
|
@ -19,7 +19,7 @@
|
||||||
assembler-output optimize-cp
|
assembler-output optimize-cp
|
||||||
current-primitive-locations eval-core
|
current-primitive-locations eval-core
|
||||||
current-core-eval compile-core-expr
|
current-core-eval compile-core-expr
|
||||||
expand expand/optimize optimizer-output
|
expand expand/optimize expand/scc-letrec optimizer-output
|
||||||
cp0-effort-limit cp0-size-limit optimize-level
|
cp0-effort-limit cp0-size-limit optimize-level
|
||||||
perform-tag-analysis tag-analysis-output
|
perform-tag-analysis tag-analysis-output
|
||||||
strip-source-info generate-debug-calls)
|
strip-source-info generate-debug-calls)
|
||||||
|
@ -31,11 +31,11 @@
|
||||||
(only (ikarus system $structs) $struct-ref $struct/rtd?)
|
(only (ikarus system $structs) $struct-ref $struct/rtd?)
|
||||||
(except (ikarus)
|
(except (ikarus)
|
||||||
optimize-level debug-optimizer
|
optimize-level debug-optimizer
|
||||||
fasl-write scc-letrec optimize-cp
|
fasl-write optimize-cp
|
||||||
compile-core-expr-to-port assembler-output
|
compile-core-expr-to-port assembler-output
|
||||||
current-primitive-locations eval-core
|
current-primitive-locations eval-core
|
||||||
cp0-size-limit cp0-effort-limit
|
cp0-size-limit cp0-effort-limit
|
||||||
expand/optimize expand optimizer-output
|
expand/optimize expand/scc-letrec expand optimizer-output
|
||||||
tag-analysis-output perform-tag-analysis
|
tag-analysis-output perform-tag-analysis
|
||||||
current-core-eval)
|
current-core-eval)
|
||||||
(ikarus include)
|
(ikarus include)
|
||||||
|
@ -853,6 +853,7 @@
|
||||||
body)
|
body)
|
||||||
|#
|
|#
|
||||||
|
|
||||||
|
(define debug-scc (make-parameter #f))
|
||||||
|
|
||||||
(define (optimize-letrec/scc x)
|
(define (optimize-letrec/scc x)
|
||||||
(define who 'optimize-letrec/scc)
|
(define who 'optimize-letrec/scc)
|
||||||
|
@ -932,7 +933,8 @@
|
||||||
(let* ([b (car b*)]
|
(let* ([b (car b*)]
|
||||||
[lhs (binding-lhs b)])
|
[lhs (binding-lhs b)])
|
||||||
(unless (prelex-source-assigned? lhs)
|
(unless (prelex-source-assigned? lhs)
|
||||||
;(printf "MADE COMPLEX ~s\n" (unparse lhs))
|
(when (debug-scc)
|
||||||
|
(printf "MADE COMPLEX ~s\n" (unparse lhs)))
|
||||||
(set-prelex-source-assigned?! lhs
|
(set-prelex-source-assigned?! lhs
|
||||||
(or (prelex-global-location lhs) #t)))
|
(or (prelex-global-location lhs) #t)))
|
||||||
(make-seq
|
(make-seq
|
||||||
|
@ -1011,12 +1013,13 @@
|
||||||
(let ([body (E body bc)])
|
(let ([body (E body bc)])
|
||||||
(when ordered? (insert-order-edges b*))
|
(when ordered? (insert-order-edges b*))
|
||||||
(let ([scc* (get-sccs-in-order b* (map binding-free* b*) b*)])
|
(let ([scc* (get-sccs-in-order b* (map binding-free* b*) b*)])
|
||||||
;(printf "SCCS:\n")
|
(when (debug-scc)
|
||||||
;(for-each
|
(printf "SCCS:\n")
|
||||||
; (lambda (scc)
|
(for-each
|
||||||
; (printf " ~s\n"
|
(lambda (scc)
|
||||||
; (map unparse (map binding-lhs scc))))
|
(printf " ~s\n"
|
||||||
; scc*)
|
(map unparse (map binding-lhs scc))))
|
||||||
|
scc*))
|
||||||
(gen-letrecs scc* ordered? body)))))
|
(gen-letrecs scc* ordered? body)))))
|
||||||
(define (sort-bindings ls)
|
(define (sort-bindings ls)
|
||||||
(list-sort
|
(list-sort
|
||||||
|
@ -2503,6 +2506,19 @@
|
||||||
(unparse-pretty x)
|
(unparse-pretty x)
|
||||||
(f ((car passes) x) (cdr passes))))))
|
(f ((car passes) x) (cdr passes))))))
|
||||||
|
|
||||||
|
|
||||||
|
(define expand/scc-letrec
|
||||||
|
(case-lambda
|
||||||
|
[(x) (expand/scc-letrec x (interaction-environment))]
|
||||||
|
[(x env)
|
||||||
|
(expand/pretty x env 'expand/scc-letrec
|
||||||
|
(lambda (x)
|
||||||
|
(parameterize ([open-mvcalls #f])
|
||||||
|
(optimize-direct-calls x)))
|
||||||
|
(lambda (x)
|
||||||
|
(parameterize ([debug-scc #t])
|
||||||
|
(optimize-letrec/scc x))))]))
|
||||||
|
|
||||||
(define expand/optimize
|
(define expand/optimize
|
||||||
(case-lambda
|
(case-lambda
|
||||||
[(x) (expand/optimize x (interaction-environment))]
|
[(x) (expand/optimize x (interaction-environment))]
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1805
|
1807
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
(import (except (ikarus)
|
(import (except (ikarus)
|
||||||
current-core-eval
|
current-core-eval
|
||||||
assembler-output optimize-cp optimize-level
|
assembler-output optimize-cp optimize-level
|
||||||
cp0-size-limit cp0-effort-limit expand/optimize expand
|
cp0-size-limit cp0-effort-limit expand/optimize
|
||||||
|
expand/scc-letrec expand
|
||||||
optimizer-output tag-analysis-output perform-tag-analysis))
|
optimizer-output tag-analysis-output perform-tag-analysis))
|
||||||
(import (ikarus.compiler))
|
(import (ikarus.compiler))
|
||||||
(import (except (psyntax system $bootstrap)
|
(import (except (psyntax system $bootstrap)
|
||||||
|
@ -388,6 +389,7 @@
|
||||||
[expand i]
|
[expand i]
|
||||||
[core-expand i]
|
[core-expand i]
|
||||||
[expand/optimize i]
|
[expand/optimize i]
|
||||||
|
[expand/scc-letrec i]
|
||||||
[environment? i]
|
[environment? i]
|
||||||
[environment-symbols i]
|
[environment-symbols i]
|
||||||
[time-it i]
|
[time-it i]
|
||||||
|
|
Loading…
Reference in New Issue