pan/midgard: Extend liveness analysis to st_vary
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 24 Jul 2019 18:16:15 +0000 (11:16 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 25 Jul 2019 13:37:22 +0000 (06:37 -0700)
These can consume sources now.

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

index 5f12cb9fc07caf2cc94e86b599ffa54a0e91d993..2f4bdc65c35df2a6b9e22795295b35fea1ace08b 100644 (file)
@@ -372,20 +372,13 @@ allocate_registers(compiler_context *ctx, bool *spilled)
                 mir_foreach_instr_in_block(block, ins) {
                         if (ins->compact_branch) continue;
 
-                        /* Dest is < 0 for st_vary instructions, which break
-                         * the usual SSA conventions. Liveness analysis doesn't
-                         * make sense on these instructions, so skip them to
-                         * avoid memory corruption */
-
-                        if (ins->ssa_args.dest < 0) continue;
-
                         if (ins->ssa_args.dest < SSA_FIXED_MINIMUM) {
                                 /* If this destination is not yet live, it is
                                  * now since we just wrote it */
 
                                 int dest = ins->ssa_args.dest;
 
-                                if (live_start[dest] == -1)
+                                if (dest >= 0 && live_start[dest] == -1)
                                         live_start[dest] = d;
                         }