github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
timotimo i wonder how common hllizing is in common workloads, and if we should see if hllize could be split into a bunch of ops that could partially be simplified or specialized 13:11
like, if hllizing a BOOTArray into an Array means craeting an Array and binding a clone into its $!reified, the escape analysis could conceivably work with that 13:12
MasterDuke timotimo: more than github.com/MoarVM/MoarVM/blob/mast...#L565-L579 does? 15:29
timotimo yes 15:31
that's for when hllize has to do nothing at all
nine MasterDuke: Escape analysis could detect that the HLL array does not escape and only it's $!reified is really used. So we could forgoe allocating that Array in the first place 15:32
But for that it must know that hllize will just allocate an Array and bind into it's $!reified
MasterDuke timotimo: gist.github.com/MasterDuke17/3e02e...3222346d78 when compiling CORE.c 15:41
timotimo does it actually invoke these frames? 15:43
int, num, str should be easy to spesh into equivalent bytecode 15:44
src/Perl6/bootstrap.c/BOOTSTRAP.nqp 15:46
3786: 'foreign_transform_array', -> $farray {
3791: 'foreign_transform_hash', -> $hash {
3796: 'foreign_transform_code', -> $code {
MasterDuke how would i know? i just stuck fprintfs in github.com/MoarVM/MoarVM/blob/mast...#L181-L267
timotimo did you put them directly after the "case" lines? 15:47
would be interesting to see a number for the if and the else branches respectively 15:48
MasterDuke yeah 15:49
timotimo we can probably turn the hllize - if we know the hll role and the hll's transformation functions at spesh time - into invokes, and have the rest of spesh continue the optimization into inlining
MasterDuke gist updated 15:53
timotimo mhm 15:54
could be worth just special case hash here 15:55
MasterDuke the current spesh optimization is for the more common case, right? "belongs to current HLL" 15:56
*most
timotimo yes
MasterDuke but hash is right behind
timotimo almost 50/50
want to output the hll role for "belongs to current HLL"? 15:59
perhaps also the null one at the top? 16:00
MasterDuke gist updated 16:04
0 is MVM_HLL_ROLE_NONE, 5 is MVM_HLL_ROLE_HASH 16:05
timotimo 1814 obj HLL role is default 16:06
should be easy to optimize, too
if isnt already
MasterDuke that's just another conditional || to github.com/MoarVM/MoarVM/blob/mast...#L572-L573 , right? 16:08
timotimo oh, if it's HLL_ROLE_NONE, it outputs default, but also if it's in current HLL 16:10
if it's default, what hll role value is it actually? is there anything other than the keys that are in the switch/case and _NONE?
also, a run with SPESH_DISABLE could be interesting to compare how many hlls are successfully prevented by spesh already 16:12
MasterDuke all defaults are 0 16:15
timotimo ok, in that case the hllize optimization already gets those
in theory
all the calls that remain must be from non-speshed code, or code where the type wasn't known etc 16:16
MasterDuke gist updated 16:17
timotimo ok the success rate of hllize to nothing for role being 0 is not overwhelming 16:19
1814 obj HLL role is default to 3739 obj HLL role is default, actually is 0 16:20
not so bad, but rare in general
cat has my hand again so typing is slooooow 16:22
MasterDuke i've gotten lost. is there an easy addition to the current optimization? 16:31
timotimo no, i think the one i was suggesting was basically already there
Geth MoarVM: scovit++ created pull request #1285:
Setup inlined CStruct assigned during construction
22:48