diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp --- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp +++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp @@ -150,9 +150,10 @@ // // Resumes that are not reachable from a cleanup landing pad are considered to // be unreachable. It’s not safe to split them out either. + if (BB.hasAddressTaken() || BB.isEHPad()) + return false; auto Term = BB.getTerminator(); - return !BB.hasAddressTaken() && !BB.isEHPad() && !isa(Term) && - !isa(Term); + return !isa(Term) && !isa(Term); } /// Mark \p F cold. Based on this assumption, also optimize it for minimum size.