[Mesa-dev] [PATCH 2/2] i965/fs: Only apply Gen4 work-arounds if regs_written > 1.

Matt Turner mattst88 at gmail.com
Tue Jan 13 15:35:58 PST 2015


Otherwise, we would have necessarily read the results or eliminated the
dead SEND. In either case, no work around is necessary.

Noticed when debugging the problem the previous patch fixed that any
time we hit a math instruction, we'd walk through subsequent
instructions, and of course each time discover that its result was in
fact used.
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 3f9cd68..c24c814 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2940,7 +2940,7 @@ fs_visitor::insert_gen4_send_dependency_workarounds()
     */
 
    foreach_block_and_inst(block, fs_inst, inst, cfg) {
-      if (inst->mlen != 0 && inst->dst.file == GRF) {
+      if (inst->mlen != 0 && inst->regs_written > 1 && inst->dst.file == GRF) {
          insert_gen4_pre_send_dependency_workarounds(block, inst);
          insert_gen4_post_send_dependency_workarounds(block, inst);
          progress = true;
-- 
2.0.4



More information about the mesa-dev mailing list