freenode/#sicl - IRC Chatlog
Search
20:27:07
karlosz
i was thinking the type check generation should just be thrown into mir altogether?
20:28:11
Bike
thei should be an identity possibly with side effects. so it needs multiple values if its output does. but there are some other optimizations possible, like if we infer the input is one value
20:34:40
Bike
how about - if thei doesn't have a type check function, it has the same rtype (or rather needs values coerced in the same way) as whatever it outputs to. if it does, we could always have it accept multiple values, and then pick off other cases based on inference
20:35:49
Bike
i think i'll just do that since if there's a type check it doesn't need to be enormously fast anyway, so extra values thrown around are whatever
20:37:03
Bike
then i can have generate-type-check always do the mv call rather than checking the rtype
20:39:50
Bike
karlosz: although - what's the deal with a tcfunction of :external? i don't understand your comment.
20:53:42
Bike
hang on. actually. if we do this then the optimizations we want to do are the same as we want for ANY mv call, i think
20:54:03
Bike
like if we have (mvc type-check-function form), and derive that form returns exactly one value, we make it into (funcall type-check-function form)
20:56:11
Bike
and similar for the return values, since ideally we would have local calls not forcing everything into unknown values returns like it does now
20:58:29
karlosz
Bike: :external is kinda a hack for compile time checking arguments of inlined function. the commit might explain it better
20:59:14
karlosz
yeah in sbcl all the decisions for whether to do unknown values or known values stuff is driven off of the ctypes of lvars
21:35:03
Bike
i guess this is how we can do type check functions correctly and performantly. first, we write the functions to return all values, by doing something stupid like (multiple-value-call #'values ,@required (values-list ignore)). then we derive the type of ignore to be NIL (if we figure out the number of values), which lets that be reduced to (multiple-value-call #'values ,@required), which is just (values
21:56:54
Bike
it might be necessary to rethink values-collect a bit. right now it's a little magical in having all its inputs but one be a specific kind of instruction
21:57:31
Bike
in reality we might have some heterogeneity in values counts, having various numbers of known values forms and unknown values forms