[llvm] [FunctionSpecializer] Keep the blocks in dead functions and remove the callsites of dead function properly. (PR #154668)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 11:01:35 PDT 2025


================
@@ -844,6 +844,16 @@ void FunctionSpecializer::removeDeadFunctions() {
                       << F->getName() << "\n");
     if (FAM)
       FAM->clear(*F, F->getName());
+
+    // Remove all the callsites that were proven unreachable once, and replace
+    // them with poison.
+    for (User *U : make_early_inc_range(F->users())) {
+      assert((isa<CallInst>(U) || isa<InvokeInst>(U)) &&
----------------
XChy wrote:

As we do not really make use of the confusing concept "fully specialized", I decide only to use the concept `DeadFunctions`.

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


More information about the llvm-commits mailing list