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

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 24 04:10:11 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h llvm/lib/Transforms/IPO/FunctionSpecialization.cpp llvm/lib/Transforms/IPO/SCCP.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
index 18464bafa..324ba371f 100644
--- a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
@@ -847,7 +847,8 @@ void FunctionSpecializer::removeDeadFunctions() {
     // 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)) && "User of dead function must be call or invoke");
+      assert((isa<CallInst>(U) || isa<InvokeInst>(U)) &&
+             "User of dead function must be call or invoke");
       Instruction *CS = cast<Instruction>(U);
       CS->replaceAllUsesWith(PoisonValue::get(CS->getType()));
       CS->eraseFromParent();

``````````

</details>


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


More information about the llvm-commits mailing list