From 5f3fe44595e53874908d1f047405d27861f1df0f Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 25 Jun 2010 13:44:09 -0700 Subject: [PATCH] Use a more sensible context in copy propagation. --- src/glsl/ir_copy_propagation.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/glsl/ir_copy_propagation.cpp b/src/glsl/ir_copy_propagation.cpp index 46ef667..a02852e 100644 --- a/src/glsl/ir_copy_propagation.cpp +++ b/src/glsl/ir_copy_propagation.cpp @@ -195,9 +195,8 @@ kill_invalidated_copies(ir_assignment *ir, exec_list *acp) * of a variable to a variable. */ static void -add_copy(ir_assignment *ir, exec_list *acp) +add_copy(void *ctx, ir_assignment *ir, exec_list *acp) { - void *ctx = talloc_parent(ir); acp_entry *entry; if (ir->condition) { @@ -226,6 +225,7 @@ copy_propagation_basic_block(ir_instruction *first, bool *out_progress = (bool *)data; bool progress = false; + void *ctx = talloc(NULL, void*); for (ir = first;; ir = (ir_instruction *)ir->next) { ir_assignment *ir_assign = ir->as_assignment(); @@ -234,12 +234,13 @@ copy_propagation_basic_block(ir_instruction *first, if (ir_assign) { kill_invalidated_copies(ir_assign, &acp); - add_copy(ir_assign, &acp); + add_copy(ctx, ir_assign, &acp); } if (ir == last) break; } *out_progress = progress; + talloc_free(ctx); } /** -- 2.7.4