pan/midgard: Add dont_eliminate flag
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 12 Aug 2019 22:29:03 +0000 (15:29 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 14 Aug 2019 23:42:40 +0000 (16:42 -0700)
We need to treat fragment writes specially.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/compiler.h
src/panfrost/midgard/midgard_opt_dce.c

index cf7547ccda3e9c4ee80e66c04f8c8c6b85cbc2d3..52113dda33f241a5752e74646bdc27d389c8a9f4 100644 (file)
@@ -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 */
index 9964675763c2bf705f3f13d525aede19c9315fcf..f2011831944ba2da1e6732cddfacfa346947460b 100644 (file)
@@ -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;