summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/codegen
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-08-13 22:19:39 -0400
committerIlia Mirkin <[email protected]>2016-08-16 21:56:16 -0400
commite988999791c32fd2594986fde742367d7f71c724 (patch)
tree4a4b34948da42ba22d9452bb575d13d55ef28d51 /src/gallium/drivers/nouveau/codegen
parent0b5f40b881d149d6c960d4ff8f69b58596cf9660 (diff)
nv50/ir: fix bb positions after exit instructions
It's fairly rare that the BB layout puts BBs after the exit block, which is likely the reason these issues lingered for so long. This fixes a fraction of issues with the giant pixmark piano shader. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Cc: <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index 7878f2fae48..cc2a88eb40a 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -2139,7 +2139,7 @@ makeInstructionLong(Instruction *insn)
insn->encSize = 8;
for (int i = fn->bbCount - 1; i >= 0 && fn->bbArray[i] != insn->bb; --i) {
- fn->bbArray[i]->binPos += 4;
+ fn->bbArray[i]->binPos += adj;
}
fn->binSize += adj;
insn->bb->binSize += adj;
@@ -2191,9 +2191,16 @@ replaceExitWithModifier(Function *func)
return;
}
}
- epilogue->binSize -= 8;
- func->binSize -= 8;
+
+ int adj = epilogue->getExit()->encSize;
+ epilogue->binSize -= adj;
+ func->binSize -= adj;
delete_Instruction(func->getProgram(), epilogue->getExit());
+
+ // There may be BB's that are laid out after the exit block
+ for (int i = func->bbCount - 1; i >= 0 && func->bbArray[i] != epilogue; --i) {
+ func->bbArray[i]->binPos -= adj;
+ }
}
void