nv50/ir: "zero" register does not work with g[] memory

Evidence suggests that having it anywhere, even as a regular e.g. atom
argument, causes issues.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10164>
This commit is contained in:
Ilia Mirkin 2021-02-24 22:17:40 -05:00 committed by Marge Bot
parent 21f9b1cbe7
commit 348db055dd

View file

@ -278,10 +278,14 @@ TargetNV50::insnCanLoad(const Instruction *i, int s,
DataFile sf = ld->src(0).getFile();
// immediate 0 can be represented by GPR $r63/$r127
// this does not work with global memory ld/st/atom
if (sf == FILE_IMMEDIATE && ld->getSrc(0)->reg.data.u64 == 0)
return (!i->isPseudo() &&
!i->asTex() &&
i->op != OP_EXPORT && i->op != OP_STORE);
i->op != OP_EXPORT &&
i->op != OP_STORE &&
((i->op != OP_ATOM && i->op != OP_LOAD) ||
i->src(0).getFile() != FILE_MEMORY_GLOBAL));
if (sf == FILE_IMMEDIATE && (i->predSrc >= 0 || i->flagsDef >= 0))
return false;