summaryrefslogtreecommitdiff
path: root/src/microsoft
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>2023-05-11 13:49:02 -0400
committerMarge Bot <emma+marge@anholt.net>2023-05-12 14:02:23 +0000
commit5a0223a2d487ce36e9f362d8a1312e23a9674dd3 (patch)
treed9136ecb9c3bc85d62447d8c37493f82a88677c8 /src/microsoft
parentaa6bdbd54a4c824661e4b65eb4fc6a357058f778 (diff)
downloadmesa-5a0223a2d487ce36e9f362d8a1312e23a9674dd3.tar.gz
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 <alyssa@rosenzweig.io> Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22967>
Diffstat (limited to 'src/microsoft')
-rw-r--r--src/microsoft/compiler/dxil_nir.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c
index 175c55be33c..39abd52268e 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 ||