We were previously dumping $r127 in there. This has a bad effect on
nv50, so make sure we allocate an actual register for it, even if
there's nothing using the result.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>
if (i->op == OP_ATOM ||
i->op == OP_SUREDP ||
i->op == OP_SUREDB) {
- i->setDef(0, NULL);
+ const Target *targ = prog->getTarget();
+ if (targ->getChipset() >= NVISA_GF100_CHIPSET ||
+ i->subOp != NV50_IR_SUBOP_ATOM_CAS)
+ i->setDef(0, NULL);
if (i->op == OP_ATOM && i->subOp == NV50_IR_SUBOP_ATOM_EXCH) {
i->cache = CACHE_CV;
i->op = OP_STORE;
i->op == OP_MERGE ||
i->op == OP_SPLIT) {
constrList.push_back(i);
+ } else
+ if (i->op == OP_ATOM && i->subOp == NV50_IR_SUBOP_ATOM_CAS &&
+ targ->getChipset() < 0xc0) {
+ // Like a hazard, but for a def.
+ Instruction *nop = new_Instruction(func, OP_NOP, i->dType);
+ nop->setSrc(0, i->getDef(0));
+ i->bb->insertAfter(i, nop);
}
}
return true;