[Mlir-commits] [mlir] [mlir] Enable remove-dead-values to delete unused private function (PR #161471)
    Mehdi Amini 
    llvmlistbot at llvm.org
       
    Fri Oct 10 10:13:00 PDT 2025
    
    
  
================
@@ -235,6 +235,25 @@ static void dropUsesAndEraseResults(Operation *op, BitVector toErase) {
   op->erase();
 }
 
+// Remove the dead functions from moduleOp.
+static void deleteDeadFunction(Operation *module) {
+  bool walkContinue = true;
+  while (walkContinue) {
+    walkContinue = false;
+    module->walk([&](FunctionOpInterface funcOp) {
+      if (funcOp.isPublic() || funcOp.isExternal())
+        return;
+
+      SymbolTable::UseRange uses = *funcOp.getSymbolUses(module);
----------------
joker-eph wrote:
This was mentioned to you earlier actually: https://github.com/llvm/llvm-project/pull/161471#pullrequestreview-3287757283
https://github.com/llvm/llvm-project/pull/161471
    
    
More information about the Mlir-commits
mailing list