pan/mdg: Move r1.w writeout to branch->dest
authorIcecream95 <ixn@keemail.me>
Fri, 5 Jun 2020 12:24:22 +0000 (00:24 +1200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 10 Jun 2020 13:54:03 +0000 (13:54 +0000)
There will need to be sources for depth and stencil writeout, so
something has to be moved to the dest of the writeout branch.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5065>

src/panfrost/midgard/midgard_ra.c
src/panfrost/midgard/midgard_schedule.c

index 112485b8b837a70a217ecdc68df0210dbf05b7f5..9f092b6dd3b8985a18925b4243cd3f64e9460462 100644 (file)
@@ -389,7 +389,7 @@ mir_compute_interference(
                         midgard_block *block = (midgard_block *) _block;
                         mir_foreach_instr_in_block_rev(block, ins) {
                                 if (ins->writeout)
-                                        r1w = ins->src[2];
+                                        r1w = ins->dest;
                         }
 
                         if (r1w != ~0)
@@ -616,10 +616,10 @@ allocate_registers(compiler_context *ctx, bool *spilled)
                 if (ins->src[1] < ctx->temp_count)
                         l->solutions[ins->src[1]] = (16 * 1) + COMPONENT_Z * 4;
 
-                if (ins->src[2] < ctx->temp_count)
-                        l->solutions[ins->src[2]] = (16 * 1) + COMPONENT_W * 4;
+                if (ins->dest < ctx->temp_count)
+                        l->solutions[ins->dest] = (16 * 1) + COMPONENT_W * 4;
         }
-        
+
         mir_compute_interference(ctx, l);
 
         *spilled = !lcra_solve(l);
index d823155ccf13813cf00c3ed67bba1699bd5248ee..dc127dcea9008b6b328d5d6df35e897505d07d53 100644 (file)
@@ -972,8 +972,8 @@ mir_schedule_alu(
 
                 vadd->unit = UNIT_VADD;
                 vadd->mask = 0x1;
-                branch->src[2] = vadd->dest;
-                branch->src_types[2] = vadd->dest_type;
+                branch->dest = vadd->dest;
+                branch->dest_type = vadd->dest_type;
         }
 
         mir_choose_alu(&vadd, instructions, worklist, len, &predicate, UNIT_VADD);