diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 58060498fbb..d09791e8ec4 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -5557,6 +5557,7 @@ bool nir_opt_combine_memory_barriers(nir_shader *shader, bool nir_opt_combine_stores(nir_shader *shader, nir_variable_mode modes); +bool nir_copy_prop_impl(nir_function_impl *impl); bool nir_copy_prop(nir_shader *shader); bool nir_opt_copy_prop_vars(nir_shader *shader); diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c index 386587fa6c8..8b88779956a 100644 --- a/src/compiler/nir/nir_opt_copy_propagate.c +++ b/src/compiler/nir/nir_opt_copy_propagate.c @@ -162,7 +162,7 @@ copy_prop_instr(nir_function_impl *impl, nir_instr *instr) return progress; } -static bool +bool nir_copy_prop_impl(nir_function_impl *impl) { bool progress = false; diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 9a8a88ae9a8..2bf698629c1 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -1387,6 +1387,8 @@ vtn_function_emit(struct vtn_builder *b, struct vtn_function *func, vtn_foreach_instruction(b, func->start_block->label, func->end, vtn_handle_phi_second_pass); + if (func->nir_func->impl->structured) + nir_copy_prop_impl(impl); nir_rematerialize_derefs_in_use_blocks_impl(impl); /*