|
1 | 1 | ; REQUIRES: x86_64-linux
|
2 | 2 | ; REQUIRES: asserts
|
3 |
| -; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/pseudo-probe-callee-profile-mismatch.prof --salvage-stale-profile -S --debug-only=sample-profile,sample-profile-matcher,sample-profile-impl -pass-remarks=inline 2>&1 | FileCheck %s |
| 3 | +; RUN: opt < %s -passes='thinlto<O2>' -pgo-kind=pgo-sample-use-pipeline -sample-profile-file=%S/Inputs/pseudo-probe-callee-profile-mismatch.prof --salvage-stale-profile -S --debug-only=sample-profile,sample-profile-matcher,sample-profile-impl -pass-remarks=inline 2>&1 | FileCheck %s |
4 | 4 |
|
| 5 | +; There is no profile-checksum-mismatch attr, even the checksum is mismatched in the pseudo_probe_desc, it doesn't run the matching. |
| 6 | +; CHECK-NOT: Run stale profile matching for main |
5 | 7 |
|
6 | 8 | ; CHECK: Run stale profile matching for bar
|
7 | 9 | ; CHECK: Callsite with callee:baz is matched from 4 to 2
|
|
14 | 16 | target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
15 | 17 | target triple = "x86_64-unknown-linux-gnu"
|
16 | 18 |
|
17 |
| -define i32 @main() #0 { |
| 19 | +define available_externally i32 @main() #0 { |
18 | 20 | %1 = call i32 @bar(), !dbg !13
|
19 | 21 | ret i32 0
|
20 | 22 | }
|
@@ -47,7 +49,8 @@ attributes #1 = { "profile-checksum-mismatch" "use-sample-profile" }
|
47 | 49 | !9 = distinct !DICompileUnit(language: DW_LANG_C11, file: !10, producer: "clang version 19.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
|
48 | 50 | !10 = !DIFile(filename: "test2.c", directory: "/home/test", checksumkind: CSK_MD5, checksum: "553093afc026f9c73562eb3b0c5b7532")
|
49 | 51 | !11 = !{i32 2, !"Debug Info Version", i32 3}
|
50 |
| -!12 = !{i64 -2624081020897602054, i64 281582081721716, !"main"} |
| 52 | +; Make a checksum mismatch in the pseudo_probe_desc |
| 53 | +!12 = !{i64 -2624081020897602054, i64 123456, !"main"} |
51 | 54 | !13 = !DILocation(line: 8, column: 10, scope: !14)
|
52 | 55 | !14 = !DILexicalBlockFile(scope: !15, file: !1, discriminator: 186646591)
|
53 | 56 | !15 = distinct !DILexicalBlock(scope: !16, file: !1, line: 7, column: 40)
|
|
0 commit comments