nir: Invalidate live SSA def information when making new SSA defs.
authorEric Anholt <eric@anholt.net>
Wed, 26 Aug 2020 20:09:09 +0000 (13:09 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 31 Aug 2020 18:28:36 +0000 (18:28 +0000)
Noted by @jekstrand in review of the SSA live index changes.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6408>

src/compiler/nir/nir.c

index a94ccf09be19833f0b2d8c15d4c713f57920a566..24515f05cb800e8e6fdf954557b6bafbd22a6f1e 100644 (file)
@@ -801,6 +801,8 @@ add_ssa_def_cb(nir_ssa_def *def, void *state)
          nir_cf_node_get_function(&instr->block->cf_node);
 
       def->index = impl->ssa_alloc++;
+
+      impl->valid_metadata &= ~nir_metadata_live_ssa_defs;
    }
 
    return true;
@@ -1503,6 +1505,8 @@ nir_ssa_def_init(nir_instr *instr, nir_ssa_def *def,
          nir_cf_node_get_function(&instr->block->cf_node);
 
       def->index = impl->ssa_alloc++;
+
+      impl->valid_metadata &= ~nir_metadata_live_ssa_defs;
    } else {
       def->index = UINT_MAX;
    }