Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-06-14

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
02:34 mtj_ joined #moarvm
04:07 yoleaux joined #moarvm
04:32 benchable6 joined #moarvm
06:04 domidumont joined #moarvm
06:08 domidumont joined #moarvm
06:18 brrt joined #moarvm
07:23 brrt joined #moarvm
07:24 lizmat joined #moarvm
09:14 ggoebel joined #moarvm
09:42 zakharyas joined #moarvm
10:44 zakharyas joined #moarvm
12:10 AlexDaniel joined #moarvm
12:51 Geth ¦ MoarVM: 61f70fae5a | (Jonathan Worthington)++ | src/spesh/optimize.c
12:51 Geth ¦ MoarVM: Have inline log note what couldn't inline also.
12:51 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/61f70fae5a
12:51 Geth ¦ MoarVM: c43f436103 | (Jonathan Worthington)++ | src/spesh/args.c
12:51 Geth ¦ MoarVM: Remove successor when optional named arg passed.
12:51 Geth ¦ MoarVM:
12:51 Geth ¦ MoarVM: Meaning that the default code becomes dead and gets removed properly,
12:51 Geth ¦ MoarVM: as was the case for the positional args.
12:51 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/c43f436103
12:57 brrt joined #moarvm
13:07 Geth ¦ MoarVM: c08e4c29c2 | (Jonathan Worthington)++ | 3 files
13:07 Geth ¦ MoarVM: Flag up writers that die when a BB dies.
13:07 Geth ¦ MoarVM:
13:07 Geth ¦ MoarVM: So that we will later be able to ignore them when doing PHI merges.
13:07 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/c08e4c29c2
13:07 Geth ¦ MoarVM: bca35a4b81 | (Jonathan Worthington)++ | src/spesh/optimize.c
13:07 Geth ¦ MoarVM: Make a BB elimination pre-pass before optimizing.
13:07 Geth ¦ MoarVM:
13:07 Geth ¦ MoarVM: To immediately toss out any basic blocks removed by arg spesh when
13:07 Geth ¦ MoarVM: specializing on optionals being passed or not.
13:07 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/bca35a4b81
13:32 zakharyas joined #moarvm
13:35 timotimo interesting
13:42 lizmat joined #moarvm
14:14 lizmat joined #moarvm
14:42 domidumont joined #moarvm
14:56 AlexDaniel joined #moarvm
14:58 * jnthn back
15:06 brrt joined #moarvm
15:07 Geth ¦ MoarVM: c0fcf1d7d8 | (Jonathan Worthington)++ | src/spesh/optimize.c
15:07 Geth ¦ MoarVM: Clean up dead variables in PHI nodes.
15:07 Geth ¦ MoarVM:
15:07 Geth ¦ MoarVM: Since those paths will never be taken, their facts are not relevant.
15:07 Geth ¦ MoarVM: This means the merged facts can be more accurate. This allows for far
15:07 Geth ¦ MoarVM: better handling of the case where an optional parameter was passed;
15:07 Geth ¦ MoarVM: we only care about the facts on the variable, not those on the (dead)
15:07 Geth ¦ MoarVM: default value.
15:07 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/c0fcf1d7d8
15:07 Geth ¦ MoarVM: 4f957bd528 | (Jonathan Worthington)++ | src/spesh/optimize.c
15:07 Geth ¦ MoarVM: Toss a return; at the end of a function.
15:07 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/4f957bd528
15:07 brrt oooh
15:08 jnthn For some reason, the case where we take the default still ends up with an untrimmed PHI
15:08 jnthn Hmm
15:12 jnthn Oh, 'cus we delete an instruction rather than a BB
15:24 AlexDaniel joined #moarvm
15:24 domidumont joined #moarvm
15:24 lizmat joined #moarvm
15:28 lizmat joined #moarvm
15:31 AlexDani` joined #moarvm
15:34 zakharyas joined #moarvm
15:42 Geth ¦ MoarVM: 1f67f2febb | (Jonathan Worthington)++ | 3 files
15:42 Geth ¦ MoarVM: Don't make dead_writer a facts flag.
15:42 Geth ¦ MoarVM:
15:42 Geth ¦ MoarVM: That makes it far more contaigious than it really should be. Also fix
15:42 Geth ¦ MoarVM: an off-by-one.
15:42 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/1f67f2febb
15:42 Geth ¦ MoarVM: ec6d1cd7b9 | (Jonathan Worthington)++ | src/spesh/manipulate.c
15:42 Geth ¦ MoarVM: Set dead writer when deleting instructions also.
15:42 Geth ¦ MoarVM:
15:42 Geth ¦ MoarVM: This helps get better code produced in the case where the default of
15:42 Geth ¦ MoarVM: an optional parameter is used (various type checks on the default can
15:42 Geth ¦ MoarVM: be thrown out).
15:42 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/ec6d1cd7b9
15:47 jnthn So, more tyype checks etc. thrown out
15:47 jnthn A few more set instructions live on that I thought would, but overall much better
15:48 jnthn Still doesn't inline. grmbl.
15:50 timotimo are you still working on the "read char and count them" benchmark?
15:50 jnthn Yeah
15:50 jnthn But
15:50 jnthn It's turned up some much more general code quality issues
15:50 timotimo sure
15:50 timotimo i was just wondering what exactly you were hoping for it to inline
15:51 bisectable6 joined #moarvm
15:52 jnthn consume-line-chars from VMBackedDecoder
15:54 timotimo does the code say why it won't get inlined?
15:55 timotimo locally i get a wval put into r15(2) which then is never read from
15:55 timotimo mysteriously it still has a usage count of 1
15:57 jnthn Yeah, not sure about that
15:57 jnthn No, about to check if it's code size or osmething else
15:57 jnthn First was throwing out two more instructions :)
15:57 jnthn Well, in theory
15:58 jnthn Tried to eliminate goto at the end of a BB that goes to the start of the next BB
15:59 jnthn Works but busts an NQP test. Odd.
15:59 timotimo have you made sure not to do that in a jumplisted bb?
15:59 jnthn ah, no.
15:59 timotimo that'd only work for the very last entry, i suspect
15:59 jnthn And it's qregex.t that I was doing this in
16:00 jnthn uh, that it was failing in
16:00 timotimo right, that has jumplists
16:00 jnthn Yowser, segv
16:00 timotimo say, could that extra Str wval come from a return type check?
16:01 jnthn Yeah
16:01 jnthn It did
16:01 * timotimo looks at the spesh code for decontrv removal
16:01 jnthn Just becomes a set
16:02 timotimo i thought i saw a commit to that effect today
16:02 timotimo oh, you do that inside rakudo, don't you
16:02 timotimo okay, so it can't be that that opt just forgets to reduce the usage count when it kicks the op out
16:03 timotimo we just don't emit that op in the first place
16:03 jnthn hah, yeah, it explodes when JITting a jumplist
16:03 * timotimo looks at pre-spesh code
16:03 jnthn bah, that makes the analysis a bunch more complex :)
16:03 timotimo we can have BBs hold a tiny flag for "involved in a jumplist"
16:04 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
16:05 timotimo and it doesn't decrease the usage counter
16:05 timotimo oh, the typecheck works differently from what i thought it would be
16:07 benchable6 joined #moarvm
16:11 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...
16:11 jnthn Forgot that
16:11 timotimo yeah
16:12 jnthn That makes sense but is annoying :P
16:13 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
16:14 jnthn timotimo: No, I noticed that earlier
16:14 timotimo that might be the source of that left-over usage on that wval, then
16:14 timotimo shall i?
16:15 jnthn Can have a go, make sure to test it well though :)
16:18 timotimo yeah, i will
16:23 timotimo 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
16:24 * [Coke] realizes he was replying to something hours ago. whoops! :)
16:24 jnthn o/ [Coke]  :)
16:26 timotimo now the usage has decreased to 0, but the instruction is still there
16:26 timotimo that's likely an order-of-optimization problem
16:28 Geth ¦ MoarVM: 485370707d | (Jonathan Worthington)++ | 2 files
16:28 Geth ¦ MoarVM: Track which BBs are part of a jump list.
16:28 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/485370707d
16:28 Geth ¦ MoarVM: 6ae1eee7b4 | (Jonathan Worthington)++ | src/spesh/optimize.c
16:28 Geth ¦ MoarVM: Delete pointless goto instructions.
16:28 Geth ¦ MoarVM:
16:28 Geth ¦ MoarVM: That is, those that are at the end of a basic block and pointing to
16:28 Geth ¦ MoarVM: the very next basic block. This typically happens as a result of
16:28 Geth ¦ MoarVM: other optimizations having done their work and in the process deleted
16:28 Geth ¦ MoarVM: intervening basic blocks.
16:28 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/6ae1eee7b4
16:28 timotimo i put in an extra eliminate_dead_ins after second_pass and now that particular wval is gone
16:29 timotimo not sure if we'll want to keep that
16:29 jnthn Hm
16:30 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
16:30 timotimo not AFK for long, though! :)
16:30 zakharyas joined #moarvm
16:31 jnthn OK, it's not a size problem any more
16:31 jnthn (The lack of inlining)
16:32 Geth ¦ MoarVM/remove_dead_ins_after_dead_bb: f631a8dab1 | (Timo Paulssen)++ | src/spesh/optimize.c
16:32 Geth ¦ MoarVM/remove_dead_ins_after_dead_bb: discover registers from dead bbs, extra dead_ins pass
16:32 Geth ¦ MoarVM/remove_dead_ins_after_dead_bb: review: https://github.com/MoarVM/MoarVM/commit/f631a8dab1
16:32 timotimo OK, what keeps it from being inlined still?
16:33 jnthn ah, sp_namedarg_used
16:33 jnthn It wants to track that in case of deopt
16:33 jnthn So a deopt in the "wrong place" won't end up wrongly reporting missing args
16:34 jnthn And if you inline then you'd be writing to the wrong flags buffer
16:34 jnthn That there's a solution, which is just to just put on the spesh candidate which arg used flags it should set :)
16:34 jnthn And maybe note it in the inline table if needed
16:35 jnthn And then delete the instructions and take care of it at deopt time
16:35 timotimo SGTM
16:38 jnthn Yeah, but...I think that's a task for tomorrow for me :)
16:38 timotimo understood!
16:39 * jnthn is enjoying this but should make sure to rest too :)
16:42 robertle joined #moarvm
16:47 domidumont joined #moarvm
17:22 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:23 timotimo if that isn't static, we could introduce a different namedarg_used op that goes to the right spot
17:27 timotimo 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:28 timotimo i might try implementing this
17:41 timotimo hm, i guess it does go on the candidate, not the inline
17:47 timotimo MVM_spesh_args might be the right place for this
17:47 timotimo given it's about args
17:47 jnthn Yeah, I was going to do it in there
17:47 jnthn We can just allocate a buffer and hang it off candidate
17:47 jnthn Then memcpy it into place during deopt
17:48 jnthn It doesn't matter if we didn't actually reach all the args yet; dupe-setting the flag is harmless
17:51 timotimo seems like it's time to go grocery shopping for dinner
17:52 AlexDaniel joined #moarvm
18:06 Geth ¦ MoarVM: 05a7dc3d69 | jnthn++ | src/io/procops.c
18:06 Geth ¦ MoarVM: Remove bad Windows quoting option async proc code.
18:06 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/05a7dc3d69
18:19 dogbert17 joined #moarvm
20:28 MasterDuke joined #moarvm
21:14 eveo grrr stupid atom
21:14 eveo Not only does pressing Ctrl+Q quits it... It doesn't even ask you if you wanted to save your unsaved work!
21:14 eveo Lost like a page worth of prose -_-
21:14 japhb That's quite broken behavior for an editor, yes.
21:22 timotimo m(
21:32 nebuchadnezzar joined #moarvm
21:37 zakharyas joined #moarvm
21:46 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
22:16 colomon joined #moarvm
22:18 * timotimo is not making any progress
22:25 timotimo better concentrate more on things i've got past experience with
22:26 timotimo 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:28 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:32 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:33 jnthn huh, gut I saw an sp_namedarg_used in spesh log today :)
22:33 jnthn *but
22:33 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
22:33 jnthn It's only a problem if a deopt happens in an unfortuante place
22:34 jnthn But I'm sure I got that to happen
22:34 jnthn Somewhere in the NQP build
22:34 jnthn Oh, though I guess it's feasible it could cause a buffer overrun too if inlined
22:35 * jnthn goes to relax
22:35 jnthn o/
22:36 timotimo have a good laxin' :)
22:37 timotimo yeah, we'd have to have a function with many named args inlined into one with few or none
23:13 timotimo oh, i do have a useful commit to contribute
23:14 Geth ¦ MoarVM: 89556765c3 | (Timo Paulssen)++ | src/spesh/optimize.c
23:14 Geth ¦ MoarVM: actually log inlines to stderr as the comment up top claims
23:14 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/89556765c3
23:37 AlexDaniel joined #moarvm

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary