Module: Mesa Branch: main Commit: a1f3c5eea7ced3668cda3137635ca080eae8484b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a1f3c5eea7ced3668cda3137635ca080eae8484b
Author: Faith Ekstrand <faith.ekstr...@collabora.com> Date: Wed Apr 19 17:43:57 2023 -0500 nir: Add asserts to nir_phi_builder_value_set_block_def Reviewed-by: Karol Herbst <kher...@redhat.com> Reviewed-by: Alyssa Rosenzweig <aly...@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580> --- src/compiler/nir/nir_phi_builder.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/nir/nir_phi_builder.c b/src/compiler/nir/nir_phi_builder.c index 088cc2249f1..810451233e8 100644 --- a/src/compiler/nir/nir_phi_builder.c +++ b/src/compiler/nir/nir_phi_builder.c @@ -175,6 +175,10 @@ void nir_phi_builder_value_set_block_def(struct nir_phi_builder_value *val, nir_block *block, nir_def *def) { + if (def != NEEDS_PHI) { + assert(def->bit_size == val->bit_size); + assert(def->num_components == val->num_components); + } _mesa_hash_table_insert(&val->ht, INDEX_TO_KEY(block->index), def); }