microsoft/compiler: Move nir_lower_undef_to_zero out of the optimization loop

Otherwise after https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7710
I'm getting fighting between this pass and nir_opt_if.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31003>
This commit is contained in:
Jesse Natalie
2024-09-03 11:39:09 -07:00
committed by Marge Bot
parent 192ef947a9
commit 44cc67e659

View File

@@ -6328,7 +6328,6 @@ optimize_nir(struct nir_shader *s, const struct nir_to_dxil_options *opts)
NIR_PASS(progress, s, nir_lower_alu);
NIR_PASS(progress, s, nir_opt_constant_folding);
NIR_PASS(progress, s, nir_opt_undef);
NIR_PASS(progress, s, nir_lower_undef_to_zero);
NIR_PASS(progress, s, nir_opt_deref);
NIR_PASS(progress, s, dxil_nir_lower_upcast_phis, opts->lower_int16 ? 32 : 16);
NIR_PASS(progress, s, nir_lower_64bit_phis);
@@ -6343,6 +6342,8 @@ optimize_nir(struct nir_shader *s, const struct nir_to_dxil_options *opts)
progress = false;
NIR_PASS(progress, s, nir_opt_algebraic_late);
} while (progress);
NIR_PASS_V(s, nir_lower_undef_to_zero);
}
static
@@ -6614,7 +6615,7 @@ nir_to_dxil(struct nir_shader *s, const struct nir_to_dxil_options *opts,
* might be too opaque for the pass to see that they're next to each other. */
optimize_nir(s, opts);
/* Vectorize UBO/SSBO accesses aggressively. This can help increase alignment to enable us to do better
/* Vectorize UBO/SSBO accesses aggressively. This can help increase alignment to enable us to do better
* chunking of loads and stores after lowering bit sizes. Ignore load/store size limitations here, we'll
* address them with lower_mem_access_bit_sizes */
nir_load_store_vectorize_options vectorize_opts = {