mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-04 03:36:34 +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)
|
||||
;(trace:error `(DEBUG ,param ,(adbv:ref-by var)))
|
||||
(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
|
||||
;; called for side effects, possibly on a global
|
||||
(not (null? (adbv:ref-by var)))
|
||||
|
|
Loading…
Add table
Reference in a new issue