[Mesa-dev] [PATCH 03/13] i965/register_coalesce: Do register size checks before is_copy_payload

Jason Ekstrand jason at jlekstrand.net
Wed Apr 1 18:19:14 PDT 2015


This allows us to get rid of the visitor argument in is_copy_payload
---
 src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
index 09f0fad..e3cf2db 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
@@ -64,11 +64,8 @@ is_nop_mov(const fs_inst *inst)
 }
 
 static bool
-is_copy_payload(const fs_visitor *v, const fs_inst *inst)
+is_copy_payload(const fs_inst *inst)
 {
-   if (v->alloc.sizes[inst->src[0].reg] != inst->regs_written)
-      return false;
-
    fs_reg reg = inst->src[0];
 
    for (int i = 0; i < inst->sources; i++)
@@ -99,7 +96,10 @@ is_coalesce_candidate(const fs_visitor *v, const fs_inst *inst)
       return false;
 
    if (inst->opcode == SHADER_OPCODE_LOAD_PAYLOAD) {
-      if (!is_copy_payload(v, inst)) {
+      if (v->alloc.sizes[inst->src[0].reg] != inst->regs_written)
+         return false;
+
+      if (!is_copy_payload(inst)) {
          return false;
       }
    }
-- 
2.3.4



More information about the mesa-dev mailing list