X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fnir%2Fnir_lower_regs_to_ssa.c;h=e045d97bac72317b187db017219e6797af2d6685;hb=3fdbeb70e1a1f98baa6a830901aab44ebd74c078;hp=027c5db504cba203dd50bacaa42b76022997a502;hpb=2c8c5cc87d55546cf3b3bedaf0da5bd3ecede322;p=mesa.git diff --git a/src/compiler/nir/nir_lower_regs_to_ssa.c b/src/compiler/nir/nir_lower_regs_to_ssa.c index 027c5db504c..e045d97bac7 100644 --- a/src/compiler/nir/nir_lower_regs_to_ssa.c +++ b/src/compiler/nir/nir_lower_regs_to_ssa.c @@ -273,21 +273,7 @@ nir_lower_regs_to_ssa_impl(nir_function_impl *impl) * loops, a phi source may be a back-edge so we have to handle it as if * it were one of the last instructions in the predecessor block. */ - for (unsigned i = 0; i < ARRAY_SIZE(block->successors); i++) { - if (block->successors[i] == NULL) - continue; - - nir_foreach_instr(instr, block->successors[i]) { - if (instr->type != nir_instr_type_phi) - break; - - nir_phi_instr *phi = nir_instr_as_phi(instr); - nir_foreach_phi_src(phi_src, phi) { - if (phi_src->pred == block) - rewrite_src(&phi_src->src, &state); - } - } - } + nir_foreach_phi_src_leaving_block(block, rewrite_src, &state); } nir_phi_builder_finish(phi_build);