From: Alyssa Rosenzweig Date: Mon, 22 Apr 2019 04:58:53 +0000 (+0000) Subject: panfrost/midgard: Optimize MIR in progress loop X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4d995e0da818ee089c02f868b5bb17dbefbd7b4c;p=mesa.git panfrost/midgard: Optimize MIR in progress 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 d297e505c1c..2c259ea525a 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -3685,12 +3685,18 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl util_dynarray_init(compiled, NULL); - /* Peephole optimizations */ + /* MIR-level optimizations */ - mir_foreach_block(ctx, block) { - midgard_opt_copy_prop(ctx, block); - midgard_opt_dead_code_eliminate(ctx, block); - } + bool progress = false; + + do { + progress = false; + + mir_foreach_block(ctx, block) { + progress |= midgard_opt_copy_prop(ctx, block); + progress |= midgard_opt_dead_code_eliminate(ctx, block); + } + } while (progress); /* Schedule! */ schedule_program(ctx);