From eec49374b06fdf18a93c691642ee93c6b04612a8 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 5 Oct 2022 13:08:56 +0300 Subject: [PATCH] nir: fix NIR_DEBUG=validate_ssa_dominance validate_ssa_def_dominance() asserts : validate_assert(state, !BITSET_TEST(state->ssa_defs_found, def->index)); Because the previous validation lefts bits set when it processed the IR. Signed-off-by: Lionel Landwerlin Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_validate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index 530f069..c5a9fb6 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -1694,8 +1694,11 @@ validate_function_impl(nir_function_impl *impl, validate_state *state) validate_dominance = NIR_DEBUG(VALIDATE_SSA_DOMINANCE); } - if (validate_dominance) + if (validate_dominance) { + memset(state->ssa_defs_found, 0, BITSET_WORDS(impl->ssa_alloc) * + sizeof(BITSET_WORD)); validate_ssa_dominance(impl, state); + } } static void -- 2.7.4