freenode/#clasp - IRC Chatlog
Search
3:54:54
Bike
i don't know about that, but there needs to be something or a lot of analysis is harder than it needs to be.
3:55:24
Bike
currently something like (when (typeq c cons) (+ (car c) (cdr c))) does three checks because the temps obscure type information.
3:57:43
Bike
and then the temp is never used again, so the information about temp being a cons is irrelevant later.
3:58:50
Bike
information is lost. the car and cdr forms just check C, which has no information associated with it.
4:00:37
Bike
so to do anything helpful something has to know that c and temp have the same value at the car and cdr forms. the obvious way of doing that is eliminating the temp
4:01:42
Bike
it would be relevant for THE, and i guess semantics around the and typeq could be rearranged somehow
4:02:20
Bike
you mean propagating type information in the reverse direction from control flow, right? typeq doesn't imply anything about the type of its argument before the typeq is executed, see.
4:02:49
beach
It seems to me that in the true branch of the TYPEQ, it ought to be possible to decide that the type of C is the same as that of TEMP.
4:03:58
Bike
if value numbering means tracking sets of variables that have the same value at given control points, that's what eliminate-superfluous-temporaries does.
4:04:06
beach
It is able to determine that two lexical locations contain the same value at particular control points.
4:05:14
beach
Given the papers I have read, I seriously doubt that your simple technique covers the general case.
4:06:48
beach
From what I have read, Kildall's algorithm is the only one that really works for global value numbering. But it has to be the right domain.
4:08:45
beach
It is bound to be very complicated in the presence of nested functions that can be executed in separate threads, and such.
4:10:08
Bike
well, it is kildall. but again, i made it really simple, there's no way it does the complete thing. I mostly just wanted to fix obvious cases like (foo x) having a temp.
4:11:16
beach
Sure. What I am saying is that it might be worthwhile for you to read up on global value numbering and contemplate how it would work in the presence of complex control structures like we have. On paid time, obviously! :)
4:11:59
beach
Global value numbering is certainly one analysis that Cleavir should provide to its clients.
4:12:39
Bike
i tried rewriting it (ast-to-hir) but i think i've convinced myself that's not the way to go
4:14:08
Bike
it looks like global value numbering is also supposed to work with operations, like if x = y then (car x) = (car y), which seems a good deal trickier
4:15:45
beach
But it could be worthwhile. I often write things like (car x) several times rather than introducing a temporary.
4:16:27
beach
Again, it gets tricky in the presence of threads and other complex control structures.
4:17:59
Bike
well, for a start i can ignore cells, which makes it easier. i'm still not sure what to do with cells in general
14:36:09
drmeister
The problem I fixed last night I found by listening to the compiliation warnings.
14:39:53
drmeister
I'm noticing something weird though. It's not clear yet, but when I run clasp under the debugger it's like linking doesn't work properly. I get .fasl files with zero length and that's a show stopper.
14:41:14
drmeister
I can't even fathom why that would make a difference. If you do try to run clasp when it is connected to the debugger and you see that - can you confirm it?
14:42:55
drmeister
Let me put it this way - if you are tempted to run under the debugger because clasp backtraces are nonexistant and you start seeing fasl files with zero length - don't panic - I've seen the same thing. When I don't run under the debugger - I haven't seen it.