pan/midgard: Calculate temp_count for liveness
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 4 Oct 2019 01:51:27 +0000 (21:51 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 4 Oct 2019 02:29:51 +0000 (22:29 -0400)
This needs to be correct or the analysis fails.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_liveness.c
src/panfrost/midgard/mir.c

index 4aceab7e3bc9e867777211b61c3b6be54fb98ba7..e272931bd2fcd0e4a52091da2a13be124b281551 100644 (file)
@@ -117,6 +117,8 @@ mir_compute_liveness(compiler_context *ctx)
         if (ctx->metadata & MIDGARD_METADATA_LIVENESS)
                 return;
 
+        mir_compute_temp_count(ctx);
+
         /* List of midgard_block */
         struct set *work_list = _mesa_set_create(ctx,
                         _mesa_hash_pointer,
index e19ed4f98a6c38b574d34fde9309fbb68e6d7788..ff5e1d1d8722a8c1c1342b5f5add73731ced2d1e 100644 (file)
@@ -557,7 +557,7 @@ mir_compute_temp_count(compiler_context *ctx)
 
         mir_foreach_instr_global(ctx, ins) {
                 if (ins->dest < SSA_FIXED_MINIMUM)
-                        max_dest = MAX2(max_dest, ins->dest);
+                        max_dest = MAX2(max_dest, ins->dest + 1);
         }
 
         ctx->temp_count = max_dest;