pan/bi: Mark branches as having side effects
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 19 Feb 2021 14:17:48 +0000 (09:17 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Feb 2021 19:17:50 +0000 (19:17 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>

src/panfrost/bifrost/bir.c

index aa5bf87..93d51e6 100644 (file)
@@ -138,12 +138,17 @@ bi_next_clause(bi_context *ctx, pan_block *block, bi_clause *clause)
 }
 
 /* Does an instruction have a side effect not captured by its register
- * destination? Applies to certain message-passing instructions only, used in
- * dead code elimation */
+ * destination? Applies to certain message-passing instructions and branching
+ * only, used in dead code elimation. Branches are characterized by `last`
+ * which applies to them and some atomics, +BARRIER, +BLEND which implies no
+ * loss of generality */
 
 bool
 bi_side_effects(enum bi_opcode op)
 {
+        if (bi_opcode_props[op].last)
+                return true;
+
         switch (bi_opcode_props[op].message) {
         case BIFROST_MESSAGE_NONE:
         case BIFROST_MESSAGE_VARYING: