02:34 mtj_ joined 04:07 yoleaux joined 04:32 benchable6 joined 06:04 domidumont joined 06:08 domidumont joined 06:18 brrt joined 07:23 brrt joined 07:24 lizmat joined 09:14 ggoebel joined 09:42 zakharyas joined 10:44 zakharyas joined 12:10 AlexDaniel joined
Geth MoarVM: 61f70fae5a | (Jonathan Worthington)++ | src/spesh/optimize.c
Have inline log note what couldn't inline also.
12:51
MoarVM: c43f436103 | (Jonathan Worthington)++ | src/spesh/args.c
Remove successor when optional named arg passed.

Meaning that the default code becomes dead and gets removed properly, as was the case for the positional args.
12:57 brrt joined
Geth MoarVM: c08e4c29c2 | (Jonathan Worthington)++ | 3 files
Flag up writers that die when a BB dies.

So that we will later be able to ignore them when doing PHI merges.
13:07
MoarVM: bca35a4b81 | (Jonathan Worthington)++ | src/spesh/optimize.c
Make a BB elimination pre-pass before optimizing.

To immediately toss out any basic blocks removed by arg spesh when specializing on optionals being passed or not.
13:32 zakharyas joined
timotimo interesting 13:35
13:42 lizmat joined 14:14 lizmat joined 14:42 domidumont joined 14:56 AlexDaniel joined
jnthn back 14:58
15:06 brrt joined
Geth MoarVM: c0fcf1d7d8 | (Jonathan Worthington)++ | src/spesh/optimize.c
Clean up dead variables in PHI nodes.

