summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Transforms/IPO/HotColdSplitting.cpp7
-rw-r--r--llvm/test/Transforms/HotColdSplit/eh-pads.ll3
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
index d0f3fdf0c60..2cf8af35401 100644
--- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -391,7 +391,8 @@ public:
// Add SinkBB to the cold region. It's considered as an entry point before
// any sink-successor blocks.
- addBlockToRegion(&SinkBB, SinkScore);
+ if (mayExtractBlock(SinkBB))
+ addBlockToRegion(&SinkBB, SinkScore);
// Find all successors of SinkBB dominated by SinkBB using DFS.
auto SuccIt = ++df_begin(&SinkBB);
@@ -486,10 +487,6 @@ bool HotColdSplitting::outlineColdRegions(Function &F, ProfileSummaryInfo &PSI,
// Find all cold regions.
for (BasicBlock *BB : RPOT) {
- // Skip blocks which can't be outlined.
- if (!mayExtractBlock(*BB))
- continue;
-
// This block is already part of some outlining region.
if (ColdBlocks.count(BB))
continue;
diff --git a/llvm/test/Transforms/HotColdSplit/eh-pads.ll b/llvm/test/Transforms/HotColdSplit/eh-pads.ll
index caf02e9002d..979d005c1ce 100644
--- a/llvm/test/Transforms/HotColdSplit/eh-pads.ll
+++ b/llvm/test/Transforms/HotColdSplit/eh-pads.ll
@@ -58,6 +58,9 @@ normal:
; CHECK: sideeffect(i32 0)
; CHECK: sink
+; CHECK-LABEL: define {{.*}}@bar.cold.1(
+; CHECK: sideeffect(i32 1)
+
declare void @sideeffect(i32)
declare void @sink() cold
OpenPOWER on IntegriCloud