From 092299f18ad1744d821b6551b2269ed107130b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Fri, 8 Mar 2024 09:34:37 +0100 Subject: [PATCH] r300: remove some late NIR passes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some of those are no longer needed after moving the sin/cos input fixups to finalize_nir, while others were are just some unneeded remnants from nir_to_tgsi era. Almost no shader-db change on RV530: total instructions in shared programs: 128940 -> 128939 (<.01%) instructions in affected programs: 154 -> 153 (-0.65%) helped: 3 HURT: 2 total cycles in shared programs: 197402 -> 197401 (<.01%) cycles in affected programs: 263 -> 262 (-0.38%) helped: 3 HURT: 2 or RV370: total instructions in shared programs: 83946 -> 83944 (<.01%) instructions in affected programs: 32 -> 30 (-6.25%) helped: 2 HURT: 0 total cycles in shared programs: 132829 -> 132827 (<.01%) cycles in affected programs: 93 -> 91 (-2.15%) helped: 2 HURT: 0 Signed-off-by: Pavel Ondračka Part-of: --- src/gallium/drivers/r300/compiler/nir_to_rc.c | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.c b/src/gallium/drivers/r300/compiler/nir_to_rc.c index 59dd6feec6e..e0a6d4930a5 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.c +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.c @@ -2380,7 +2380,6 @@ const void *nir_to_rc_options(struct nir_shader *s, struct ntr_compile *c; const void *tgsi_tokens; bool is_r500 = r300_screen(screen)->caps.is_r500; - nir_variable_mode no_indirects_mask = ntr_no_indirects_mask(s, screen); /* Lower array indexing on FS inputs. Since we don't set * ureg->supports_any_inout_decl_range, the TGSI input decls will be split to @@ -2402,35 +2401,7 @@ const void *nir_to_rc_options(struct nir_shader *s, nir_to_rc_lower_txp(s); NIR_PASS_V(s, nir_to_rc_lower_tex); - if (!s->options->lower_uniforms_to_ubo) { - NIR_PASS_V(s, nir_lower_uniforms_to_ubo, - screen->get_param(screen, PIPE_CAP_PACKED_UNIFORMS), - true); - } - - if (!screen->get_param(screen, PIPE_CAP_LOAD_CONSTBUF)) - NIR_PASS_V(s, nir_lower_ubo_vec4); - bool progress; - NIR_PASS_V(s, nir_opt_constant_folding); - - /* Clean up after triginometric input normalization. */ - NIR_PASS_V(s, nir_opt_vectorize, ntr_should_vectorize_instr, NULL); - do { - progress = false; - NIR_PASS(progress, s, nir_opt_shrink_vectors, false); - } while (progress); - NIR_PASS_V(s, nir_copy_prop); - NIR_PASS_V(s, nir_opt_cse); - NIR_PASS_V(s, nir_opt_dce); - NIR_PASS_V(s, nir_opt_shrink_stores, true); - - NIR_PASS_V(s, nir_lower_indirect_derefs, no_indirects_mask, UINT32_MAX); - - /* Lower demote_if to if (cond) { demote } because TGSI doesn't have a DEMOTE_IF. */ - NIR_PASS_V(s, nir_lower_discard_if, nir_lower_demote_if_to_cf); - - NIR_PASS_V(s, nir_lower_frexp); do { progress = false;