From 5a0223a2d487ce36e9f362d8a1312e23a9674dd3 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 11 May 2023 13:49:02 -0400 Subject: [PATCH] dxil: Use nir_foreach_phi_safe This should be faster, since we're not iterating pointlessly over all the non-phis after the phi. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Konstantin Seurer Reviewed-by: Jesse Natalie Part-of: --- src/microsoft/compiler/dxil_nir.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c index 175c55b..39abd52 100644 --- a/src/microsoft/compiler/dxil_nir.c +++ b/src/microsoft/compiler/dxil_nir.c @@ -993,11 +993,7 @@ upcast_phi_impl(nir_function_impl *impl, unsigned min_bit_size) bool progress = false; nir_foreach_block_reverse(block, impl) { - nir_foreach_instr_safe(instr, block) { - if (instr->type != nir_instr_type_phi) - continue; - - nir_phi_instr *phi = nir_instr_as_phi(instr); + nir_foreach_phi_safe(phi, block) { assert(phi->dest.is_ssa); if (phi->dest.ssa.bit_size == 1 || -- 2.7.4