From b9e514d25be7965fb36c714c8bf5ece417763600 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 14 Aug 2023 10:16:23 -0500 Subject: [PATCH] nir/propagate_invariant: Stop passing around nir_dest Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_propagate_invariant.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compiler/nir/nir_propagate_invariant.c b/src/compiler/nir/nir_propagate_invariant.c index bf5e6be..b59d68c 100644 --- a/src/compiler/nir/nir_propagate_invariant.c +++ b/src/compiler/nir/nir_propagate_invariant.c @@ -37,9 +37,9 @@ add_src_cb(nir_src *src, void *state) } static bool -dest_is_invariant(nir_dest *dest, struct set *invariants) +def_is_invariant(nir_def *def, struct set *invariants) { - return _mesa_set_search(invariants, &dest->ssa); + return _mesa_set_search(invariants, def); } static void @@ -81,7 +81,7 @@ propagate_invariant_instr(nir_instr *instr, struct set *invariants) switch (instr->type) { case nir_instr_type_alu: { nir_alu_instr *alu = nir_instr_as_alu(instr); - if (!dest_is_invariant(&alu->dest.dest, invariants)) + if (!def_is_invariant(&alu->dest.dest.ssa, invariants)) break; alu->exact = true; @@ -91,7 +91,7 @@ propagate_invariant_instr(nir_instr *instr, struct set *invariants) case nir_instr_type_tex: { nir_tex_instr *tex = nir_instr_as_tex(instr); - if (dest_is_invariant(&tex->dest, invariants)) + if (def_is_invariant(&tex->dest.ssa, invariants)) nir_foreach_src(instr, add_src_cb, invariants); break; } @@ -106,7 +106,7 @@ propagate_invariant_instr(nir_instr *instr, struct set *invariants) break; case nir_intrinsic_load_deref: - if (dest_is_invariant(&intrin->dest, invariants)) + if (def_is_invariant(&intrin->dest.ssa, invariants)) add_var(nir_intrinsic_get_var(intrin, 0), invariants); break; @@ -130,7 +130,7 @@ propagate_invariant_instr(nir_instr *instr, struct set *invariants) case nir_instr_type_phi: { nir_phi_instr *phi = nir_instr_as_phi(instr); - if (!dest_is_invariant(&phi->dest, invariants)) + if (!def_is_invariant(&phi->dest.ssa, invariants)) break; nir_foreach_phi_src(src, phi) { -- 2.7.4