+ nir_builder_init(&b, function->impl);
+ nir_foreach_block(block, function->impl) {
+ nir_foreach_instr_safe(instr, block) {
+ if (instr->type == nir_instr_type_alu) {
+ nir_alu_instr *alu = nir_instr_as_alu(instr);
+
+ progress = opt_undef_csel(alu) || progress;
+ progress = opt_undef_vecN(&b, alu) || progress;
+ } else if (instr->type == nir_instr_type_intrinsic) {
+ nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
+ progress = opt_undef_store(intrin) || progress;
+ }
+ }
+ }
+
+ if (progress) {