panfrost: Ignore discards in dead branch analysis
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 10 Jun 2019 15:21:24 +0000 (08:21 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 10 Jun 2019 15:23:08 +0000 (08:23 -0700)
Fixes regressions in
dEQP-GLES2.functional.shaders.discard.dynamic_loop_*

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/midgard/midgard_compile.c

index bc9521aa9edc9609299ea52a5ba0373dc467f648..4ea8834de2b4f135786954e4d983384036636635 100644 (file)
@@ -1731,6 +1731,11 @@ midgard_opt_cull_dead_branch(compiler_context *ctx, midgard_block *block)
                  * just generally special */
                 if (ins->prepacked_branch) continue;
 
+                /* Discards are similarly special and may not correspond to the
+                 * end of a block */
+
+                if (ins->branch.target_type == TARGET_DISCARD) continue;
+
                 if (branched) {
                         /* We already branched, so this is dead */
                         mir_remove_instruction(ins);