From aba8b6675ae3ddc136f4f48cbabb7d3e24c6d58b Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 3 Jun 2021 11:10:48 -0700 Subject: [PATCH] nir/lower_int_to_float: Make sure the cursor is in the right spot. We need to make get it updated after we may have nir_instr_remove()d an instruction, and when we cross blocks. This didn't really matter before because the only builder usage was idiv, which other users of lower_int_to_float were probably never hitting. Reviewed-by: Jason Ekstrand Reviewed-by: Adam Jackson Part-of: --- src/compiler/nir/nir_lower_int_to_float.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_lower_int_to_float.c b/src/compiler/nir/nir_lower_int_to_float.c index 2a9b680..5e20c71 100644 --- a/src/compiler/nir/nir_lower_int_to_float.c +++ b/src/compiler/nir/nir_lower_int_to_float.c @@ -49,6 +49,8 @@ lower_alu_instr(nir_builder *b, nir_alu_instr *alu) return false; } + b->cursor = nir_before_instr(&alu->instr); + /* Replacement SSA value */ nir_ssa_def *rep = NULL; switch (alu->op) { -- 2.7.4