summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-05-23 20:03:31 -0700
committerIan Romanick <[email protected]>2014-09-30 13:34:43 -0700
commit408aa46ca8586c9687dd237b8cd2fefed33ab6ad (patch)
treed1d2ec64238ba8d70ba1c68d25243ac1238a1119 /src
parent0b47252999e8a220a1478ffdcf952f12e843186a (diff)
i965/fs: Don't make a name for a vector splitting temporary
If the name is just going to get dropped, don't bother making it. If the name is made, release it sooner (rather than later). No change Valgrind massif results for a trimmed apitrace of dota2. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp11
1 files changed, 8 insertions, 3 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 422d801b568..03e5fdbef2c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
@@ -363,12 +363,17 @@ brw_do_vector_splitting(exec_list *instructions)
entry->mem_ctx = ralloc_parent(entry->var);
for (unsigned int i = 0; i < entry->var->type->vector_elements; i++) {
- const char *name = ralloc_asprintf(mem_ctx, "%s_%c",
- entry->var->name,
- "xyzw"[i]);
+ char *const name = ir_variable::temporaries_allocate_names
+ ? ralloc_asprintf(mem_ctx, "%s_%c",
+ entry->var->name,
+ "xyzw"[i])
+ : NULL;
entry->components[i] = new(entry->mem_ctx) ir_variable(type, name,
ir_var_temporary);
+
+ ralloc_free(name);
+
entry->var->insert_before(entry->components[i]);
}