diff options
Diffstat (limited to 'llvm/test/Transforms/PGOProfile/func_entry.ll')
| -rw-r--r-- | llvm/test/Transforms/PGOProfile/func_entry.ll | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/llvm/test/Transforms/PGOProfile/func_entry.ll b/llvm/test/Transforms/PGOProfile/func_entry.ll index 37fad27f2f2..fe1b44b0bd7 100644 --- a/llvm/test/Transforms/PGOProfile/func_entry.ll +++ b/llvm/test/Transforms/PGOProfile/func_entry.ll @@ -6,8 +6,9 @@ target triple = "x86_64-unknown-linux-gnu" @s = common dso_local local_unnamed_addr global i32 0, align 4 -define void @bar() { -; CHECK-LABEL: @bar +define void @cold() { +; CHECK-LABEL: @cold() +; CHECK-SAME: #[[COLD_ATTR:[0-1]+]] ; CHECK-SAME: !prof ![[FUNC_ENTRY_COUNT_ZERO:[0-9]+]] entry: @@ -15,8 +16,9 @@ entry: ret void } -define void @foo() { -; CHECK-LABEL: @foo +define void @hot() { +; CHECK-LABEL: @hot() +; CHECK-SAME: #[[HOT_ATTR:[0-1]+]] ; CHECK-SAME: !prof ![[FUNC_ENTRY_COUNT_NON_ZERO:[0-9]+]] entry: %0 = load i32, i32* @s, align 4 @@ -25,5 +27,18 @@ entry: ret void } -; CHECK-DAG: ![[FUNC_ENTRY_COUNT_ZERO]] = !{!"function_entry_count", i64 0} -; CHECK-DAG: ![[FUNC_ENTRY_COUNT_NON_ZERO]] = !{!"function_entry_count", i64 9999} +define void @med() { +; CHECK-LABEL: @med +; CHECK-NOT: # +; CHECK-SAME: !prof ![[FUNC_ENTRY_COUNT_MED:[0-9]+]] + +entry: + store i32 1, i32* @s, align 4 + ret void +} + +; CHECK-DAG: attributes #[[COLD_ATTR]] = { cold } +; CHECK-DAG: attributes #[[HOT_ATTR]] = { inlinehint } +; CHECK-DAG: ![[FUNC_ENTRY_COUNT_ZERO]] = !{!"function_entry_count", i64 10} +; CHECK-DAG: ![[FUNC_ENTRY_COUNT_NON_ZERO]] = !{!"function_entry_count", i64 9000} +; CHECK-DAG: ![[FUNC_ENTRY_COUNT_MED]] = !{!"function_entry_count", i64 50} |

