freenode/#sbcl - IRC Chatlog
Search
17:47:24
karlosz
i can't tell if assignment lambdas were an afterthought or if it actually is a real dichotomy for the compiler
17:48:15
karlosz
does anyone happen to know if let converted lambdas and assignment lambdas are transparent for data flow analysis?
17:48:49
karlosz
the lambdas still exist in IR1, but it seems like when they are let converted, there is some amount of rewiring going on
17:50:43
karlosz
even though f isn't used only once, it can still be 'let-converted' because the tail recursive call becomes a direct link
17:53:38
karlosz
the comment in maybe-convert-to-assignment suggests that https://paste.gnome.org/p1wxpcqlf can similarly be optimized
17:55:37
karlosz
thats what the ML people call contification, since you basically turn lambdas into normal control flow edges, so you can do data flow analysis better
17:56:02
karlosz
because we don't do data flow for higher order functions. that's a hard problem that requires k-CFA
17:57:06
karlosz
i modified M-C-T-A to work on that case, but i got some bad averrals that don't expect the newly assigned lambdas when i try to self build
18:00:08
stassats
they don't get optimized based on the arguments, their type get mingled in tail-sets, they use the same amount of stack space as the main frame and cause the main frame to use more memory
18:00:21
karlosz
i think the only optimizations that are objectively easier on SSA are the complicated loop ones that exploit phi functions
18:01:02
karlosz
yeah - we could also implement a few more tricks from the 'closures in O(0)' time paper as well
18:02:05
karlosz
if we contify more aggressively we can get type prop on the arguments for free since they get integrated into the flow graph
18:04:16
stassats
i have a working dead code elimination in local functions if their results are unused, but i'm stumped by tail-set types to be able to eliminate multiple-value handling
18:06:47
karlosz
i don't understand why the tail-set even holds the union of the result type - wouldn't it be better to keep it separate for precision?
18:09:24
stassats
i'd even call it tail-chain, but it encumbers all local functions which happen to have tail calls, even if they aren't actually related
18:11:11
karlosz
yeah - i mean having something like a tail set is good for analyzing if a function always returns to the same place, since we should look through tail calls
18:28:01
stassats
(eql (search m sequence) 0) should be transformed to (string= m sequence :end2 (length m))