nir/gcm: stop preserving nir_metadata_loop_analysis

This pass changes instr_cost if it makes progress.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32005>
This commit is contained in:
Rhys Perry 2025-01-21 15:49:35 +00:00 committed by Marge Bot
parent 36840db6fe
commit bfc570ff98

View file

@ -857,8 +857,12 @@ opt_gcm_impl(nir_shader *shader, nir_function_impl *impl, bool value_number)
ralloc_free(state.blocks);
ralloc_free(state.instr_infos);
nir_metadata_preserve(impl, nir_metadata_control_flow |
nir_metadata_loop_analysis);
if (state.progress) {
nir_metadata_preserve(impl, nir_metadata_control_flow);
} else {
nir_metadata_preserve(impl, nir_metadata_control_flow |
nir_metadata_loop_analysis);
}
return state.progress;
}