Since those paths will never be taken, their facts are not relevant. This means the merged facts can be more accurate. This allows for far better handling of the case where an optional parameter was passed; we only care about the facts on the variable, not those on the (dead) default value.
15:07
MoarVM: 4f957bd528 | (Jonathan Worthington)++ | src/spesh/optimize.c
Toss a return; at the end of a function.
brrt oooh
jnthn For some reason, the case where we take the default still ends up with an untrimmed PHI 15:08
Hmm
Oh, 'cus we delete an instruction rather than a BB 15:12
15:24 AlexDaniel joined, domidumont joined, lizmat joined 15:28 lizmat joined 15:31 AlexDani` joined 15:34 zakharyas joined
Geth MoarVM: 1f67f2febb | (Jonathan Worthington)++ | 3 files
Don't make dead_writer a facts flag.

That makes it far more contaigious than it really should be. Also fix an off-by-one.
15:42
MoarVM: ec6d1cd7b9 | (Jonathan Worthington)++ | src/spesh/manipulate.c
Set dead writer when deleting instructions also.

This helps get better code produced in the case where the default of an optional parameter is used (various type checks on the default can be thrown out).
jnthn So, more tyype checks etc. thrown out 15:47
A few more set instructions live on that I thought would, but overall much better
Still doesn't inline. grmbl. 15:48
timotimo are you still working on the "read char and count them" benchmark? 15:50
jnthn Yeah
But
It's turned up some much more general code quality issues
timotimo sure
i was just wondering what exactly you were hoping for it to inline
15:51 bisectable6 joined
jnthn consume-line-chars from VMBackedDecoder 15:52
timotimo does the code say why it won't get inlined? 15:54
locally i get a wval put into r15(2) which then is never read from 15:55
mysteriously it still has a usage count of 1
jnthn Yeah, not sure about that 15:57
No, about to check if it's code size or osmething else
First was throwing out two more instructions :)
Well, in theory
Tried to eliminate goto at the end of a BB that goes to the start of the next BB 15:58
Works but busts an NQP test. Odd. 15:59
timotimo have you made sure not to do that in a jumplisted bb?
jnthn ah, no.
timotimo that'd only work for the very last entry, i suspect
jnthn And it's qregex.t that I was doing this in
uh, that it was failing in 16:00
timotimo right, that has jumplists
jnthn Yowser, segv
timotimo say, could that extra Str wval come from a return type check?
jnthn Yeah 16:01
It did
timotimo looks at the spesh code for decontrv removal
jnthn Just becomes a set
timotimo i thought i saw a commit to that effect today 16:02
oh, you do that inside rakudo, don't you
okay, so it can't be that that opt just forgets to reduce the usage count when it kicks the op out
we just don't emit that op in the first place 16:03
jnthn hah, yeah, it explodes when JITting a jumplist
timotimo looks at pre-spesh code
jnthn bah, that makes the analysis a bunch more complex :)
timotimo we can have BBs hold a tiny flag for "involved in a jumplist"
jnthn We could but it's easy just to check it 16:04
timotimo i was mistaken, it is inside rakudo, but it's actually inside spesh code in there
and it doesn't decrease the usage counter 16:05
oh, the typecheck works differently from what i thought it would be
16:07 benchable6 joined
timotimo it used to be the case that the wval in question was used once for a type check and once for a call as an arg_o; that arg_o somehow got thrown out along with the invoke, but apparently the usage count remained? 16:11
jnthn oh, darn, jumplists I guess make basic blocks out of every goto...
Forgot that
timotimo yeah
jnthn That makes sense but is annoying :P 16:12
timotimo we don't decrease any usage counts when we kill a dead bb off? 16:13
jnthn I guess "is this the only instruction in the BB" is a good heuristic :P
timotimo: No, I noticed that earlier 16:14
timotimo that might be the source of that left-over usage on that wval, then
shall i?
jnthn Can have a go, make sure to test it well though :) 16:15
timotimo yeah, i will 16:18
mark_dead_writers will want a re-name, then (because that's where i put the code); handle_dead_instruction_facts? 16:23
[Coke] jnthn: hio
[Coke] realizes he was replying to something hours ago. whoops! :) 16:24
jnthn o/ [Coke] :)
timotimo now the usage has decreased to 0, but the instruction is still there 16:26
that's likely an order-of-optimization problem
Geth MoarVM: 485370707d | (Jonathan Worthington)++ | 2 files
Track which BBs are part of a jump list.
16:28
MoarVM: 6ae1eee7b4 | (Jonathan Worthington)++ | src/spesh/optimize.c
Delete pointless goto instructions.

That is, those that are at the end of a basic block and pointing to the very next basic block. This typically happens as a result of other optimizations having done their work and in the process deleted intervening basic blocks.
timotimo i put in an extra eliminate_dead_ins after second_pass and now that particular wval is gone
not sure if we'll want to keep that 16:29
jnthn Hm
timotimo i'm going AFK now, so i'll quickly push a branch so you can decide how best to tackle this 16:30
jnthn alright, thanks
timotimo not AFK for long, though! :)
16:30 zakharyas joined
jnthn OK, it's not a size problem any more 16:31
(The lack of inlining)
Geth MoarVM/remove_dead_ins_after_dead_bb: f631a8dab1 | (Timo Paulssen)++ | src/spesh/optimize.c
discover registers from dead bbs, extra dead_ins pass
16:32
timotimo OK, what keeps it from being inlined still?
jnthn ah, sp_namedarg_used 16:33
It wants to track that in case of deopt
So a deopt in the "wrong place" won't end up wrongly reporting missing args
And if you inline then you'd be writing to the wrong flags buffer 16:34
That there's a solution, which is just to just put on the spesh candidate which arg used flags it should set :)
And maybe note it in the inline table if needed
And then delete the instructions and take care of it at deopt time 16:35
timotimo SGTM
jnthn Yeah, but...I think that's a task for tomorrow for me :) 16:38
timotimo understood!
jnthn is enjoying this but should make sure to rest too :) 16:39
16:42 robertle joined 16:47 domidumont joined
timotimo so it might have to go into the inline table if we have deopt points that we can reach before the arg in question gets marked as used 17:22
if that isn't static, we could introduce a different namedarg_used op that goes to the right spot 17:23
though even if we reject inlining anything where there's a deopt before the last namedarg_used, we'll still end up inlining more stuff, yay 17:27
i might try implementing this 17:28
hm, i guess it does go on the candidate, not the inline 17:41
MVM_spesh_args might be the right place for this 17:47
given it's about args
jnthn Yeah, I was going to do it in there
We can just allocate a buffer and hang it off candidate
Then memcpy it into place during deopt
It doesn't matter if we didn't actually reach all the args yet; dupe-setting the flag is harmless 17:48
timotimo seems like it's time to go grocery shopping for dinner 17:51
17:52 AlexDaniel joined
Geth MoarVM: 05a7dc3d69 | jnthn++ | src/io/procops.c
Remove bad Windows quoting option async proc code.
18:06
18:19 dogbert17 joined 20:28 MasterDuke joined
eveo grrr stupid atom 21:14
Not only does pressing Ctrl+Q quits it... It doesn't even ask you if you wanted to save your unsaved work!
Lost like a page worth of prose -_-
japhb That's quite broken behavior for an editor, yes.
timotimo m( 21:22
21:32 nebuchadnezzar joined 21:37 zakharyas joined
timotimo it's a bad sign when you've made sp_namedarg_used no longer :noinline, but nqp build and nqp test don't blow up 21:46
22:16 colomon joined
timotimo is not making any progress 22:18
better concentrate more on things i've got past experience with 22:25
now i've not even got code, so i don't have to (can't even?) push anything branchy for you to pick up 22:26
jnthn timotimo: Yeah, I thought it may be a bit tricky, which is why I went home for dinner and figured I'd look tomorrow when fresh... 22:28
timotimo i put in debug prints all over the place; the add_named_arg_used_ins function in args.c wasn't even hit it seemed like 22:32
jnthn huh, gut I saw an sp_namedarg_used in spesh log today :) 22:33
*but
timotimo but i did stumble upon named_used ops in the loop that would have rejected it because of :noinline, i even left it in and saw it in inlined blocks
jnthn It's only a problem if a deopt happens in an unfortuante place
But I'm sure I got that to happen 22:34
Somewhere in the NQP build
Oh, though I guess it's feasible it could cause a buffer overrun too if inlined
jnthn goes to relax 22:35
o/
timotimo have a good laxin' :) 22:36
yeah, we'd have to have a function with many named args inlined into one with few or none 22:37
oh, i do have a useful commit to contribute 23:13
Geth MoarVM: 89556765c3 | (Timo Paulssen)++ | src/spesh/optimize.c
actually log inlines to stderr as the comment up top claims
23:14
23:37 AlexDaniel joined