Module: Mesa Branch: master Commit: c3258f927c462cc2e24106e7841138452f7fec10 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3258f927c462cc2e24106e7841138452f7fec10
Author: Arcady Goldmints-Orlov <[email protected]> Date: Sat Jul 25 10:39:31 2020 -0500 broadcom/compiler: Add a constant folding pass after nir_lower_io The nir_lower_io pass produces a bunch of constant arithmetic, and assumes that constant folding will simplify it away. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6356> --- src/broadcom/compiler/vir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index d81931ec27b..d06f789161f 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -821,8 +821,11 @@ v3d_nir_lower_vs_early(struct v3d_compile *c) NIR_PASS_V(c->s, nir_lower_io, nir_var_shader_in | nir_var_shader_out, type_size_vec4, (nir_lower_io_options)0); - /* clean up nir_lower_io's deref_var remains */ + /* clean up nir_lower_io's deref_var remains and do a constant folding pass + * on the code it generated. + */ NIR_PASS_V(c->s, nir_opt_dce); + NIR_PASS_V(c->s, nir_opt_constant_folding); } static void _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
