From: Alyssa Rosenzweig Date: Mon, 10 Jun 2019 15:21:24 +0000 (-0700) Subject: panfrost: Ignore discards in dead branch analysis X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e9703fb4162e85943c52b6559d3554b521125da4;p=mesa.git panfrost: Ignore discards in dead branch analysis Fixes regressions in dEQP-GLES2.functional.shaders.discard.dynamic_loop_* Signed-off-by: Alyssa Rosenzweig --- 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);