[Mesa-dev] [PATCH] i965/fs: Fix calculation of the number of registers read in opt_copy_propagate.

Francisco Jerez currojerez at riseup.net
Wed Jul 22 02:45:58 PDT 2015


This seems to have been multiplying by stride twice since
fs_inst::regs_read/regs_written were changed to return the value in
register units rather than in dispatch_width-wide components.  The
value returned by fs_inst::regs_read() already takes into account the
stride so it's wrong to do it again here.
---
 src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 269bdb5..3940158 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -309,7 +309,7 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
     */
    if (inst->src[arg].reg_offset < entry->dst.reg_offset ||
        (inst->src[arg].reg_offset * 32 + inst->src[arg].subreg_offset +
-        inst->regs_read(arg) * inst->src[arg].stride * 32) >
+        inst->regs_read(arg) * 32) >
        (entry->dst.reg_offset + entry->regs_written) * 32)
       return false;
 
@@ -477,7 +477,7 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
        */
       if (inst->src[i].reg_offset < entry->dst.reg_offset ||
           (inst->src[i].reg_offset * 32 + inst->src[i].subreg_offset +
-           inst->regs_read(i) * inst->src[i].stride * 32) >
+           inst->regs_read(i) * 32) >
           (entry->dst.reg_offset + entry->regs_written) * 32)
          continue;
 
-- 
2.4.3



More information about the mesa-dev mailing list