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 <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Ian Romanick 2014-05-23 20:03:31 -07:00
parent 0b47252999
commit 408aa46ca8

View file

@ -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]);
}