From 31b9b048805ec5dce7d8533a7b8f07bd9944b69a Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Mon, 1 Aug 2022 09:24:44 -0700 Subject: [PATCH] nir: Use nir_foreach_phi_src consistently. I copy-and-pasted one of these and people noted that we had a better tool, so make sure nobody else copy and pastes it. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Jason Ekstrand Part-of: --- src/compiler/nir/nir_clone.c | 2 +- src/compiler/nir/nir_opt_if.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c index ee509da06e2..69569d17010 100644 --- a/src/compiler/nir/nir_clone.c +++ b/src/compiler/nir/nir_clone.c @@ -449,7 +449,7 @@ clone_phi(clone_state *state, const nir_phi_instr *phi, nir_block *nblk) */ nir_instr_insert_after_block(nblk, &nphi->instr); - foreach_list_typed(nir_phi_src, src, node, &phi->srcs) { + nir_foreach_phi_src(src, phi) { nir_phi_src *nsrc = nir_phi_instr_add_src(nphi, src->pred, src->src); /* Stash it in the list of phi sources. We'll walk this list and fix up diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c index 65904175c6a..0d1a5155138 100644 --- a/src/compiler/nir/nir_opt_if.c +++ b/src/compiler/nir/nir_opt_if.c @@ -857,7 +857,7 @@ rewrite_phi_predecessor_blocks(nir_if *nif, nir_phi_instr *phi = nir_instr_as_phi(instr); - foreach_list_typed(nir_phi_src, src, node, &phi->srcs) { + nir_foreach_phi_src(src, phi) { if (src->pred == old_then_block) { src->pred = new_then_block; } else if (src->pred == old_else_block) {