diff options
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext | 16 | ||||
| -rw-r--r-- | llvm/test/Transforms/PGOProfile/func_entry.ll | 27 |
2 files changed, 33 insertions, 10 deletions
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext index 2dc2c2ec9f3..230f44ba443 100644 --- a/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext @@ -1,17 +1,25 @@ # IR level Instrumentation Flag :ir -foo +hot # Func Hash: 12884901887 # Num Counters: 1 # Counter Values: -9999 +9000 -bar +cold # Func Hash: 12884901887 # Num Counters: 1 # Counter Values: -0 +10 + +med +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +50 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} |

