From 6c84a2665c619ca8dd0c4c64617b87ae1e5565e3 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 13 Aug 2019 15:59:41 -0700 Subject: [PATCH] pan/midgard: Allocate spill_slot once Multiple spill moves share a single spill slot. Issue found in Krita. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index ce97287d199..ab96a4b8fff 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -781,13 +781,15 @@ static void mir_spill_register( * implicitly. For special writes, spill to a work register */ if (!is_special || is_special_w) { + if (is_special_w) + spill_slot = spill_index++; + mir_foreach_instr_global_safe(ctx, ins) { if (ins->ssa_args.dest != spill_node) continue; midgard_instruction st; if (is_special_w) { - spill_slot = spill_index++; st = v_mov(spill_node, blank_alu_src, spill_slot); st.no_spill = true; } else { -- 2.30.2