}
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 |