nir: Add pass for trivializing register access

After running the pass, all register access intrinsics are guaranteed to be
"trivial" in the sense that the program is free of hazards preventing
propagating them away without inserting any copies.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23089>
This commit is contained in:
Alyssa Rosenzweig
2023-05-18 11:00:50 -04:00
committed by Marge Bot
parent 1d6c06e4b9
commit d313eba94e
3 changed files with 399 additions and 0 deletions
+3
View File
@@ -6249,6 +6249,9 @@ bool nir_mod_analysis(nir_ssa_scalar val, nir_alu_type val_type, unsigned div, u
bool
nir_remove_tex_shadow(nir_shader *shader, unsigned textures_bitmask);
void
nir_trivialize_registers(nir_shader *s);
static inline nir_intrinsic_instr *
nir_reg_get_decl(nir_ssa_def *reg)
{