nir: move tex_instr_remove_src
[mesa.git] / src / compiler / nir / nir_sweep.c
index 5c62154ec7f69a30e869a7f7786a752941982977..0f1debce3ada66edfe4aed1c18be1ab33e5447a6 100644 (file)
@@ -63,7 +63,7 @@ sweep_block(nir_shader *nir, nir_block *block)
 {
    ralloc_steal(nir, block);
 
-   nir_foreach_instr(block, instr) {
+   nir_foreach_instr(instr, block) {
       ralloc_steal(nir, instr);
 
       nir_foreach_src(instr, sweep_src_indirect, nir);
@@ -119,6 +119,8 @@ sweep_impl(nir_shader *nir, nir_function_impl *impl)
    ralloc_steal(nir, impl);
 
    ralloc_steal(nir, impl->params);
+   for (unsigned i = 0; i < impl->num_params; i++)
+      ralloc_steal(nir, impl->params[i]);
    ralloc_steal(nir, impl->return_var);
    steal_list(nir, nir_variable, &impl->locals);
    steal_list(nir, nir_register, &impl->registers);