nouveau: switch to nir_metadata_divergence
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30814>
This commit is contained in:
committed by
Marge Bot
parent
175c06e5cd
commit
1d6082bf56
@@ -792,7 +792,7 @@ nak_nir_remove_barriers(nir_shader *nir)
|
|||||||
nir->info.uses_control_barrier = false;
|
nir->info.uses_control_barrier = false;
|
||||||
|
|
||||||
return nir_shader_intrinsics_pass(nir, nak_nir_remove_barrier_intrin,
|
return nir_shader_intrinsics_pass(nir, nak_nir_remove_barrier_intrin,
|
||||||
nir_metadata_control_flow,
|
nir_metadata_control_flow | nir_metadata_divergence,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1046,7 +1046,6 @@ nak_postprocess_nir(nir_shader *nir,
|
|||||||
OPT(nir, nak_nir_split_64bit_conversions);
|
OPT(nir, nak_nir_split_64bit_conversions);
|
||||||
|
|
||||||
bool lcssa_progress = nir_convert_to_lcssa(nir, false, false);
|
bool lcssa_progress = nir_convert_to_lcssa(nir, false, false);
|
||||||
nir_divergence_analysis(nir);
|
|
||||||
|
|
||||||
if (nak->sm >= 75) {
|
if (nak->sm >= 75) {
|
||||||
if (lcssa_progress) {
|
if (lcssa_progress) {
|
||||||
@@ -1055,12 +1054,14 @@ nak_postprocess_nir(nir_shader *nir,
|
|||||||
if (OPT(nir, nak_nir_lower_non_uniform_ldcx)) {
|
if (OPT(nir, nak_nir_lower_non_uniform_ldcx)) {
|
||||||
OPT(nir, nir_copy_prop);
|
OPT(nir, nir_copy_prop);
|
||||||
OPT(nir, nir_opt_dce);
|
OPT(nir, nir_opt_dce);
|
||||||
nir_divergence_analysis(nir);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OPT(nir, nak_nir_remove_barriers);
|
OPT(nir, nak_nir_remove_barriers);
|
||||||
|
|
||||||
|
/* Call divergence analysis regardless of sm version. */
|
||||||
|
nir_divergence_analysis(nir);
|
||||||
|
|
||||||
if (nak->sm >= 70) {
|
if (nak->sm >= 70) {
|
||||||
if (nak_should_print_nir()) {
|
if (nak_should_print_nir()) {
|
||||||
fprintf(stderr, "Structured NIR for %s shader:\n",
|
fprintf(stderr, "Structured NIR for %s shader:\n",
|
||||||
@@ -1077,6 +1078,9 @@ nak_postprocess_nir(nir_shader *nir,
|
|||||||
if (func->impl) {
|
if (func->impl) {
|
||||||
nir_index_blocks(func->impl);
|
nir_index_blocks(func->impl);
|
||||||
nir_index_ssa_defs(func->impl);
|
nir_index_ssa_defs(func->impl);
|
||||||
|
|
||||||
|
/* Ensure that divergence information is correct. */
|
||||||
|
assert(func->impl->valid_metadata & nir_metadata_divergence);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -425,6 +425,8 @@ recompute_phi_divergence_impl(nir_function_impl *impl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while(progress);
|
} while(progress);
|
||||||
|
|
||||||
|
impl->valid_metadata |= nir_metadata_divergence;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
@@ -441,7 +443,7 @@ lower_cf_func(nir_function *func)
|
|||||||
nir_function_impl *old_impl = func->impl;
|
nir_function_impl *old_impl = func->impl;
|
||||||
|
|
||||||
/* We use this in block_is_merge() */
|
/* We use this in block_is_merge() */
|
||||||
nir_metadata_require(old_impl, nir_metadata_dominance);
|
nir_metadata_require(old_impl, nir_metadata_dominance | nir_metadata_divergence);
|
||||||
|
|
||||||
/* First, we temporarily get rid of SSA. This will make all our block
|
/* First, we temporarily get rid of SSA. This will make all our block
|
||||||
* motion way easier.
|
* motion way easier.
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ nak_nir_lower_non_uniform_ldcx(nir_shader *nir)
|
|||||||
nir_builder b = nir_builder_create(impl);
|
nir_builder b = nir_builder_create(impl);
|
||||||
|
|
||||||
/* We use block indices to determine when something is a predecessor */
|
/* We use block indices to determine when something is a predecessor */
|
||||||
nir_metadata_require(impl, nir_metadata_block_index);
|
nir_metadata_require(impl, nir_metadata_block_index | nir_metadata_divergence);
|
||||||
|
|
||||||
if (lower_cf_list(&b, &impl->body)) {
|
if (lower_cf_list(&b, &impl->body)) {
|
||||||
nir_metadata_preserve(impl, nir_metadata_none);
|
nir_metadata_preserve(impl, nir_metadata_none);
|
||||||
|
|||||||
@@ -105,10 +105,12 @@ nak_nir_mark_lcssa_invariants(nir_shader *shader)
|
|||||||
|
|
||||||
nir_foreach_function_impl(impl, shader) {
|
nir_foreach_function_impl(impl, shader) {
|
||||||
nir_builder b = nir_builder_create(impl);
|
nir_builder b = nir_builder_create(impl);
|
||||||
|
nir_metadata_require(impl, nir_metadata_divergence);
|
||||||
|
|
||||||
if (lower_cf_list(&b, &impl->body)) {
|
if (lower_cf_list(&b, &impl->body)) {
|
||||||
progress = true;
|
progress = true;
|
||||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
nir_metadata_preserve(impl, nir_metadata_control_flow |
|
||||||
|
nir_metadata_divergence);
|
||||||
} else {
|
} else {
|
||||||
nir_metadata_preserve(impl, nir_metadata_all);
|
nir_metadata_preserve(impl, nir_metadata_all);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user