From e9703fb4162e85943c52b6559d3554b521125da4 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 10 Jun 2019 08:21:24 -0700 Subject: [PATCH] panfrost: Ignore discards in dead branch analysis Fixes regressions in dEQP-GLES2.functional.shaders.discard.dynamic_loop_* Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/midgard/midgard_compile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index bc9521aa9ed..4ea8834de2b 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -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); -- 2.30.2