[llvm] dcbbc69 - Calculate getTerminator only when necessary
Aditya Kumar via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 13 20:16:39 PDT 2021
Author: Aditya Kumar
Date: 2021-06-13T20:16:07-07:00
New Revision: dcbbc69cc58294cedc865259c6fd5ba80ecd9bd3
URL: https://github.com/llvm/llvm-project/commit/dcbbc69cc58294cedc865259c6fd5ba80ecd9bd3
DIFF: https://github.com/llvm/llvm-project/commit/dcbbc69cc58294cedc865259c6fd5ba80ecd9bd3.diff
LOG: Calculate getTerminator only when necessary
Differential Revision: https://reviews.llvm.org/D104202
Added:
Modified:
llvm/lib/Transforms/IPO/HotColdSplitting.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
index 8dc480f28105..833049d6896f 100644
--- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -150,9 +150,10 @@ static bool mayExtractBlock(const BasicBlock &BB) {
//
// 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<InvokeInst>(Term) &&
- !isa<ResumeInst>(Term);
+ return !isa<InvokeInst>(Term) && !isa<ResumeInst>(Term);
}
/// Mark \p F cold. Based on this assumption, also optimize it for minimum size.
More information about the llvm-commits
mailing list