nir/opt_deref: Report progress if we remove a deref
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 25 May 2019 04:29:15 +0000 (23:29 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 22 May 2020 18:41:15 +0000 (18:41 +0000)
Fixes: a1c688517de "nir/opt_deref: Properly optimize ptr_as_array..."
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5170>

src/compiler/nir/nir_deref.c

index 09eaa524e423b21a79b4281de4522b1f16acf558..61cf71e34604308c11a9e15d7baaa5112d0fe418 100644 (file)
@@ -943,7 +943,9 @@ opt_deref_cast(nir_builder *b, nir_deref_instr *cast)
    /* If uses would be a bit crazy */
    assert(list_is_empty(&cast->dest.ssa.if_uses));
 
-   nir_deref_instr_remove_if_unused(cast);
+   if (nir_deref_instr_remove_if_unused(cast))
+      progress = true;
+
    return progress;
 }