diff --git a/scheme/cyclone/primitives.sld b/scheme/cyclone/primitives.sld index 69ad3928..ac639960 100644 --- a/scheme/cyclone/primitives.sld +++ b/scheme/cyclone/primitives.sld @@ -912,6 +912,11 @@ prim-call))) ;; Map from a Scheme function to a primitive, if possible. + ;; + ;; Inputs: + ;; - Function symbol + ;; - Number of arguments to the function + ;; ;; Note the only reason to do this is to change from a CPS-style ;; function to one that can be inlined with no CPS, which yields ;; a significant speed improvement. diff --git a/scheme/cyclone/transforms.sld b/scheme/cyclone/transforms.sld index 65b32f7a..3f11e6f5 100644 --- a/scheme/cyclone/transforms.sld +++ b/scheme/cyclone/transforms.sld @@ -1194,24 +1194,6 @@ ;; are renamed and if expressions always have an else clause. ;; (define (prim-convert expr) - ;; Map from a given function call to a primitive call, if possible - ;; Inputs: - ;; - Function symbol - ;; - Number of arguments to the function - (define (func->prim/exact-args func-sym num-args) - (define mappings - '( - (char=? 2 Cyc-fast-char-eq ) - (char>? 2 Cyc-fast-char-gt ) - (char=? 2 Cyc-fast-char-gte) - (char<=? 2 Cyc-fast-char-lte) - )) - (let ((m (assoc func-sym mappings))) - ;(trace:error `(func->prim/exact-args ,func-sym ,num-args ,m)) - (cond - ((and m (= (cadr m) num-args)) (caddr m)) ;; Upgrade to a primitive - (else func-sym)))) ;; Remain a function (define (conv ast) (cond ((const? ast) ast) @@ -1240,7 +1222,7 @@ ((app? ast) (cond ((ref? (car ast)) - `( ,(func->prim/exact-args (car ast) (- (length ast) 1)) + `( ,(prim:func->prim (car ast) (- (length ast) 1)) ,@(cdr ast))) (else (map conv ast))))