rusticl: use cleanup funcs
authorDave Airlie <airlied@redhat.com>
Tue, 25 Oct 2022 02:57:29 +0000 (12:57 +1000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 12 Sep 2023 01:57:50 +0000 (01:57 +0000)
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>

src/gallium/frontends/rusticl/core/kernel.rs
src/gallium/frontends/rusticl/mesa/compiler/nir.rs

index af980ab..b951ddc 100644 (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();
 
index 8ae04d3..a3e00e5 100644 (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,