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 <jason@jlekstrand.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11329>
This commit is contained in:
Emma Anholt
2021-06-03 11:10:48 -07:00
committed by Marge Bot
parent 31ab2735db
commit aba8b6675a
@@ -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) {