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

Author: Alyssa Rosenzweig <alyssa.rosenzw...@collabora.com>
Date:   Mon Aug 12 15:29:03 2019 -0700

pan/midgard: Add dont_eliminate flag

We need to treat fragment writes specially.

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

---

 src/panfrost/midgard/compiler.h        | 3 +++
 src/panfrost/midgard/midgard_opt_dce.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index cf7547ccda3..52113dda33f 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -117,6 +117,9 @@ typedef struct midgard_instruction {
         bool writeout;
         bool prepacked_branch;
 
+        /* Kind of a hack, but hint against aggressive DCE */
+        bool dont_eliminate;
+
         /* Masks in a saneish format. One bit per channel, not packed fancy.
          * Use this instead of the op specific ones, and switch over at emit
          * time */
diff --git a/src/panfrost/midgard/midgard_opt_dce.c 
b/src/panfrost/midgard/midgard_opt_dce.c
index 9964675763c..f2011831944 100644
--- a/src/panfrost/midgard/midgard_opt_dce.c
+++ b/src/panfrost/midgard/midgard_opt_dce.c
@@ -97,6 +97,7 @@ midgard_opt_post_move_eliminate(compiler_context *ctx, 
midgard_block *block, str
                 if (ins->type != TAG_ALU_4) continue;
                 if (ins->compact_branch) continue;
                 if (!OP_IS_MOVE(ins->alu.op)) continue;
+                if (ins->dont_eliminate) continue;
 
                 /* Check we're to the same place post-RA */
                 unsigned iA = ins->ssa_args.dest;

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

Reply via email to