pan/midgard: Don't spill near a branch
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 24 Feb 2020 14:36:18 +0000 (09:36 -0500)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 27 Feb 2020 15:31:32 +0000 (16:31 +0100)
Fixes
dEQP-GLES2.functional.shaders.indexing.varying_array.vec2_dynamic_loop_write_
static_read with register pressure forced down.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>

src/panfrost/midgard/midgard_schedule.c

index 8dd5ac1..55fdba0 100644 (file)
@@ -1054,6 +1054,14 @@ mir_schedule_alu(
                         bundle.control |= stages[i]->unit;
                         bytes_emitted += bytes_for_instruction(stages[i]);
                         bundle.instructions[bundle.instruction_count++] = stages[i];
+
+                        /* If we branch, we can't spill to TLS since the store
+                         * instruction will never get executed. We could try to
+                         * break the bundle but this is probably easier for
+                         * now. */
+
+                        if (branch)
+                                stages[i]->no_spill |= (1 << REG_CLASS_WORK);
                 }
         }