Mesa (master): i965: Drop pointless check for variable declarations in splitting.

Eric Anholt anholt at kemper.freedesktop.org
Tue Apr 8 08:24:36 UTC 2014


Module: Mesa
Branch: master
Commit: cf40ebacb113a370c1b2445e881f8dc440a7d8f3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf40ebacb113a370c1b2445e881f8dc440a7d8f3

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 25 12:44:01 2014 -0700

i965: Drop pointless check for variable declarations in splitting.

We're walking the whole instruction stream, so we know the declaration
will be found.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
index 78dcc3e..a9125ca 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
@@ -55,7 +55,6 @@ public:
    {
       this->var = var;
       this->whole_vector_access = 0;
-      this->declaration = false;
       this->mem_ctx = NULL;
    }
 
@@ -64,8 +63,6 @@ public:
    /** Number of times the variable is referenced, including assignments. */
    unsigned whole_vector_access;
 
-   bool declaration; /* If the variable had a decl in the instruction stream */
-
    ir_variable *components[4];
 
    /** ralloc_parent(this->var) -- the shader's ralloc context. */
@@ -139,10 +136,8 @@ ir_vector_reference_visitor::get_variable_entry(ir_variable *var)
 ir_visitor_status
 ir_vector_reference_visitor::visit(ir_variable *ir)
 {
-   variable_entry *entry = this->get_variable_entry(ir);
-
-   if (entry)
-      entry->declaration = true;
+   /* Make sure splitting looks at splitting this variable */
+   (void)this->get_variable_entry(ir);
 
    return visit_continue;
 }
@@ -347,12 +342,12 @@ brw_do_vector_splitting(exec_list *instructions)
       variable_entry *entry = (variable_entry *)node;
 
       if (debug) {
-	 fprintf(stderr, "vector %s@%p: decl %d, whole_access %d\n",
-                 entry->var->name, (void *) entry->var, entry->declaration,
+	 fprintf(stderr, "vector %s@%p: whole_access %d\n",
+                 entry->var->name, (void *) entry->var,
                  entry->whole_vector_access);
       }
 
-      if (!entry->declaration || entry->whole_vector_access) {
+      if (entry->whole_vector_access) {
 	 entry->remove();
       }
    }




More information about the mesa-commit mailing list