summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-01-19 02:38:47 +0000
committerVedant Kumar <vsk@apple.com>2019-01-19 02:38:47 +0000
commitb755a2df5123a2b970733c43c9e65326b73d99c7 (patch)
treed282623aaf63c92817a9696a7cfb2d7391e15b4b /llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
parent4de1962bb9110ab48b0cd95a5d1db17a4653a700 (diff)
downloadbcm5719-llvm-b755a2df5123a2b970733c43c9e65326b73d99c7.tar.gz
bcm5719-llvm-b755a2df5123a2b970733c43c9e65326b73d99c7.zip
[HotColdSplit] Mark inherently cold functions as such
If an inherently cold function is found, mark it as cold. For now this means applying the `cold` and `minsize` attributes. As a drive-by, revisit and clean up the criteria for considering a function for splitting. Add tests. llvm-svn: 351623
Diffstat (limited to 'llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll')
-rw-r--r--llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll b/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
index 8622f03b2ed..448e63ab1de 100644
--- a/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
+++ b/llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
@@ -43,6 +43,37 @@ entry:
br i1 undef, label %if.then, label %if.end
if.then: ; preds = %entry
+ call void @sink()
+ br label %if.end
+
+if.end: ; preds = %entry
+ ret void
+}
+
+; Do not split `noinline` functions.
+; CHECK-LABEL: @noinline_func
+; CHECK-NOT: noinline_func.cold.1
+define void @noinline_func() noinline {
+entry:
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ call void @sink()
+ br label %if.end
+
+if.end: ; preds = %entry
+ ret void
+}
+
+; Do not split `alwaysinline` functions.
+; CHECK-LABEL: @alwaysinline_func
+; CHECK-NOT: alwaysinline_func.cold.1
+define void @alwaysinline_func() alwaysinline {
+entry:
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ call void @sink()
br label %if.end
if.end: ; preds = %entry
OpenPOWER on IntegriCloud