Module: Mesa
Branch: master
Commit: c94ccbf201a26cc7c0281787a555bada67dd73c9
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c94ccbf201a26cc7c0281787a555bada67dd73c9

Author: Alyssa Rosenzweig <alyssa.rosenzw...@collabora.com>
Date:   Sun Oct 13 14:16:37 2019 -0400

pan/midgard: Do not repeatedly spill same value

It doesn't make sense. You already spilled it once, and it didn't help.
Don't try again, or you'll end up in a loop.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzw...@collabora.com>

---

 src/panfrost/midgard/midgard_schedule.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/midgard/midgard_schedule.c 
b/src/panfrost/midgard/midgard_schedule.c
index a4ffa54c532..5b1daed6d7e 100644
--- a/src/panfrost/midgard/midgard_schedule.c
+++ b/src/panfrost/midgard/midgard_schedule.c
@@ -1206,15 +1206,27 @@ static void mir_spill_register(
 
         /* We can't spill any bundles that contain unspills. This could be
          * optimized to allow use of r27 to spill twice per bundle, but if
-         * you're at the point of optimizing spilling, it's too late. */
+         * you're at the point of optimizing spilling, it's too late.
+         *
+         * We also can't double-spill. */
 
         mir_foreach_block(ctx, block) {
                 mir_foreach_bundle_in_block(block, bun) {
                         bool no_spill = false;
 
-                        for (unsigned i = 0; i < bun->instruction_count; ++i)
+                        for (unsigned i = 0; i < bun->instruction_count; ++i) {
                                 no_spill |= bun->instructions[i]->no_spill;
 
+                                if (bun->instructions[i]->no_spill) {
+                                        mir_foreach_src(bun->instructions[i], 
s) {
+                                                unsigned src = 
bun->instructions[i]->src[s];
+
+                                                if (src < ctx->temp_count)
+                                                        
ra_set_node_spill_cost(g, src, -1.0);
+                                        }
+                                }
+                        }
+
                         if (!no_spill)
                                 continue;
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to