i965/fs: Don't double-emit SEND dependency workarounds at control flow.
authorEric Anholt <eric@anholt.net>
Wed, 20 Mar 2013 00:36:10 +0000 (17:36 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 1 Apr 2013 23:17:26 +0000 (16:17 -0700)
We weren't setting needs_dep[i] in the loops, so we'd continue on to
potentially add the same workaround MOVs to the later basic block
boundaries, too.  We can either set needs_dep[i] to exit through the
normal path, or we can just return since we know we're done.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 84e88b1aa9135eddf002f0d0def52cbfbc14c87e..cc8882bc22e1d7e60b5aa5daf6b9189188776a95 100644 (file)
@@ -2341,6 +2341,7 @@ fs_visitor::insert_gen4_pre_send_dependency_workarounds(fs_inst *inst)
                inst->insert_before(DEP_RESOLVE_MOV(first_write_grf + i));
             }
          }
+         return;
       }
 
       bool scan_inst_16wide = (dispatch_width > 8 &&
@@ -2410,6 +2411,7 @@ fs_visitor::insert_gen4_post_send_dependency_workarounds(fs_inst *inst)
             if (needs_dep[i])
                scan_inst->insert_before(DEP_RESOLVE_MOV(first_write_grf + i));
          }
+         return;
       }
 
       /* Clear the flag for registers that actually got read (as expected). */