diff options
author | Connor Abbott <[email protected]> | 2016-04-12 14:49:09 -0400 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-04-28 15:52:17 -0700 |
commit | 8dd7d7892581c275cadd22b42c33fa9769c396ea (patch) | |
tree | d0a0fdeb87eccc0f28de799d26ae441d8e789f12 /src | |
parent | 1a8c17a59e953e31de1c2f5b07d096a7e271e12f (diff) |
nir/opt_remove_phis: fixup for new foreach_block()
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/nir/nir_opt_remove_phis.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/nir/nir_opt_remove_phis.c b/src/compiler/nir/nir_opt_remove_phis.c index 07c575660b4..0625297507b 100644 --- a/src/compiler/nir/nir_opt_remove_phis.c +++ b/src/compiler/nir/nir_opt_remove_phis.c @@ -43,9 +43,9 @@ */ static bool -remove_phis_block(nir_block *block, void *state) +remove_phis_block(nir_block *block) { - bool *progress = state; + bool progress = false; nir_foreach_instr_safe(block, instr) { if (instr->type != nir_instr_type_phi) @@ -95,10 +95,10 @@ remove_phis_block(nir_block *block, void *state) nir_ssa_def_rewrite_uses(&phi->dest.ssa, nir_src_for_ssa(def)); nir_instr_remove(instr); - *progress = true; + progress = true; } - return true; + return progress; } static bool @@ -106,7 +106,9 @@ remove_phis_impl(nir_function_impl *impl) { bool progress = false; - nir_foreach_block_call(impl, remove_phis_block, &progress); + nir_foreach_block(block, impl) { + progress |= remove_phis_block(block); + } if (progress) { nir_metadata_preserve(impl, nir_metadata_block_index | |