pan/midgard: Allocate separate spill indices for lowered moves
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 9 Aug 2019 17:40:23 +0000 (10:40 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 12 Aug 2019 19:43:03 +0000 (12:43 -0700)
This helps RA be slightly more reasonable.

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

index a44d342c205072107a6c8cb048d59d606b89d13a..4754971acb2af79b8e59d0bd61d73cb0ab146953 100644 (file)
@@ -497,16 +497,14 @@ mir_lower_special_reads(compiler_context *ctx)
                                         midgard_instruction *use = mir_next_op(pre_use);
                                         assert(use);
                                         mir_insert_instruction_before(use, m);
+                                        mir_rewrite_index_dst_tag(ctx, i, idx, classes[j]);
                                 } else {
+                                        idx = spill_idx++;
+                                        m = v_mov(i, blank_alu_src, idx);
                                         mir_insert_instruction_before(pre_use, m);
+                                        mir_rewrite_index_src_single(pre_use, i, idx);
                                 }
                         }
-
-                        /* Rewrite to use */
-                        if (hazard_write)
-                                mir_rewrite_index_dst_tag(ctx, i, idx, classes[j]);
-                        else
-                                mir_rewrite_index_src_tag(ctx, i, idx, classes[j]);
                 }
         }