From b17ec53c814d8effa0234ce3aa41fd4f2bb3765c Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 22 Feb 2021 08:17:46 +0100 Subject: [PATCH] broadcom/compiler: use nir_opt_sink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit total instructions in shared programs: 14072341 -> 14062334 (-0.07%) instructions in affected programs: 1996685 -> 1986678 (-0.50%) helped: 3038 HURT: 2432 Instructions are helped. total uniforms in shared programs: 3797720 -> 3794523 (-0.08%) uniforms in affected programs: 191711 -> 188514 (-1.67%) helped: 831 HURT: 449 Uniforms are helped. total max-temps in shared programs: 2340632 -> 2335124 (-0.24%) max-temps in affected programs: 113632 -> 108124 (-4.85%) helped: 2728 HURT: 436 Max-temps are helped. total spills in shared programs: 6050 -> 5931 (-1.97%) spills in affected programs: 2869 -> 2750 (-4.15%) helped: 14 HURT: 4 total fills in shared programs: 13970 -> 13371 (-4.29%) fills in affected programs: 8831 -> 8232 (-6.78%) helped: 14 HURT: 4 total inst-and-stalls in shared programs: 14103668 -> 14093712 (-0.07%) inst-and-stalls in affected programs: 2004035 -> 1994079 (-0.50%) helped: 3009 HURT: 2426 Inst-and-stalls are helped. LOST: 0 GAINED: 10 Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/compiler/nir_to_vir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index bc9473c0418..db3e2139bef 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -1767,6 +1767,11 @@ v3d_optimize_nir(struct nir_shader *s) NIR_PASS(progress, s, nir_opt_undef); } while (progress); + nir_move_options sink_opts = + nir_move_const_undef | nir_move_comparisons | nir_move_copies | + nir_move_load_ubo; + NIR_PASS(progress, s, nir_opt_sink, sink_opts); + NIR_PASS(progress, s, nir_opt_move, nir_move_load_ubo); }