From a67ca0eb5930496644935f920129f6840e003521 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 19 Nov 2024 22:46:51 +0100 Subject: [PATCH] nir/instr_set: support instrs with no def Reviewed-by: Konstantin Seurer Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_instr_set.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_instr_set.c b/src/compiler/nir/nir_instr_set.c index 213a38f2776..582c8991559 100644 --- a/src/compiler/nir/nir_instr_set.c +++ b/src/compiler/nir/nir_instr_set.c @@ -786,7 +786,9 @@ nir_instr_set_add_or_rewrite(struct set *instr_set, nir_instr *instr, nir_instr_as_alu(match)->fp_fast_math |= nir_instr_as_alu(instr)->fp_fast_math; } - nir_def_rewrite_uses(def, new_def); + assert(!def == !new_def); + if (def) + nir_def_rewrite_uses(def, new_def); return match; } else {