diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-04-22 04:58:53 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-04-24 02:22:32 +0000 |
commit | 4d995e0da818ee089c02f868b5bb17dbefbd7b4c (patch) | |
tree | dfca88d277ba5858f48bbb0c89862b243230a3ae /src/gallium/drivers/panfrost | |
parent | e9f84f1447b53a279779280172756f70c09eda91 (diff) |
panfrost/midgard: Optimize MIR in progress loop
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard_compile.c | 16 |
1 files changed, 11 insertions, 5 deletions
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); |