From d0fa6e066b3c91be7196dc392b95dbf97445ac96 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Mon, 1 Mar 2021 18:57:56 -0500 Subject: [PATCH] nv50/ir: avoid inlining results of a locked load These are a bit special. Among other things, removing them will cause us to potentially remove the load itself, defeating the purpose of the locking. Also it's unclear whether it's legal to access the shared memory directly when it's locked like this. This only comes up on nv50, since on nvc0+, shared memory can't be loaded from random ops. Signed-off-by: Ilia Mirkin Acked-by: Pierre Moreau Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 9120f99c8c6..ec599fcc81c 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -276,6 +276,8 @@ LoadPropagation::visit(BasicBlock *bb) if (!ld || ld->fixed || (ld->op != OP_LOAD && ld->op != OP_MOV)) continue; + if (ld->op == OP_LOAD && ld->subOp == NV50_IR_SUBOP_LOAD_LOCKED) + continue; if (!targ->insnCanLoad(i, s, ld)) continue;