diff options
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_nir.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_nir.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index abaa82a0331..d69a5a4fb26 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -1650,3 +1650,15 @@ bool lp_build_nir_llvm( ralloc_free(bld_base->regs); return true; } + +/* do some basic opts to remove some things we don't want to see. */ +void lp_build_opt_nir(struct nir_shader *nir) +{ + bool progress; + do { + progress = false; + NIR_PASS_V(nir, nir_opt_constant_folding); + NIR_PASS_V(nir, nir_opt_algebraic); + } while (progress); + nir_lower_bool_to_int32(nir); +} |