rusticl: use cleanup funcs

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
This commit is contained in:
Dave Airlie
2022-10-25 12:57:29 +10:00
committed by Marge Bot
parent 18ca6c37f0
commit 14a6668964
2 changed files with 5 additions and 1 deletions

View File

@@ -441,7 +441,7 @@ fn lower_and_optimize_nir(
progress
} {}
nir.inline(lib_clc);
nir.remove_non_entrypoints();
nir.cleanup_functions();
// that should free up tons of memory
nir.sweep_mem();

View File

@@ -279,6 +279,10 @@ impl NirShader {
unsafe { nir_remove_non_entrypoints(self.nir.as_ptr()) };
}
pub fn cleanup_functions(&mut self) {
unsafe { nir_cleanup_functions(self.nir.as_ptr()) };
}
pub fn variables(&mut self) -> ExecListIter<nir_variable> {
ExecListIter::new(
&mut unsafe { self.nir.as_mut() }.variables,