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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185>
This commit is contained in:
Erik Faye-Lund 2021-04-09 11:45:31 +02:00 committed by Marge Bot
parent da5f346e6c
commit 1c82c05d58

View file

@ -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);
}