aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_copy_propagate.c
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2016-04-12 14:55:19 -0400
committerJason Ekstrand <[email protected]>2016-04-28 15:52:17 -0700
commit1ba40d834b652e1d8bedbf2ea34f0c023c5cc27d (patch)
treef393cd6c115740e813c8ce3d79c4ab9a0b0d53a0 /src/compiler/nir/nir_opt_copy_propagate.c
parent8dd7d7892581c275cadd22b42c33fa9769c396ea (diff)
nir/opt_cp: fixup for new foreach_block()
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opt_copy_propagate.c')
-rw-r--r--src/compiler/nir/nir_opt_copy_propagate.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c
index 6847e71b35e..99aebae6867 100644
--- a/src/compiler/nir/nir_opt_copy_propagate.c
+++ b/src/compiler/nir/nir_opt_copy_propagate.c
@@ -241,28 +241,20 @@ copy_prop_if(nir_if *if_stmt)
}
static bool
-copy_prop_block(nir_block *block, void *_state)
-{
- bool *progress = (bool *) _state;
-
- nir_foreach_instr(block, instr) {
- if (copy_prop_instr(instr))
- *progress = true;
- }
-
- nir_if *if_stmt = nir_block_get_following_if(block);
- if (if_stmt && copy_prop_if(if_stmt))
- *progress = true;
-
- return true;
-}
-
-static bool
nir_copy_prop_impl(nir_function_impl *impl)
{
bool progress = false;
- nir_foreach_block_call(impl, copy_prop_block, &progress);
+ nir_foreach_block(block, impl) {
+ nir_foreach_instr(block, instr) {
+ if (copy_prop_instr(instr))
+ progress = true;
+ }
+
+ nir_if *if_stmt = nir_block_get_following_if(block);
+ if (if_stmt && copy_prop_if(if_stmt))
+ progress = true;
+ }
if (progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |