mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-05 12:16:35 +02:00
If param is referenced in a loop (but defined outside) do not inline function into the loop
This commit is contained in:
parent
a2aa321356
commit
be25f055f0
1 changed files with 4 additions and 0 deletions
|
@ -864,6 +864,10 @@
|
||||||
(with-var param (lambda (var)
|
(with-var param (lambda (var)
|
||||||
;(trace:error `(DEBUG ,param ,(adbv:ref-by var)))
|
;(trace:error `(DEBUG ,param ,(adbv:ref-by var)))
|
||||||
(and
|
(and
|
||||||
|
;; If param is referenced in a loop (but defined outside)
|
||||||
|
;; do not inline function into the loop
|
||||||
|
(or (not (adbv:ref-in-loop? var))
|
||||||
|
(adbv:def-in-loop? var))
|
||||||
;; If param is never referenced, then prim is being
|
;; If param is never referenced, then prim is being
|
||||||
;; called for side effects, possibly on a global
|
;; called for side effects, possibly on a global
|
||||||
(not (null? (adbv:ref-by var)))
|
(not (null? (adbv:ref-by var)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue