[Mesa-dev] [PATCH 04/13] panfrost/midgard: Fix liveness analysis bugs

Alyssa Rosenzweig alyssa at rosenzweig.io
Sun May 26 02:39:15 UTC 2019


This fixes liveness analysis with respect to inline constants and
branching.

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
 .../drivers/panfrost/midgard/midgard_liveness.c        | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/panfrost/midgard/midgard_liveness.c b/src/gallium/drivers/panfrost/midgard/midgard_liveness.c
index ab36583ef39..e4c89556162 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_liveness.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_liveness.c
@@ -31,8 +31,14 @@
 static bool
 midgard_is_live_in_instr(midgard_instruction *ins, int src)
 {
-        if (ins->ssa_args.src0 == src) return true;
-        if (ins->ssa_args.src1 == src) return true;
+        if (ins->compact_branch)
+                return false;
+
+        if (ins->ssa_args.src0 == src)
+                return true;
+
+        if (!ins->ssa_args.inline_constant && ins->ssa_args.src1 == src)
+                return true;
 
         return false;
 }
-- 
2.20.1



More information about the mesa-dev mailing list