00:00 imirkin: no, that's most likely the latest
00:00 imirkin: something lowered it no?
00:01 karolherbst: yeah.. but it won't be reached from there I think
00:01 imirkin: yeah, at the tgsi level, they're just separate things
00:01 imirkin: NVC0LoweringPass::handleCasExch joins it
00:02 karolherbst: sure, but I doubt it gets called with your patch or does it?
00:02 imirkin: which is done at the end of handling OP_ATOM
00:02 imirkin: case OP_ATOM:
00:02 imirkin: {
00:02 imirkin: const bool cctl = i->src(0).getFile() == FILE_MEMORY_BUFFER;
00:02 imirkin: handleATOM(i);
00:02 imirkin: handleCasExch(i, cctl);
00:02 imirkin: }
00:03 karolherbst: but i points to invalid memory already
00:03 imirkin: so i _think_ it still happens.
00:03 karolherbst: as i is the old atom
00:03 imirkin: huh?
00:03 karolherbst: and it got removed
00:03 karolherbst: bld.remove(atom);
00:03 imirkin: heh
00:03 imirkin: well that's not _completely_ ideal then, huh
00:04 karolherbst: some other code also does dodgy things
00:04 imirkin: this happens in the other cases too
00:04 imirkin: should probably make handleATOM return a new instruction
00:04 karolherbst: yep, in handleSharedATOMNVE4
00:52 karolherbst: ahh..inserting phis is annoying :(
00:54 imirkin: quite.
00:54 imirkin: you really want to do this before SSA-ification
00:56 karolherbst: uffff
00:56 karolherbst: all of that is just more complicated than it has to be
01:06 karolherbst: ohh I am dumb.. the lowering is done pre SSA :)
01:06 imirkin: yes.
12:04 karolherbst: imirkin: uhhh.. I think RA dces instructions where only its carry is consumed but not the reg def
12:19 karolherbst: ohh.. I just could have skipped setting the reg def
13:03 karolherbst: "PASSED sub-test." \o/
13:05 karolherbst: but that was still painful :(
13:08 karolherbst: ahh yes.. it fails for and obviously
16:47 imirkin: karolherbst: there are definitely instances of only a CC being set - handles it fine.
16:48 karolherbst: yeah.. it just breaks if you also have a gpr set
16:48 karolherbst: and that gpr is getting unused
16:49 imirkin: mmmm ... pretty sure that's handled. you must not be setting ->flagDef
16:49 imirkin: but maybe not. dunno.
16:49 karolherbst: yeah...
16:49 karolherbst: I was setting a def and a flagDef
16:49 karolherbst: but the isNOP already bails
16:49 karolherbst: and the add just gets removed
16:50 imirkin: heh
16:50 imirkin: oops
16:50 karolherbst: there is even this warning for vectored instructions
16:50 karolherbst: WARN("part of vector result is unused !\n");
16:50 karolherbst: and it just returns true anyway
16:51 karolherbst: and if I make that return false, codegen crashes somewhere later
16:57 imirkin: right, i remember now
16:57 imirkin: iirc the result is we just don't DCE the unused reg
16:58 imirkin: and allocate one for nothing
16:59 karolherbst: well... as the add was DCEed, it used the value from an older add setting the flag :)