[llvm] [FunctionSpecializer] Do not mark function dead if any unexecutable call site exists (PR #154668)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 25 00:48:23 PDT 2025


================
@@ -167,7 +167,9 @@ static bool runIPSCCP(
   // constants if we have found them to be of constant values.
   bool MadeChanges = false;
   for (Function &F : M) {
-    if (F.isDeclaration())
+    // Skip the dead functions marked by FunctionSpecializer, avoiding removing
+    // blocks in dead functions.
+    if (F.isDeclaration() || Specializer.isDeadFunction(&F))
----------------
antoniofrighetto wrote:

```suggestion
    if (F.isDeclaration() ||
       (IsFuncSpecEnabled && Specializer.isDeadFunction(&F)))
```

https://github.com/llvm/llvm-project/pull/154668


More information about the llvm-commits mailing list