freenode/#sbcl - IRC Chatlog
Search
17:12:08
karlosz
i was worried that the locall optimization would be limited in use but examples like (labels ((f (x y) ...) (g (z w) ...) (cond ((...) (f 5 6)) ((...) (f 2 9)) ((...) (g 193 3)) ((...) (g 5 91)))) have convinced me that its worthwhile to do it for general functions, not just ones that tail call themselves
17:14:59
karlosz
right, i haven't looked into how to optimize functions which have to be local themselves, only on how to eliminate them
17:21:47
stassats
but there probably not a lot of leaf global functions which also don't use any stack space
17:27:14
karlosz
the only problem is that leaf functions are less common on x86 because of less registers
17:31:53
stassats
a function that only tail calls basically becomes the same as the callee (and you don't see it in the backtrace)
17:33:35
karlosz
i would pick off the local case first because that messes less with global call conventions
17:34:09
karlosz
and local leafs should be easy to recognize in IR1 - the tools are in locall.lisp alreadty
17:35:34
karlosz
it's low priority in the local case anyway - would shave off a few bytes here and there
17:47:49
karlosz
even that's not so obvious. the full call could be much more expensive than the local call
17:50:15
karlosz
the point is that i think ir2 vops are pretty much as high level as you can get for any good policy heuristic
17:51:01
karlosz
but what if some other big local function mentions those closure vars in the parent fnuction
17:52:30
karlosz
anyway, it sounds harder to do right than just rewiring local calls which are called multiple times but only return in one place, since that always reduces code size
17:53:17
karlosz
maybe it would be useful to have those heuristics anyway, since they could apply to global functions
18:01:06
stassats
(flet ((f (x) x)) (f 1) (f 2)) is derived as (integer 1 2), while we know it to be (integer 2 2)
18:03:32
stassats
suppose we have a lot of time to waste, and inline each local function, use that inline expansion only to derive the type
19:23:00
pkhuong
we need to insert type derivation in constraint, and start with an aggressive assumption that local functions don't return
22:37:12
g_o
hey im working on the alien struct bug thing and wrote a function that should work, but got really stuck: i want to insert the call at alien-funcall on the target but there are several definitions, some are deftransform that are on the host part... can anyone help me understand how it decides where to go from define-alien-routine for example? sorry im a noob
0:26:50
g_o
karlosz: simply put, i have (deftransform alien-funcall ...) on src/compiler/aliencomp.lisp and (defun alien-funcall ...) on target-alieneval.lisp; and i can't seem to invoke the one on target-alieneval from userland
0:28:18
g_o
i've changed something there, that depends on sb-alien; so the other alternative is trying to use target sb-alien stuff from sb-c host which sounds bad..
0:32:16
g_o
haha sorry about the slang, by userland i mean when i run-sbcl.sh and try to call an alien routine
0:33:50
g_o
karlosz: well the thing is, i debug printed both, and the only print i got was from there; so in one way or another it gets there, and either my other debug print didn't update for some reason, or it really isn't called
0:46:28
minion
There are multiple help modules. Try ``/msg minion help kind'', where kind is one of: "lookups", "helping others", "adding terms", "aliasing terms", "forgetting", "memos", "avoiding memos", "nicknames", "goodies", "eliza", "advice", "apropos", "acronyms".
0:48:15
g_o
minion: memo for karlosz: thanks for trying I'll find a better way to phrase my question tommorow
2:25:14
pkhuong
adlai: the halting problem is equivalent to asking if the type of a function is the empty type. any time we consider tighter flow analyses / abstract interpretation in the presence of loops or recursion, non termination is an obvious challenge