00:41 imirkin: HdkR: glBlendBarrier(). overdraw without _coherent is undefined.
00:52 HdkR: imirkin: Yea, I found that out. Didn't realize it was undefined without coherent
00:54 imirkin: allows the desktop gpu's to keep up :)
01:15 HdkR: imirkin: Even though Intel and AMD can do FBFetch without much issue? ;)
01:16 imirkin: intel on gen9+, and i don't think amd can
01:16 HdkR: I thought Vega introduced some sort of FBFetch thing?
01:17 imirkin: conceivable.
01:17 imirkin: i think pascal has something too
01:17 HdkR: I may also be making crap up though
01:17 imirkin: check where _coherent is supported
01:17 imirkin: should map nicely
01:17 airlied: if crap comes with a patch then it's better :-P
01:19 imirkin: huh. surprising. looks like maxwell+ supports _coherent
01:19 imirkin: probably some rast option
01:19 imirkin: (including GM10x)
01:19 HdkR: Correct. It supports coherent
01:19 imirkin: coz i don't think there's any op to do it
01:20 imirkin: maybe the shared memory hack? dunno
01:20 imirkin: would have to trace
01:27 HdkR: imirkin: What's the shared memory hack?
12:24 pendingchaos: ah, codegen has a sort of fallthrough for basic blocks like with switch statements in C/C++
12:24 pendingchaos: which is used to implement branching
13:15 imirkin: pendingchaos: yeah. there are missing bra's all over the place
13:26 MaximLevitsky: Hi!
13:27 imirkin: HdkR: just guessing as to its potential existence, but like that GLES ext that lets you store stuff per frag which becomes accessible to the next frag shader for that position
13:27 imirkin: which one could implement using shared memory? dunno
13:27 HdkR: ...How did you know I was about to say something
13:28 imirkin: coz i'm standing over your shoulder
13:28 imirkin: knock knock
13:28 HdkR: hah
13:28 imirkin: follow the white rabbit
13:29 HdkR: Could that actually be implemented with shared memory?
13:31 HdkR: Trying to remember how shared memory works. Haven't really messed with it
13:31 HdkR: Something like up to 96KB/warp?
13:32 imirkin: depends on model
13:33 imirkin: i think yeah on maxwell+
13:33 HdkR: Although I think there is an issue where the state of the shared memory isn't kept across invocations?
13:33 imirkin: but afaik it's not accessible
13:33 imirkin: but perhaps there's some way? dunno
13:33 HdkR: Also you can't use LDS/STS outside of compute, so you would need to LD/ST in to the shared window
13:33 imirkin: no shared window either
13:33 imirkin: at least ... wasn't
13:34 imirkin: but again, my knowledge mostly centers on fermi/kepler
13:35 HdkR: Right
13:36 HdkR: At that point you may as well as stuff it in to a device local only SSBO though
13:38 HdkR: Scariest thing is random breaking that could occur do to the unknown of shared data sticking around across invocations, and I'm assuming nothing happening in the case of some work happening to get between the invocations, corrupting it
13:53 pendingchaos: karolherbst: I think I'll override things like setSrc() and swapSources() in PhiInstruction to print a warning
14:05 pendingchaos: imirkin: wouldn't it be more robust to not have the basic block fallthrough until codegen?
14:05 pendingchaos: and codegen orders basic blocks and takes advantage of fallthrough to remove unneeded jumps
14:05 pendingchaos: the current approach feels a little fragile
14:15 HdkR: LLVM kills fallthrough branches at the MachineIR level ;)
14:20 pendingchaos: not the other way around (adding fallthrough during or right before code generation)?
14:24 HdkR: It's before code generation, but it is in the MachineInstr form. Can't remember if it is pre or post RA. I think Pre
14:51 RSpliet: HdkR: is that the Cuda definition of "shared memory" (aka. OpenCL "Local memory")? If so, 96KiB/warp sounds like an awful lot. Sure that's not per work-group?
14:51 RSpliet: Thread block... whatever
14:53 RSpliet: Yeah, defo per thread block/work-group ;-)
15:23 HdkR: RSpliet: Ah, per CTA then
15:23 HdkR: Guess that makes sense
15:30 RSpliet: HdkR: I've only looked at them from hardware limitations, in which case Kepler has up to 48KiB available per SM and only an ability to schedule one work-group in parallel. Maxwell or Pascal started allowing to schedule multiple TBs in parallel (in an attempt to reduce stalling time) on a single SM, but added more local mem to compensate.
15:31 HdkR: I see
16:06 pendingchaos: imirkin: what's the condition for GM107's exit do
16:35 pendingchaos: seems, at least for exit, the condition code should actually be a predicate
16:41 pendingchaos: seems I was feeding nvdisasm wrong actually
18:35 karolherbst: pendingchaos: yeah well, that thing is, if you "disable" getSrc for PhiInstructions, then there is no point having in inherit Instruction in the first place
19:00 pendingchaos: karolherbst: It's simpler than having a BaseInstruction and a PhiInstruction and NormalInstruction (both inheriting from BaseInstruction) though
19:00 pendingchaos: though I think phi instructions are stored specially
19:01 karolherbst: pendingchaos: well, but that would be the better design ;)
19:01 karolherbst: pendingchaos: kind of, they are the first instructions inside a BB
19:01 karolherbst: always
19:01 karolherbst: we _can_ be more explicit about it and simply say, they are no normal instructions
19:01 karolherbst: because of those things
19:02 karolherbst: the thing with overwriting setSrc is, that it would make it illegal to use PhiInstruction in places you use Instruction
19:02 karolherbst: and thigs is a big headache
19:02 karolherbst: *this
19:02 karolherbst: normally you would say: okay, we can just use it here, but now you have to be sure it isn't a PhiInstruction
19:05 pendingchaos: I don't think there is much code calling setSrc on random instructions?
19:05 pendingchaos: if it were to assert or print a warning, afaik biggest thing to do would be changing ValueDef::replace() to handle PhiInstructions
19:07 karolherbst: pendingchaos: a lot of code in peephole, no?
19:07 pendingchaos:starts checking
19:08 pendingchaos: changing a phi instruction's source before this change had to be done carefully already though
19:08 karolherbst: pendingchaos: with my nir stuff I have 400 setSrc calls
19:08 karolherbst: 351 without it
19:09 karolherbst: pendingchaos: yeah, practically this is fine. the class design isn't really that good as it is, but it works alright overall
19:09 karolherbst: I just don't want to have more hacky things added to it
19:10 pendingchaos: I think the setSrc calls in peephole is fine
19:11 pendingchaos: it seems to only call it when it knows what type the instruction is, or when iterating over a basic blocks instructions starting with getEntry()
19:11 karolherbst: surce
19:11 karolherbst: *sure
19:12 karolherbst: that's what I meant with "practically this is fine"
19:13 pendingchaos: I think I'll create an updated patch with setSrc() overridden to print a warning
19:14 karolherbst: I think I would still rather want to have some kind of class hierachy to better deal with that
19:15 karolherbst: I doubt there would be that many changes actually needed
19:15 karolherbst: well, only if something iterates over all instructions inside a BB
19:15 karolherbst: but we can already handle it inside the loop
19:16 karolherbst: and won't have to change code all over the place
19:17 karolherbst: in the end it is a question of maintainability and how painful it would be to write code in the future or make the code readable for people not involved, etc...
19:17 karolherbst: and those hidden dependencies are always painful to get at first
19:59 pendingchaos: karolherbst: how about performing a sanity check for phi instructions in GCRA::doCoalesce?
19:59 karolherbst: depends on what we want to verify
19:59 Lyude: RSpliet: poke, "16:15 <freenode#nouveau> <RSpliet> nyef: lyude is the person to ask further about this" <-- what's up?
20:00 karolherbst: pendingchaos: what kind of illegal state do you want to detect?
20:00 nyef: Lyude: I was noticing that the blob tends to reload the context-switch microcode fairly often.
20:00 karolherbst: there isn't really much which doesn't go, except sources having no BB attached
20:00 pendingchaos: that basicBlocks.size() == srcCount() (slightly simplified) and that each source is defined in it's basic block (or in one that dominates it)
20:00 karolherbst: and maybe all BBs should be different
20:00 Lyude: nyef: oh? what generation
20:01 nyef: I have an NVAF / MCP89.
20:01 Lyude: i'm assuming this is related to powergating as well?
20:01 karolherbst: pendingchaos: well, I would rather want to have the API written in a way, we don't have to do that in the first place though
20:01 nyef: Ah... probably not in my case, but it could be for all I know?
20:01 Lyude: I'm not sure :P, tbh I don't work with the firmware/µcode stuff at all
20:02 Lyude: i remember on some of the tesla generations they had to continuously reupload firmware to work around some issues from elpg
20:33 pendingchaos: karolherbst: I think I'll see if having a parent class with read-only sources for both Instruction and PhiInstruction could be reasonably unintrusive
20:37 karolherbst: pendingchaos: yeah, I think that would lead to a cleaner code design
23:00 pendingchaos: karolherbst: it's turning out to be pretty big so far: 470 insertions(+), 375 deletions(-)
23:00 pendingchaos: 238 of the changes is mostly moving around code in nv50_ir.h
23:00 pendingchaos: a lot of it is also changing type declarations or adding casts
23:02 karolherbst: mhh