mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
peval: Add tests for inlining with both static & dynamic arguments.
* module/language/tree-il/optimize.scm (peval): Improve comment on the inlining heuristics. * test-suite/tests/tree-il.test ("partial evaluation"): Add two tests.
This commit is contained in:
parent
870dfc609b
commit
1e8ace33d1
2 changed files with 35 additions and 3 deletions
|
@ -251,9 +251,10 @@ it should be called before `fix-letrec'."
|
|||
(args (map (cut loop <> env calls) orig-args))
|
||||
(args* (map maybe-unconst orig-args args))
|
||||
(app (make-application src proc args*)))
|
||||
;; If ARGS are constants and this call hasn't already been
|
||||
;; expanded before (to avoid infinite recursion), then
|
||||
;; expand it (todo: emit an infinite recursion warning.)
|
||||
;; If at least one of ARGS is static (to avoid infinite
|
||||
;; inlining) and this call hasn't already been expanded
|
||||
;; before (to avoid infinite recursion), then expand it
|
||||
;; (todo: emit an infinite recursion warning.)
|
||||
(if (and (any const*? args)
|
||||
(not (member (cons proc args) calls)))
|
||||
(match proc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue