Mesa (master): gallivm: run nir_opt_algebraic_late
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 20 08:19:44 UTC 2021
Module: Mesa
Branch: master
Commit: 1c82c05d5857159f166ff6f7c2a50c924fda6bc3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c82c05d5857159f166ff6f7c2a50c924fda6bc3
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Fri Apr 9 11:45:31 2021 +0200
gallivm: run nir_opt_algebraic_late
Without this, we're left with a bunch of medium-precision residue, like
i2imp. And to avoid that the lowering intrudces left-over instructions,
also run other lowering passes, similar to what other drivers do.
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185>
---
src/gallium/auxiliary/gallivm/lp_bld_nir.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index 38afac47de6..ce21ed86a99 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -2330,4 +2330,14 @@ void lp_build_opt_nir(struct nir_shader *nir)
} while (progress);
nir_lower_bool_to_int32(nir);
+
+ do {
+ progress = false;
+ NIR_PASS(progress, nir, nir_opt_algebraic_late);
+ if (progress) {
+ NIR_PASS_V(nir, nir_copy_prop);
+ NIR_PASS_V(nir, nir_opt_dce);
+ NIR_PASS_V(nir, nir_opt_cse);
+ }
+ } while (progress);
}
More information about the mesa-commit
mailing list