Lines Matching refs:nir
24 #include "nir.h"
41 static void sweep_cf_node(nir_shader *nir, nir_cf_node *cf_node);
44 sweep_src_indirect(nir_src *src, void *nir)
47 ralloc_steal(nir, src->reg.indirect);
53 sweep_dest_indirect(nir_dest *dest, void *nir)
56 ralloc_steal(nir, dest->reg.indirect);
62 sweep_block(nir_shader *nir, nir_block *block)
64 ralloc_steal(nir, block);
76 ralloc_steal(nir, instr);
78 nir_foreach_src(instr, sweep_src_indirect, nir);
79 nir_foreach_dest(instr, sweep_dest_indirect, nir);
84 sweep_if(nir_shader *nir, nir_if *iff)
86 ralloc_steal(nir, iff);
89 sweep_cf_node(nir, cf_node);
93 sweep_cf_node(nir, cf_node);
98 sweep_loop(nir_shader *nir, nir_loop *loop)
100 ralloc_steal(nir, loop);
103 sweep_cf_node(nir, cf_node);
108 sweep_cf_node(nir_shader *nir, nir_cf_node *cf_node)
112 sweep_block(nir, nir_cf_node_as_block(cf_node));
115 sweep_if(nir, nir_cf_node_as_if(cf_node));
118 sweep_loop(nir, nir_cf_node_as_loop(cf_node));
126 sweep_impl(nir_shader *nir, nir_function_impl *impl)
128 ralloc_steal(nir, impl);
130 steal_list(nir, nir_variable, &impl->locals);
131 steal_list(nir, nir_register, &impl->registers);
134 sweep_cf_node(nir, cf_node);
137 sweep_block(nir, impl->end_block);
144 sweep_function(nir_shader *nir, nir_function *f)
146 ralloc_steal(nir, f);
147 ralloc_steal(nir, f->params);
150 sweep_impl(nir, f->impl);
154 nir_sweep(nir_shader *nir)
159 ralloc_adopt(rubbish, nir);
161 ralloc_steal(nir, (char *)nir->info.name);
162 if (nir->info.label)
163 ralloc_steal(nir, (char *)nir->info.label);
166 steal_list(nir, nir_variable, &nir->uniforms);
167 steal_list(nir, nir_variable, &nir->inputs);
168 steal_list(nir, nir_variable, &nir->outputs);
169 steal_list(nir, nir_variable, &nir->shared);
170 steal_list(nir, nir_variable, &nir->globals);
171 steal_list(nir, nir_variable, &nir->system_values);
174 foreach_list_typed(nir_function, func, node, &nir->functions) {
175 sweep_function(nir, func);
178 ralloc_steal(nir, nir->constant_data);