summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2016-04-08 17:25:10 -0400
committerJason Ekstrand <[email protected]>2016-04-28 15:52:17 -0700
commit492b3554a7c61ca5fb3687d6fc696d51713c8136 (patch)
tree1804c661cfe0f389c3351481a2f06226820c20aa /src/compiler
parentc1b37c08bf34a3244476f10a7084803b8a58b3d8 (diff)
nir/lower_var_copies: fixup for new foreach_block()
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_var_copies.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/compiler/nir/nir_lower_var_copies.c b/src/compiler/nir/nir_lower_var_copies.c
index a5e3805f1be..d0d6452d803 100644
--- a/src/compiler/nir/nir_lower_var_copies.c
+++ b/src/compiler/nir/nir_lower_var_copies.c
@@ -154,30 +154,26 @@ nir_lower_var_copy_instr(nir_intrinsic_instr *copy, void *mem_ctx)
&copy->variables[1]->deref, mem_ctx);
}
-static bool
-lower_var_copies_block(nir_block *block, void *mem_ctx)
+static void
+lower_var_copies_impl(nir_function_impl *impl)
{
- nir_foreach_instr_safe(block, instr) {
- if (instr->type != nir_instr_type_intrinsic)
- continue;
+ void *mem_ctx = ralloc_parent(impl);
- nir_intrinsic_instr *copy = nir_instr_as_intrinsic(instr);
- if (copy->intrinsic != nir_intrinsic_copy_var)
- continue;
-
- nir_lower_var_copy_instr(copy, mem_ctx);
+ nir_foreach_block(block, impl) {
+ nir_foreach_instr_safe(block, instr) {
+ if (instr->type != nir_instr_type_intrinsic)
+ continue;
- nir_instr_remove(&copy->instr);
- ralloc_free(copy);
- }
+ nir_intrinsic_instr *copy = nir_instr_as_intrinsic(instr);
+ if (copy->intrinsic != nir_intrinsic_copy_var)
+ continue;
- return true;
-}
+ nir_lower_var_copy_instr(copy, mem_ctx);
-static void
-lower_var_copies_impl(nir_function_impl *impl)
-{
- nir_foreach_block_call(impl, lower_var_copies_block, ralloc_parent(impl));
+ nir_instr_remove(&copy->instr);
+ ralloc_free(copy);
+ }
+ }
}
/* Lowers every copy_var instruction in the program to a sequence of