Search
Friday, 20th of November 2020, 2:16:36 UTC
2:28:29
karlosz
Bike: do you have any advice on the primops issue? i just defined a flushable attribute and i want to put it on things like car and cdr and the arithmetic operators
2:28:57
Bike
how are you getting attribute info from calls now?
2:29:00
karlosz
i have it as part of the dead code eliminator in metaevaluation, but it seems like i don't actually get an abstract call?
2:29:18
karlosz
(cleavir-attributes:has-boolean-attribute-p
2:29:20
karlosz
(cleavir-bir:attributes instruction)
2:29:38
Bike
so is it just getting attributes from the AST still?
2:30:11
karlosz
i mean the issue seems to be that clasp doesn't even make an abstract call for car or cdr
2:30:19
karlosz
it just makes a primop for it straight away right
2:30:29
karlosz
im just using the same attributes machinery you used for dyn-call
2:30:35
karlosz
i didn't change the attributes system at all
2:30:49
Bike
i mean we could extend it to primops then, i guess.
2:31:12
Bike
not sure what you mean about not getting an abstract call. i would think that it makes a call to the car function, which is then inlined.
2:32:14
karlosz
so i just needed to make sure i get the attribute before inlining happens...
2:32:21
karlosz
but i want to flush code after inlining :/
2:32:43
Bike
well what i mean is we could mark primop uses with attributes the same way we mark calls.
2:33:30
karlosz
same with the foldable functions
2:41:13
Bike
i can do that. longer term i'd like to be able to use the flow of the callee like i've been saying but we work with what we have
2:42:26
karlosz
i mean right now i just need them so i can test that the meta evaluator is working
2:42:41
Bike
you could just disable the inline definitions for a bit
2:42:41
karlosz
not sure how we can do the flow of the callee with the constant foldable ness though
2:43:00
karlosz
right now im just using the two-arg-foo functions
2:43:16
karlosz
(lambda () (- 1 2) t) flushes (- 1 2) now
2:45:11
karlosz
*sigh* also need to flush multiple-to-fixed and co
2:45:56
Bike
reocgnizing mv-bind lambdas would be tricky, i don't think we have information about the defaults available in bir, and we need it
2:46:03
Bike
(cos a non nil default would work differently)
2:48:48
karlosz
its compiled in the ast
2:55:57
karlosz
OK, so in order to have (lambda () (- 1 (+ 1 2)) t) flush the arithemtic expression i needed:
2:56:06
karlosz
1. mark two-arg- and two-arg-+ as :FLUSHABLE
2:56:18
karlosz
2. teach it to flush multiple-to-fixed
2:56:41
karlosz
3. teach it to flush vprimops with primop infos with FDEFINITION as names
2:56:55
karlosz
so hopefully when we extend the attributes thing to vprimops it won't be so bad
2:58:01
karlosz
i'll just hard code it for now since the set of primops is hardcoded in BIR/primops
2:58:50
Bike
but yeah i can probably fix that up tomorrow
2:59:18
karlosz
i'm going to see how many of these arithmetic calls actually get flushed during self build now
2:59:52
karlosz
these are things llvm can't flush for us. i think llvm could do readvars and constants
3:01:28
karlosz
you'd expect that there shouldn't be any in a normal program, but...
3:03:04
karlosz
hm, marking the primop flushable doesn't help since its tangled in the TYPEQ code
3:03:07
Bike
oh. well, we don't merge constants or nothin
3:06:17
karlosz
this is all the ocde generated for (lambda (x) (car x) t)
3:06:21
karlosz
https://paste.gnome.org/prgg8cpuy
3:06:58
karlosz
it'd be nice if i could flush the car call before it gets inlined
3:07:14
Bike
ok, well going back to inlining for a second i've been thinking we could make inlining just another kind of transformation
3:07:15
karlosz
since there's all this phi stuff to look through
3:07:23
Bike
and then we could just prioritize flushing transformations
3:07:52
karlosz
or i don't know what you mean as "just another kind of transformation"
3:08:10
Bike
i mean like the general mechanism that rewrites calls
3:09:33
karlosz
also there are three primop calls to SYMBOL VALUE that get flushed during self build, for whatever reason
3:10:07
Bike
from (lambda (x) (car x) t)...?
3:10:16
Bike
weird. i don't know what that would be
3:11:41
karlosz
nothing to do with (lambda (x) (car x) t)... i was just running the code flusher over self build
4:06:27
beach
Good morning everyone!
Friday, 20th of November 2020, 14:16:36 UTC