Mesa (main): nir/lower_int_to_float: Make sure the cursor is in the right spot.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 18 05:01:20 UTC 2021


Module: Mesa
Branch: main
Commit: aba8b6675ae3ddc136f4f48cbabb7d3e24c6d58b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aba8b6675ae3ddc136f4f48cbabb7d3e24c6d58b

Author: Emma Anholt <emma at anholt.net>
Date:   Thu Jun  3 11:10:48 2021 -0700

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 at jlekstrand.net>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11329>

---

 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 2a9b6803493..5e20c71a317 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) {



More information about the mesa-commit mailing list