+
+ /* Liveness is now valid */
+ ctx->metadata |= MIDGARD_METADATA_LIVENESS;
+}
+
+/* Once liveness data is no longer valid, call this */
+
+void
+mir_invalidate_liveness(compiler_context *ctx)
+{
+ /* If we didn't already compute liveness, there's nothing to do */
+ if (!(ctx->metadata & MIDGARD_METADATA_LIVENESS))
+ return;
+
+ /* It's now invalid regardless */
+ ctx->metadata &= ~MIDGARD_METADATA_LIVENESS;
+
+ mir_foreach_block(ctx, block) {
+ if (block->live_in)
+ free(block->live_in);
+
+ if (block->live_out)
+ free(block->live_out);
+
+ block->live_in = NULL;
+ block->live_out = NULL;
+ }