summaryrefslogtreecommitdiff
path: root/ir_dead_code.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-06-24 15:18:39 -0700
committerEric Anholt <eric@anholt.net>2010-06-24 15:18:39 -0700
commit6b01b50888d22ee330df44240591051cb55cf2a9 (patch)
tree51bdeade4b0f6e086a1cd43f692fb1d4ba7c3b6f /ir_dead_code.cpp
parente33c10328caec29616a5433b1d1df9088f3a84df (diff)
Move the talloc_parent lookup down in a few hot paths.
talloc_parent is still 80% of our runtime, but likely talloc_parent lookups will be reduced as we improve the handling of memory ownership.
Diffstat (limited to 'ir_dead_code.cpp')
-rw-r--r--ir_dead_code.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/ir_dead_code.cpp b/ir_dead_code.cpp
index 01b7d2d832..8821304682 100644
--- a/ir_dead_code.cpp
+++ b/ir_dead_code.cpp
@@ -77,7 +77,6 @@ public:
variable_entry *
ir_dead_code_visitor::get_variable_entry(ir_variable *var)
{
- void *ctx = talloc_parent(var);
assert(var);
foreach_iter(exec_list_iterator, iter, this->variable_list) {
variable_entry *entry = (variable_entry *)iter.get();
@@ -85,6 +84,8 @@ ir_dead_code_visitor::get_variable_entry(ir_variable *var)
return entry;
}
+ void *ctx = talloc_parent(var);
+
variable_entry *entry = new(ctx) variable_entry(var);
this->variable_list.push_tail(entry);
return entry;