Module: Mesa
Branch: main
Commit: 2fb5ceab7aab35d628bd5ca804051a21bb1f98a8
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2fb5ceab7aab35d628bd5ca804051a21bb1f98a8

Author: Alyssa Rosenzweig <[email protected]>
Date:   Tue May 24 13:27:59 2022 -0400

pan/bi: Recoalesce tied operands after spilling

Otherwise we can fail to allocate tied operands if we spill the tied operand.
Seen in shaders/android/com.miHoYo.GenshinImpact/16.shader_test with a
particularly bad scheduling causing excessive spilling.

No shader-db changes.

Fixes: bc17288697f ("pan/bi: Lower split/collect before RA")
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16378>

---

 src/panfrost/bifrost/bi_ra.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c
index 31950ee9a29..253ac85c789 100644
--- a/src/panfrost/bifrost/bi_ra.c
+++ b/src/panfrost/bifrost/bi_ra.c
@@ -818,6 +818,11 @@ bi_register_allocate(bi_context *ctx)
                         spill_count += bi_spill_register(ctx,
                                         bi_node_to_index(spill_node, 
bi_max_temp(ctx)),
                                         spill_count);
+
+                        /* In case the spill affected an instruction with tied
+                         * operands, we need to fix up.
+                         */
+                        bi_coalesce_tied(ctx);
                 }
         }
 

Reply via email to