#| -*-Scheme-*-
-$Id: rtlty1.scm,v 4.21 1993/07/01 03:25:47 gjr Exp $
+$Id: rtlty1.scm,v 4.22 1999/01/02 02:52:22 cph Exp $
Copyright (c) 1987-1993 Massachusetts Institute of Technology
(define-rtl-predicate eq-test % expression-1 expression-2)
(define-rtl-predicate type-test % expression type)
+;; General predicates
+(define-rtl-predicate pred-1-arg % predicate operand)
+(define-rtl-predicate pred-2-args % predicate operand-1 operand-2)
+
(define-rtl-predicate overflow-test rtl:)
(define-rtl-statement assign % address expression)
/* -*-C-*-
-$Id: ppband.c,v 9.47 1993/10/14 21:42:03 gjr Exp $
+$Id: ppband.c,v 9.48 1999/01/02 02:52:37 cph Exp $
Copyright (c) 1987-1993 Massachusetts Institute of Technology
}
NON_POINTER ("NULL");
- case TC_TRUE:
+ case TC_CONSTANT:
if (The_Datum == 0)
{
printf ("#T\n");
#| -*-Scheme-*-
-$Id: lapgn3.scm,v 1.3 1994/11/26 19:59:00 gjr Exp $
+$Id: lapgn3.scm,v 1.4 1999/01/02 02:52:51 cph Exp $
Copyright (c) 1987-1992 Massachusetts Institute of Technology
counts)))
+;; These belong in the runtime system
+
(define (compiled-code-block/read-profile-count block count)
block
count
#| -*-Scheme-*-
-$Id: simplify.scm,v 1.19 1996/07/30 19:25:02 adams Exp $
+$Id: simplify.scm,v 1.20 1999/01/02 02:52:46 cph Exp $
Copyright (c) 1994-1995 Massachusetts Institute of Technology
(do-simplification env0 #T bindings* body* simplify/letrecify)))
(define-simplifier LETREC (env bindings body)
- (let* ((frame (map (lambda (binding) (simplify/binding/make (car binding)))
+ (let* ((n-bindings (length bindings))
+ (frame (map (lambda (binding) (simplify/binding/make (car binding)))
bindings))
(env0 (simplify/env/make env frame))
(body* (simplify/expr env0 body)))
- (let ((bindings* '())
- (initial-queue (map cons frame bindings)))
+ (let ((bindings* (make-vector n-bindings))
+ (initial-queue (map cons* frame (iota n-bindings) bindings)))
(define (finish unused)
- (let ((bindings*
- (map* bindings*
- (lambda (bnd+var+exp)
- (list false (second bnd+var+exp) (third bnd+var+exp)))
- unused)))
- (let ((x
- (do-simplification env0 #T bindings* body* simplify/letrecify)))
- x)))
+ (define (insert! elt)
+ (vector-set! bindings*
+ (second elt)
+ (list false (third elt) (fourth elt))))
+ (for-each insert! unused)
+ (do-simplification env0 #T (vector->list bindings*)
+ body* simplify/letrecify))
;; We scan a queue of bindings to check. If a binding is referenced, add
;; it to the set. If it is unreferenced, put it in a retry
(null? (simplify/binding/ordinary-refs (car head))))
(loop rest (cons head retry) found-one?)
(begin
- (set! bindings*
- (cons (simplify/binding&value env0 (second head) (third head))
- bindings*))
+ (vector-set! bindings*
+ (second head)
+ (simplify/binding&value env0 (third head) (fourth head)))
(loop (cdr queue) retry #T)))))))))
+
(define (simplify/binding&value env name value)
(if (not (LAMBDA/? value))
(list false name (simplify/expr env value))
#| -*-Scheme-*-
-$Id: rtlpars.scm,v 1.3 1994/12/16 20:18:34 adams Exp $
+$Id: rtlpars.scm,v 1.4 1999/01/02 02:52:56 cph Exp $
Copyright (c) 1994 Massachusetts Institute of Technology
unspecific))
\f
(define (link-up! slot labels->segments)
- (define (find-bblock label)
+ (define (find-bblock label seen)
(let ((desc (hash-table/get labels->segments label false)))
(if (not desc)
(internal-error "Missing label" label))
- (if (eq? (car desc) 'EMPTY)
- (find-bblock (cadr desc))
+ (if (and (eq? (car desc) 'EMPTY)
+ (not (memq label seen)))
+ (find-bblock (cadr desc) (cons label seen))
(caddr desc))))
(if (not (eq? (car slot) 'EMPTY))
((not (pair? next))
(create-edge! bblock
set-snode-next-edge!
- (find-bblock next)))
+ (find-bblock next '())))
(else
(create-edge! bblock
set-pnode-consequent-edge!
- (find-bblock (car next)))
+ (find-bblock (car next) '()))
(create-edge! bblock
set-pnode-alternative-edge!
- (find-bblock (cadr next))))))))
+ (find-bblock (cadr next) '())))))))
\f
(define-macro (%push! object collection)
`(begin (set! ,collection (cons ,object ,collection))