panfrost/midgard: Fix liveness analysis bugs
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 22 May 2019 02:41:51 +0000 (02:41 +0000)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 4 Jun 2019 20:14:50 +0000 (20:14 +0000)
This fixes liveness analysis with respect to inline constants and
branching. in practice, the symptom is abnormally high register
pressure.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Ryan Houdek <Sonicadvance1@gmail.com>
src/gallium/drivers/panfrost/midgard/midgard_liveness.c

index ab36583ef39a006394955a825554317fcdf3ca26..e4c89556162b3a010004889b36907afcb9c92e7a 100644 (file)
 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;
 }