mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 00:16:25 +00:00
[HotColdSplit] Mark entire function cold when entry block is cold
rdar://58855712
This commit is contained in:
parent
e58b532e8c
commit
c09998b436
@ -458,6 +458,10 @@ public:
|
||||
// first have predecessors within the extraction region.
|
||||
if (mayExtractBlock(SinkBB)) {
|
||||
addBlockToRegion(&SinkBB, SinkScore);
|
||||
if (pred_empty(&SinkBB)) {
|
||||
ColdRegion->EntireFunctionCold = true;
|
||||
return Regions;
|
||||
}
|
||||
} else {
|
||||
Regions.emplace_back();
|
||||
ColdRegion = &Regions.back();
|
||||
|
@ -50,6 +50,16 @@ if.end: ; preds = %entry
|
||||
ret void
|
||||
}
|
||||
|
||||
; Make sure we don't try to outline the entire function, especially when the
|
||||
; entry block is cold.
|
||||
; CHECK: define void @cold_entry_block() [[COLD_ATTR:#[0-9]+]]
|
||||
; CHECK-NOT: cold_entry_block.cold.1
|
||||
define void @cold_entry_block() {
|
||||
entry:
|
||||
call void @sink()
|
||||
ret void
|
||||
}
|
||||
|
||||
; Do not split `noinline` functions.
|
||||
; CHECK-LABEL: @noinline_func
|
||||
; CHECK-NOT: noinline_func.cold.1
|
||||
@ -182,6 +192,8 @@ if.end: ; preds = %entry
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: attributes [[COLD_ATTR]] = { {{.*}}cold
|
||||
|
||||
declare void @llvm.dbg.value(metadata, metadata, metadata)
|
||||
|
||||
declare void @sink() cold
|
||||
|
Loading…
Reference in New Issue
Block a user