From 64e27b2af18c8818d573c30f4b6436403745fe1d Mon Sep 17 00:00:00 2001 From: M Henning Date: Sat, 26 Aug 2023 15:18:52 -0400 Subject: [PATCH] nv/codegen: Limit MemoryOpt to input/output/const Reviewed-by: Karol Herbst Part-of: --- src/nouveau/codegen/nv50_ir_peephole.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nouveau/codegen/nv50_ir_peephole.cpp b/src/nouveau/codegen/nv50_ir_peephole.cpp index 9841e4e861d..f809cf2cf1a 100644 --- a/src/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/nouveau/codegen/nv50_ir_peephole.cpp @@ -3221,14 +3221,19 @@ MemoryOpt::runOpt(BasicBlock *bb) } continue; } + + DataFile file = ldst->src(0).getFile(); + if (file != FILE_MEMORY_CONST && + file != FILE_SHADER_INPUT && + file != FILE_SHADER_OUTPUT) + continue; + if (ldst->getPredicate()) // TODO: handle predicated ld/st continue; if (ldst->perPatch) // TODO: create separate per-patch lists continue; if (isLoad) { - DataFile file = ldst->src(0).getFile(); - // if ld l[]/g[] look for previous store to eliminate the reload if (file == FILE_MEMORY_GLOBAL || file == FILE_MEMORY_LOCAL) { // TODO: shared memory ?