// 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);
// 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;
; CHECK: sideeffect(i32 0)
; CHECK: sink
+; CHECK-LABEL: define {{.*}}@bar.cold.1(
+; CHECK: sideeffect(i32 1)
+
declare void @sideeffect(i32)
declare void @sink() cold