[Mesa-dev] [PATCH 17/26] glsl: Use ir_var_temporary for compiler generated temporaries
Ian Romanick
idr at freedesktop.org
Mon Jul 14 15:48:49 PDT 2014
From: Ian Romanick <ian.d.romanick at intel.com>
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 at intel.com>
---
src/glsl/lower_offset_array.cpp | 3 ++-
src/glsl/lower_texture_projection.cpp | 2 +-
src/glsl/opt_cse.cpp | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/glsl/lower_offset_array.cpp b/src/glsl/lower_offset_array.cpp
index 0c235ed..5b48526 100644
--- a/src/glsl/lower_offset_array.cpp
+++ b/src/glsl/lower_offset_array.cpp
@@ -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++) {
diff --git a/src/glsl/lower_texture_projection.cpp b/src/glsl/lower_texture_projection.cpp
index 16d6376..95df106 100644
--- a/src/glsl/lower_texture_projection.cpp
+++ b/src/glsl/lower_texture_projection.cpp
@@ -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,
diff --git a/src/glsl/opt_cse.cpp b/src/glsl/opt_cse.cpp
index 0e720cc..9c96835 100644
--- a/src/glsl/opt_cse.cpp
+++ b/src/glsl/opt_cse.cpp
@@ -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);
--
1.8.1.4
More information about the mesa-dev
mailing list