mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
WIP - smarter inline analysis of vector-set
This commit is contained in:
parent
62a8110647
commit
a12ef15559
1 changed files with 11 additions and 5 deletions
|
@ -582,6 +582,7 @@
|
||||||
;; is what is mutated
|
;; is what is mutated
|
||||||
(cond
|
(cond
|
||||||
((and (prim:mutates? (car exp))
|
((and (prim:mutates? (car exp))
|
||||||
|
;; loop3-dev WIP step #1 - do not immediately reject these prims
|
||||||
(not (member (car exp) '(vector-set!))) ;; TODO: experimental
|
(not (member (car exp) '(vector-set!))) ;; TODO: experimental
|
||||||
)
|
)
|
||||||
(let ((e (cadr exp)))
|
(let ((e (cadr exp)))
|
||||||
|
@ -1279,11 +1280,16 @@
|
||||||
(if (not (ref? e))
|
(if (not (ref? e))
|
||||||
(inline-ok? e ivars args arg-used return)))
|
(inline-ok? e ivars args arg-used return)))
|
||||||
(reverse (cdr exp))))
|
(reverse (cdr exp))))
|
||||||
TODO: add a new cond here
|
;; loop3-dev WIP step #2 - some args can be safely ignored
|
||||||
;; TODO: if mutates, can we check to see if there are any "safe" params which we
|
((and (prim? (car exp))
|
||||||
;; can safely ignore? for example, on vector-set! we know only the vec arg is being mutated,
|
(prim:mutates? (car exp))
|
||||||
;; so ivars in other positions can be ignored
|
(member (car exp) '(vector-set!))
|
||||||
(else
|
)
|
||||||
|
;; with vector-set, only arg 1 (the vector) is actually mutated
|
||||||
|
;; TODO: is this always true? do we have problems with self-recursive vecs??
|
||||||
|
(inline-ok? (cadr exp) ivars args arg-used return)
|
||||||
|
)
|
||||||
|
(else
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (e)
|
(lambda (e)
|
||||||
(inline-ok? e ivars args arg-used return))
|
(inline-ok? e ivars args arg-used return))
|
||||||
|
|
Loading…
Add table
Reference in a new issue