summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-02-05 23:39:02 +0000
committerVedant Kumar <vsk@apple.com>2019-02-05 23:39:02 +0000
commitbd94b4287c9e98d60f260c426aeee4448eea0dbb (patch)
tree54b4c7fcfe18fd6d7232278f70fb45e101b5d614 /llvm/lib/Transforms
parente49209ed88395ef4ae0cf30fd2b547af68a9cae9 (diff)
downloadbcm5719-llvm-bd94b4287c9e98d60f260c426aeee4448eea0dbb.tar.gz
bcm5719-llvm-bd94b4287c9e98d60f260c426aeee4448eea0dbb.zip
[HotColdSplit] Do not split out `resume` instructions
Resumes that are not reachable from a cleanup landing pad are considered to be unreachable. It’s not safe to split them out. rdar://47808235 llvm-svn: 353242
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/HotColdSplitting.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
index 36dd6fa4be7..65e7938720d 100644
--- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -135,8 +135,12 @@ static bool mayExtractBlock(const BasicBlock &BB) {
// EH pads are unsafe to outline because doing so breaks EH type tables. It
// follows that invoke instructions cannot be extracted, because CodeExtractor
// requires unwind destinations to be within the extraction region.
- return !BB.hasAddressTaken() && !BB.isEHPad() &&
- !isa<InvokeInst>(BB.getTerminator());
+ //
+ // Resumes that are not reachable from a cleanup landing pad are considered to
+ // be unreachable. It’s not safe to split them out either.
+ auto Term = BB.getTerminator();
+ return !BB.hasAddressTaken() && !BB.isEHPad() && !isa<InvokeInst>(Term) &&
+ !isa<ResumeInst>(Term);
}
/// Mark \p F cold. Based on this assumption, also optimize it for minimum size.
OpenPOWER on IntegriCloud