Make function for adding vars to unboxed vars table.
This commit is contained in:
parent
3cab38845e
commit
7af7dea078
|
@ -130,7 +130,7 @@
|
|||
(for ((v (in-syntax #'(opt-candidates.id ...)))
|
||||
(r (in-syntax #'(opt-candidates.real-binding ...)))
|
||||
(i (in-syntax #'(opt-candidates.imag-binding ...))))
|
||||
(dict-set! unboxed-vars-table v (list r i v)))]
|
||||
(add-unboxed-var! v r i))]
|
||||
;; in the case where no bindings are unboxed, we create a let
|
||||
;; that is equivalent to the original, but with all parts optimized
|
||||
#:with opt (quasisyntax/loc/origin
|
||||
|
@ -274,10 +274,7 @@
|
|||
body.opt ...))]
|
||||
[(memq i to-unbox)
|
||||
;; we unbox the current param, add to the table
|
||||
(dict-set! unboxed-vars-table (car params)
|
||||
(list (car real-parts)
|
||||
(car imag-parts)
|
||||
(car params)))
|
||||
(add-unboxed-var! (car params) (car real-parts) (car imag-parts))
|
||||
(loop (cdr params) (add1 i)
|
||||
(cdr real-parts) (cdr imag-parts)
|
||||
boxed)]
|
||||
|
|
|
@ -5,14 +5,18 @@
|
|||
(utils tc-utils))
|
||||
|
||||
(provide
|
||||
unboxed-vars-table
|
||||
unboxed-funs-table
|
||||
add-unboxed-var!
|
||||
unboxed-var)
|
||||
|
||||
;; contains the bindings which actually exist as separate bindings for each component
|
||||
;; associates identifiers to lists (real-binding imag-binding orig-binding-occurrence)
|
||||
(define unboxed-vars-table (make-free-id-table))
|
||||
|
||||
(define (add-unboxed-var! orig-binding real-binding imag-binding)
|
||||
(dict-set! unboxed-vars-table orig-binding
|
||||
(list real-binding imag-binding orig-binding)))
|
||||
|
||||
(define-syntax-class unboxed-var
|
||||
#:attributes (real-binding imag-binding)
|
||||
(pattern v:id
|
||||
|
|
Loading…
Reference in New Issue
Block a user