From 14a666896403a3ba1ba852cf94ec129050ba84d8 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 25 Oct 2022 12:57:29 +1000 Subject: [PATCH] rusticl: use cleanup funcs Reviewed-by: Mike Blumenkrantz Part-of: --- src/gallium/frontends/rusticl/core/kernel.rs | 2 +- src/gallium/frontends/rusticl/mesa/compiler/nir.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index af980ab..b951ddc 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -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(); diff --git a/src/gallium/frontends/rusticl/mesa/compiler/nir.rs b/src/gallium/frontends/rusticl/mesa/compiler/nir.rs index 8ae04d3..a3e00e5 100644 --- a/src/gallium/frontends/rusticl/mesa/compiler/nir.rs +++ b/src/gallium/frontends/rusticl/mesa/compiler/nir.rs @@ -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 { ExecListIter::new( &mut unsafe { self.nir.as_mut() }.variables, -- 2.7.4