Search
Wednesday, 16th of May 2018, 3:03:08 UTC
3:12:59
karlosz
hm, it seems like this inlining approach can't work for functions with rest arguments
3:13:43
karlosz
the number of arguments the node is going to take is already precomputed ahead of time
3:14:02
karlosz
when creating the IR in the function info
3:18:40
Bike
rest is tricky because you need to create a list at runtime
3:19:15
karlosz
nah, clisp abstracts that away
3:19:31
karlosz
you just need to push the correct number of arguments on the stack and call the appropriate bytecode
3:20:09
Bike
an appropriate bytecode which creates a list?
3:20:23
karlosz
well thats handled in the vm at that point
3:20:40
Bike
a list is getting created
3:20:52
Bike
and hir can't abstract this well, because hey wht if there's an opcode
3:21:26
karlosz
well, you can have &more a la sbcl
3:21:33
karlosz
whcich doesn't cons up a list
3:21:39
karlosz
in certain circumstances
3:21:52
Bike
which you have to analyze to be sure of
3:22:01
karlosz
im not arguing that
3:22:24
karlosz
im just talking about the approach where you put the ast in the fun-info
3:23:01
karlosz
although i guess even if you redefined the function and put inline on it it would still be tricky
3:23:04
Bike
i'm not sure how that's related to &rest.
3:24:10
karlosz
well if you have a function like + in the flowgraph, it has an arbitrary number of inputs
3:24:20
karlosz
the call instruction, that is
3:24:59
karlosz
but if you tried to put the ast of (lambda (x y) (system-call 100 x y)) or whatever and inline that
3:25:04
karlosz
you know there is always 2 args
3:25:40
karlosz
but for a function with &rest you can'tcompute that up front in the ast you're returning from fun-info
3:26:02
Bike
the number of arguments is known at the time you're inlining, though
3:26:35
Bike
you'd inline ((lambda (x &rest y) ...) 1 2 3 4) as (let ((x 1) (y (list 2 3 4))) ...)
3:35:04
karlosz
so even though the number of arguments is known at inlining time, its not possible to just make a HIR node with the right number of inputs?
3:35:35
karlosz
that would fit clisp's calling convention better than explicitly making a list in the hir graph
3:35:52
Bike
what kind of hir node would it be?
3:36:38
karlosz
well, hir nodes can already have n-arity inputs in general
3:36:55
Bike
yes but i don't understand what you want this node to be, or do, or where it would be inserted for inlining, or anything.
3:38:12
karlosz
well when i translate the node to bytecode, it just makes bytecode to push each of the inputs on the stack
3:38:45
Bike
and where does the list come from?
3:39:44
karlosz
i don't understand. the funcall instruction can take any number of inputs, without creating a list. ie (+ 1 2 3) creates a hir node with 3 inputs
3:39:59
karlosz
1 for the fdefinition of +
3:40:01
Bike
Yes, but the lisp semantics for &rest involve a list.
3:40:32
karlosz
but there is no list at the hir level
3:40:42
karlosz
are you asking where does the list come from once hir is translated?
3:41:00
Bike
there is a list at hir level in that there is a variable that holds a list value.
3:42:21
karlosz
are you talking about the slot INPUTS?
3:42:39
karlosz
funcall has 4 input arrows, and each of the inputs is just a lexical location
3:42:46
karlosz
i don't see the list
3:43:14
Bike
if you have a lambda list (x &rest y) the ENTER-INSTRUCTION has three outputs - the closure, X, and Y, right?
3:43:33
karlosz
i meant just at the call site
3:43:50
Bike
at the call site there is no list. enter is assumed to make a list.
3:44:01
Bike
But, since we're inlining, the enter-instruction goes away, and we have to replace it with something.
3:46:41
karlosz
yeah, that's exactly where the problem is
3:46:59
karlosz
i'd like to have the 4 inputs (or however many is determined at inline time) wired directly to the node
3:47:11
Bike
A custom node that makes a list?
3:47:46
karlosz
for example (lambda (&rest x) (apply f x))
3:48:03
karlosz
i guess im looking to transform that into (f x1 x2...)
3:48:11
karlosz
since it can all be determined at compile time
3:48:28
Bike
yeah, but that's a more involved transformation than just inlining
3:55:45
Bike
oh, if you mean you have something with a &rest you want to "inline", you can just use a compiler macro instead
3:56:01
Bike
e.g. have (funcall x ...) expand to (cleavir-primop:funcall (coerce-to-function x) ...)
4:01:09
karlosz
yeah, that's more what im looking for
4:01:36
karlosz
is there a way to that done via cleavir?
4:02:03
Bike
if you don't want to define an clisp-normal compiler macro function, you can have function-info just make one up like you're already doing with ASTs
4:02:49
karlosz
oh, right. just spoof the host environment
13:24:30
drmeister
Bicyclidine: Did you get the cst changes?
13:24:45
loke
drmeister: I was thinking of taking another look at clasp
13:24:58
loke
drmeister: Can you tell me which branch I should be compiling?
13:26:11
drmeister
'dev' - but I haven't checked if it's working at the moment.
13:27:09
drmeister
I'll do a build and then push everything to 'preview' and you can use that.
13:27:13
loke
drmeister: Thanks, I'll try it.
13:28:06
drmeister
I'm adding custom allocators - and I haven't completely verified it.
13:28:27
loke
drmeister: Oh, for classes?
13:29:17
drmeister
No, lower level - to allocate specific C++ classes in custom MPS pools.
13:29:33
drmeister
C++ classes that are exposed to Common Lisp.
13:30:11
drmeister
So that they can be integrated seamlessly with everything else but be constantly compacted into their own small pool for good (hopefully) cache behavior.
13:30:45
Bike
what do you mean by custom allocators for slots, though?
13:33:49
Bike
drmeister: does cando compare lisp number objects with < etc. in C++? because i'm trying to delete those operators (clasp doesn't use them)
13:44:42
drmeister
Comment them out and try and build everything.
13:45:34
drmeister
Comment them out and I'll build cando
13:46:44
Bike
i deleted operator< etc from General_O, where i'm pretty certain they should not exist, but i can imagine them making sense for numbers
13:46:51
Bike
some kinds of numbers. not like Complex_O could work
13:47:25
Bike
in other news, slack ended support for the irc gateway literally yesterday
13:47:32
Bike
there's still bridge add ons by third parties,though
14:08:29
Bike
i forgot what to run to fix cleavir.py
15:00:36
Bike
with-debug-info-generator expands into code that copies the body like... six times... wtf
Wednesday, 16th of May 2018, 15:03:08 UTC