brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 65fa328 Raw
70 lines · plain
1; REQUIRES: x86_64-linux2;3; Check that we don't prune the contextual profile, unless the module name4; matches the guid of the root.5;6; RUN: rm -rf %t7; RUN: split-file %s %t8; RUN: llvm-ctxprof-util fromYAML --input=%t/profile.yaml --output=%t/profile.ctxprofdata9;10; RUN: cp %t/example.ll %t/1234.ll11; RUN: cp %t/example.ll %t/0x4d2.ll12;13; RUN: opt -passes='require<ctx-prof-analysis>,print<ctx-prof-analysis>' \14; RUN:   -use-ctx-profile=%t/profile.ctxprofdata \15; RUN:   -ctx-profile-printer-level=everything \16; RUN:   %t/example.ll -S 2>&1 | FileCheck %s17 18; RUN: opt -passes='require<ctx-prof-analysis>,print<ctx-prof-analysis>' \19; RUN:   -use-ctx-profile=%t/profile.ctxprofdata \20; RUN:   -ctx-profile-printer-level=everything \21; RUN:   %t/not-matching.ll -S 2>&1 | FileCheck %s22 23; RUN: opt -passes='require<ctx-prof-analysis>,print<ctx-prof-analysis>' \24; RUN:   -use-ctx-profile=%t/profile.ctxprofdata \25; RUN:   -ctx-profile-printer-level=everything \26; RUN:   %t/0x4d2.ll -S 2>&1 | FileCheck %s --check-prefix=PRUNED27 28; CHECK:    Contexts:29; CHECK:      - Guid:            123430; CHECK:      - Guid:            567831; CHECK:    FlatProfiles:32; PRUNED-NOT: - Guid:            567833; PRUNED-NOT: FlatProfiles34;35; pick a large GUID that would be negative, if signed, to test a few ways the36; file name may be formatted.37;--- profile.yaml38Contexts:39  - Guid: 123440    TotalRootEntryCount: 2441    Counters: [9]42    Callsites:  -43                  - Guid: 100044                    Counters: [6, 7]45 46  - Guid: 567847    TotalRootEntryCount: 2448    Counters: [9]49    Callsites:  -50                  - Guid: 100051                    Counters: [6, 7]52FlatProfiles:53  - Guid: 77754    Counters: [2]                    55;--- example.ll56define void @an_entrypoint(i32 %a) !guid !0 {57  ret void58}59 60attributes #0 = { noinline }61!0 = !{ i64  1234 }62 63;--- not-matching.ll64define void @an_entrypoint(i32 %a) !guid !0 {65  ret void66}67 68attributes #0 = { noinline }69!0 = !{ i64  1000 }70