Module: Mesa
Branch: master
Commit: c453921c91cb43a098b3e889bf0dfaf76b2bafce
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c453921c91cb43a098b3e889bf0dfaf76b2bafce

Author: Erico Nunes <[email protected]>
Date:   Wed Mar 10 22:22:01 2021 +0100

lima: run nir dce after nir_lower_vec_to_movs

Some of the 'vec*' nir instructions may hold references to dead code
until the nir_lower_vec_to_movs pass runs.
After nir_lower_vec_to_movs, that code can finally be cleaned by dce,
so add an additional dce pass.
This not only potentially further removes unneeded code from the nir
representation but also prevents bugs with the compiler from special
case unused code that is not expected (e.g. root undef type nodes).

Signed-off-by: Erico Nunes <[email protected]>
Reviewed-by: Vasily Khoruzhick <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9507>

---

 src/gallium/drivers/lima/lima_program.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/lima/lima_program.c 
b/src/gallium/drivers/lima/lima_program.c
index 822ab79923b..8d154d1998e 100644
--- a/src/gallium/drivers/lima/lima_program.c
+++ b/src/gallium/drivers/lima/lima_program.c
@@ -261,6 +261,7 @@ lima_program_optimize_fs_nir(struct nir_shader *s,
 
    NIR_PASS_V(s, nir_move_vec_src_uses_to_dest);
    NIR_PASS_V(s, nir_lower_vec_to_movs, lima_vec_to_movs_filter_cb, NULL);
+   NIR_PASS_V(s, nir_opt_dce); /* clean up any new dead code from vec to movs 
*/
 
    NIR_PASS_V(s, lima_nir_duplicate_load_uniforms);
    NIR_PASS_V(s, lima_nir_duplicate_load_inputs);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to