mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 10:50:10 +01:00
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:
parent
0b47252999
commit
408aa46ca8
1 changed files with 8 additions and 3 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue