nir/lower_bit_size: use nir_builder::constant_fold_alu

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41388>
This commit is contained in:
Daniel Schürmann 2026-04-29 15:32:38 +02:00 committed by Marge Bot
parent bc941eb4ff
commit 16bf0a2047
2 changed files with 2 additions and 3 deletions

View file

@ -556,9 +556,7 @@ radv_postprocess_nir(const struct radv_compiler_info *compiler_info, const struc
if (gfx_level >= GFX8)
nir_divergence_analysis(stage->nir);
if (nir_lower_bit_size(stage->nir, ac_nir_lower_bit_size_callback, &gfx_level)) {
NIR_PASS(_, stage->nir, nir_opt_constant_folding);
}
NIR_PASS(_, stage->nir, nir_lower_bit_size, ac_nir_lower_bit_size_callback, &gfx_level);
}
if (gfx_level >= GFX9) {
bool separate_g16 = gfx_level >= GFX10;

View file

@ -324,6 +324,7 @@ lower_impl(nir_function_impl *impl,
void *callback_data)
{
nir_builder b = nir_builder_create(impl);
b.constant_fold_alu = true;
bool progress = false;
nir_foreach_block(block, impl) {