nvc0/ir: trim out barrier sync for non-compute shaders
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 28 Jul 2015 06:37:51 +0000 (02:37 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 28 Jul 2015 06:38:43 +0000 (02:38 -0400)
It seems like they're never necessary, and actively cause harm. This
fixes some of the barrier-related piglits.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp

index 710f53de1c4de94bb813cf15a34b6eee2b7e8603..c632e30afae4be3aacbfca1516b35688ee07d261 100644 (file)
@@ -559,6 +559,12 @@ NVC0LegalizePostRA::visit(BasicBlock *bb)
       } else
       if (i->isNop()) {
          bb->remove(i);
+      } else
+      if (i->op == OP_BAR && i->subOp == NV50_IR_SUBOP_BAR_SYNC &&
+          prog->getType() != Program::TYPE_COMPUTE) {
+         // It seems like barriers are never required for tessellation since
+         // the warp size is 32, and there are always at most 32 tcs threads.
+         bb->remove(i);
       } else {
          // TODO: Move this to before register allocation for operations that
          // need the $c register !