nir/peephole_select: add options struct

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33590>
This commit is contained in:
Georg Lehmann
2025-02-17 21:34:10 +01:00
committed by Marge Bot
parent edd82bd03a
commit ca8147edbe
41 changed files with 343 additions and 100 deletions
+12 -2
View File
@@ -2163,8 +2163,18 @@ v3d_optimize_nir(struct v3d_compile *c, struct nir_shader *s)
NIR_PASS(progress, s, nir_opt_cse);
/* before peephole_select as it can generate 64 bit bcsels */
NIR_PASS(progress, s, nir_lower_64bit_phis);
NIR_PASS(progress, s, nir_opt_peephole_select, 0, false, false);
NIR_PASS(progress, s, nir_opt_peephole_select, 24, true, true);
nir_opt_peephole_select_options peephole_select_options = {
.limit = 0,
};
NIR_PASS(progress, s, nir_opt_peephole_select, &peephole_select_options);
peephole_select_options = (nir_opt_peephole_select_options){
.limit = 24,
.indirect_load_ok = true,
.expensive_alu_ok = true,
};
NIR_PASS(progress, s, nir_opt_peephole_select, &peephole_select_options);
NIR_PASS(progress, s, nir_opt_algebraic);
NIR_PASS(progress, s, nir_opt_constant_folding);