glsl: Use ir_var_temporary for compiler generated temporaries
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 9 Jul 2014 23:57:03 +0000 (16:57 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 30 Sep 2014 20:34:43 +0000 (13:34 -0700)
These few places were using ir_var_auto for seemingly no reason.  The
names were not added to the symbol table.

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/lower_offset_array.cpp
src/glsl/lower_texture_projection.cpp
src/glsl/opt_cse.cpp

index 0c235eda395c3b7a4501a9531ff5989484d9f518..5b48526db1de7562c87e3de8f19e8081db517563 100644 (file)
@@ -63,7 +63,8 @@ brw_lower_offset_array_visitor::handle_rvalue(ir_rvalue **rv)
 
    void *mem_ctx = ralloc_parent(ir);
 
-   ir_variable *var = new (mem_ctx) ir_variable(ir->type, "result", ir_var_auto);
+   ir_variable *var =
+      new (mem_ctx) ir_variable(ir->type, "result", ir_var_temporary);
    base_ir->insert_before(var);
 
    for (int i = 0; i < 4; i++) {
index 16d63768055bd96703949678b92a5bfee7f757f1..95df106d93f53449f59a9b6f4c07d72bf69d213c 100644 (file)
@@ -62,7 +62,7 @@ lower_texture_projection_visitor::visit_leave(ir_texture *ir)
    void *mem_ctx = ralloc_parent(ir);
 
    ir_variable *var = new(mem_ctx) ir_variable(ir->projector->type,
-                                              "projector", ir_var_auto);
+                                              "projector", ir_var_temporary);
    base_ir->insert_before(var);
    ir_dereference *deref = new(mem_ctx) ir_dereference_variable(var);
    ir_expression *expr = new(mem_ctx) ir_expression(ir_unop_rcp,
index 0e720cc2686e638115d3521cfd6a8203b369d3bd..9c96835ddd5b7911247777b6cc5eec387ca65b75 100644 (file)
@@ -276,7 +276,7 @@ cse_visitor::try_cse(ir_rvalue *rvalue)
 
          ir_variable *var = new(rvalue) ir_variable(rvalue->type,
                                                     "cse",
-                                                    ir_var_auto);
+                                                    ir_var_temporary);
 
          /* Write the previous expression result into a new variable. */
          base_ir->insert_before(var);