[llvm] CloneFunction: Do not delete blocks with address taken (PR #134209)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 21:55:19 PDT 2025


================
@@ -928,7 +928,7 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
     }
 
     BasicBlock *Dest = BI->getSuccessor(0);
-    if (!Dest->getSinglePredecessor()) {
+    if (!Dest->getSinglePredecessor() || Dest->hasAddressTaken()) {
----------------
nickdesaulniers wrote:

perhaps worth updating the comment block on L918-L921?

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


More information about the llvm-commits mailing list