llvm.org GIT mirror llvm / 0646a82
[PGO] Context sensitive PGO (part 4) Part 4 of CSPGO changes: (1) add support in cmake for cspgo build. (2) fix an issue in big endian. (3) test cases. Differential Revision: https://reviews.llvm.org/D54175 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355541 91177308-0d34-0410-b5e6-96231b3b80d8 Rong Xu 5 months ago
21 changed file(s) with 1049 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
603603 endif()
604604 file(TO_NATIVE_PATH "${LLVM_PROFILE_DATA_DIR}/%${LLVM_PROFILE_MERGE_POOL_SIZE}m.profraw" LLVM_PROFILE_FILE_PATTERN)
605605 endif()
606 if(NOT LLVM_CSPROFILE_FILE_PATTERN)
607 if(NOT LLVM_CSPROFILE_DATA_DIR)
608 file(TO_NATIVE_PATH "${LLVM_BINARY_DIR}/csprofiles" LLVM_CSPROFILE_DATA_DIR)
609 endif()
610 file(TO_NATIVE_PATH "${LLVM_CSPROFILE_DATA_DIR}/%${LLVM_PROFILE_MERGE_POOL_SIZE}m.profraw" LLVM_CSPROFILE_FILE_PATTERN)
611 endif()
606612 endif()
607613
608614 if (LLVM_BUILD_STATIC)
808808 CMAKE_C_FLAGS
809809 CMAKE_EXE_LINKER_FLAGS
810810 CMAKE_SHARED_LINKER_FLAGS)
811 elseif(uppercase_LLVM_BUILD_INSTRUMENTED STREQUAL "CSIR")
812 append("-fcs-profile-generate='${LLVM_CSPROFILE_DATA_DIR}'"
813 CMAKE_CXX_FLAGS
814 CMAKE_C_FLAGS
815 CMAKE_EXE_LINKER_FLAGS
816 CMAKE_SHARED_LINKER_FLAGS)
811817 else()
812818 append("-fprofile-instr-generate='${LLVM_PROFILE_FILE_PATTERN}'"
813819 CMAKE_CXX_FLAGS
815821 CMAKE_EXE_LINKER_FLAGS
816822 CMAKE_SHARED_LINKER_FLAGS)
817823 endif()
824 endif()
825
826 # Need to pass -fprofile-instr-use to linker for context-sensitive PGO
827 # compilation.
828 if(LLVM_PROFDATA_FILE AND EXISTS ${LLVM_PROFDATA_FILE})
829 append("-fprofile-instr-use='${LLVM_PROFDATA_FILE}'"
830 CMAKE_EXE_LINKER_FLAGS
831 CMAKE_SHARED_LINKER_FLAGS)
818832 endif()
819833
820834 option(LLVM_BUILD_INSTRUMENTED_COVERAGE "Build LLVM and tools with Code Coverage instrumentation" Off)
812812
813813 Cur = readSummary((IndexedInstrProf::ProfVersion)FormatVersion, Cur,
814814 /* UseCS */ false);
815 if (Header->Version & VARIANT_MASK_CSIR_PROF)
815 if (FormatVersion & VARIANT_MASK_CSIR_PROF)
816816 Cur = readSummary((IndexedInstrProf::ProfVersion)FormatVersion, Cur,
817817 /* UseCS */ true);
818818
0 ; Test CSGen pass in CSPGO.
1 ; RUN: llvm-profdata merge %S/Inputs/cspgo-noncs.proftext -o %t-noncs.profdata
2 ; RUN: llvm-profdata merge %S/Inputs/cspgo-cs.proftext -o %t-cs.profdata
3 ; RUN: opt -O2 -debug-pass=Structure -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-noncs.profdata' -cspgo-kind=cspgo-instr-gen-pipeline -cs-profilegen-file=alloc %s 2>&1 |FileCheck %s --check-prefixes=CSGENDEFAULT
4 ; CSGENDEFAULT: PGOInstrumentationUse
5 ; CSGENDEFAULT: PGOInstrumentationGenCreateVar
6 ; CSGENDEFAULT: PGOInstrumentationGen
7
8 ; Test CSUse pass in CSPGO.
9 ; RUN: opt -O2 -debug-pass=Structure -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-cs.profdata' -cspgo-kind=cspgo-instr-use-pipeline %s 2>&1 |FileCheck %s --check-prefixes=CSUSEDEFAULT
10 ; CSUSEDEFAULT: PGOInstrumentationUse
11 ; CSUSEDEFAULT-NOT: PGOInstrumentationGenCreateVar
12 ; CSUSEDEFAULT: PGOInstrumentationUse
0 ; Test CSGen pass in CSPGO.
1 ; RUN: llvm-profdata merge %S/Inputs/cspgo-noncs.proftext -o %t-noncs.profdata
2 ; RUN: llvm-profdata merge %S/Inputs/cspgo-cs.proftext -o %t-cs.profdata
3 ; RUN: opt -debug-pass-manager -passes='default' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-noncs.profdata' -cspgo-kind=cspgo-instr-gen-pipeline -cs-profilegen-file=alloc %s 2>&1 |FileCheck %s --check-prefixes=CSGENDEFAULT
4 ; RUN: opt -debug-pass-manager -passes='thinlto-pre-link' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-noncs.profdata' -cspgo-kind=cspgo-instr-gen-pipeline -cs-profilegen-file=alloc %s 2>&1 |FileCheck %s --check-prefixes=CSGENPRELINK
5 ; RUN: opt -debug-pass-manager -passes='thinlto' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-noncs.profdata' -cspgo-kind=cspgo-instr-gen-pipeline -cs-profilegen-file=alloc %s 2>&1 |FileCheck %s --check-prefixes=CSGENLTO
6 ; RUN: opt -debug-pass-manager -passes='lto-pre-link' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-noncs.profdata' -cspgo-kind=cspgo-instr-gen-pipeline -cs-profilegen-file=alloc %s 2>&1 |FileCheck %s --check-prefixes=CSGENPRELINK
7 ; RUN: opt -debug-pass-manager -passes='lto' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-noncs.profdata' -cspgo-kind=cspgo-instr-gen-pipeline -cs-profilegen-file=alloc %s 2>&1 |FileCheck %s --check-prefixes=CSGENLTO
8 ; CSGENDEFAULT: Running pass: PGOInstrumentationUse
9 ; CSGENDEFAULT: Running pass: PGOInstrumentationGenCreateVar
10 ; CSGENDEFAULT: Running pass: PGOInstrumentationGen
11 ; CSGENPRELINK: Running pass: PGOInstrumentationUse
12 ; CSGENPRELINK: Running pass: PGOInstrumentationGenCreateVar
13 ; CSGENPRELINK-NOT: Running pass: PGOInstrumentationGen
14 ; CSGENLTO-NOT: Running pass: PGOInstrumentationUse
15 ; CSGENLTO-NOT: Running pass: PGOInstrumentationGenCreateVar
16 ; CSGENLTO: Running pass: PGOInstrumentationGen
17
18 ; Test CSUse pass in CSPGO.
19 ; RUN: opt -debug-pass-manager -passes='default' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-cs.profdata' -cspgo-kind=cspgo-instr-use-pipeline %s 2>&1 |FileCheck %s --check-prefixes=CSUSEDEFAULT
20 ; RUN: opt -debug-pass-manager -passes='thinlto-pre-link' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-cs.profdata' -cspgo-kind=cspgo-instr-use-pipeline %s 2>&1 |FileCheck %s --check-prefixes=CSUSEPRELINK
21 ; RUN: opt -debug-pass-manager -passes='thinlto' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-cs.profdata' -cspgo-kind=cspgo-instr-use-pipeline %s 2>&1 |FileCheck %s --check-prefixes=CSUSELTO
22 ; RUN: opt -debug-pass-manager -passes='lto-pre-link' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-noncs.profdata' -cspgo-kind=cspgo-instr-use-pipeline %s 2>&1 |FileCheck %s --check-prefixes=CSUSEPRELINK
23 ; RUN: opt -debug-pass-manager -passes='lto' -pgo-kind=pgo-instr-use-pipeline -profile-file='%t-cs.profdata' -cspgo-kind=cspgo-instr-use-pipeline %s 2>&1 |FileCheck %s --check-prefixes=CSUSELTO
24 ; CSUSEDEFAULT: Running pass: PGOInstrumentationUse
25 ; CSUSEDEFAULT-NOT: Running pass: PGOInstrumentationGenCreateVar
26 ; CSUSEDEFAULT: Running pass: PGOInstrumentationUse
27 ; CSUSEPRELINK: Running pass: PGOInstrumentationUse
28 ; CSUSEPRELINK-NOT: Running pass: PGOInstrumentationGenCreateVar
29 ; CSUSEPRELINK-NOT: Running pass: PGOInstrumentationUse
30 ; CSUSELTO: Running pass: PGOInstrumentationUse
31 ; CSUSELTO-NOT: Running pass: PGOInstrumentationUse
0 # CSIR level Instrumentation Flag
1 :csir
2 bar_m
3 # Func Hash:
4 29667547796
5 # Num Counters:
6 2
7 # Counter Values:
8 99949
9 51
10
11 bar_m
12 # Func Hash:
13 1224979111529676799
14 # Num Counters:
15 2
16 # Counter Values:
17 100000
18 99949
19
20 csfdo_plain.c:cond
21 # Func Hash:
22 1152921517491748863
23 # Num Counters:
24 1
25 # Counter Values:
26 200000
27
28 csfdo_plain.c:cond
29 # Func Hash:
30 12884901887
31 # Num Counters:
32 1
33 # Counter Values:
34 200000
35
36 bar_m2
37 # Func Hash:
38 1152921534274394772
39 # Num Counters:
40 2
41 # Counter Values:
42 99938
43 62
44
45 bar_m2
46 # Func Hash:
47 29667547796
48 # Num Counters:
49 2
50 # Counter Values:
51 99938
52 62
53
54 foo
55 # Func Hash:
56 1152921640672869708
57 # Num Counters:
58 10
59 # Counter Values:
60 100000
61 100000
62 0
63 66666
64 66666
65 0
66 100000
67 66667
68 100000
69 1
70
71 foo
72 # Func Hash:
73 29212902728
74 # Num Counters:
75 2
76 # Counter Values:
77 100000
78 1
79
80 bar
81 # Func Hash:
82 1152921569533132113
83 # Num Counters:
84 5
85 # Counter Values:
86 0
87 0
88 0
89 0
90 0
91
92 bar
93 # Func Hash:
94 56228292833
95 # Num Counters:
96 4
97 # Counter Values:
98 800000
99 399999
100 100000
101 100000
102
103 main
104 # Func Hash:
105 1152921517491748863
106 # Num Counters:
107 1
108 # Counter Values:
109 1
110
111 main
112 # Func Hash:
113 12884901887
114 # Num Counters:
115 1
116 # Counter Values:
117 1
118
119 csfdo_plain.c:barbar
120 # Func Hash:
121 1152921517491748863
122 # Num Counters:
123 1
124 # Counter Values:
125 100000
126
127 csfdo_plain.c:barbar
128 # Func Hash:
129 12884901887
130 # Num Counters:
131 1
132 # Counter Values:
133 100000
134
135 goo
136 # Func Hash:
137 1152921517491748863
138 # Num Counters:
139 1
140 # Counter Values:
141 100000
142
143 goo
144 # Func Hash:
145 12884901887
146 # Num Counters:
147 1
148 # Counter Values:
149 100000
150
0 # CSIR level Instrumentation Flag
1 :csir
2 cond.llvm.11253644763537639171
3 # Func Hash:
4 1152921517491748863
5 # Num Counters:
6 1
7 # Counter Values:
8 200000
9
10 foo
11 # Func Hash:
12 29212902728
13 # Num Counters:
14 2
15 # Counter Values:
16 100000
17 1
18
19 bar
20 # Func Hash:
21 1152921534274394772
22 # Num Counters:
23 2
24 # Counter Values:
25 0
26 0
27
28 bar
29 # Func Hash:
30 29667547796
31 # Num Counters:
32 2
33 # Counter Values:
34 100000
35 100000
36
37 main
38 # Func Hash:
39 1152921517491748863
40 # Num Counters:
41 1
42 # Counter Values:
43 1
44
45 main
46 # Func Hash:
47 12884901887
48 # Num Counters:
49 1
50 # Counter Values:
51 1
52
53 cspgo.c:foo
54 # Func Hash:
55 1152921563228422740
56 # Num Counters:
57 4
58 # Counter Values:
59 100000
60 100000
61 0
62 1
63
64 cspgo_bar.c:cond
65 # Func Hash:
66 12884901887
67 # Num Counters:
68 1
69 # Counter Values:
70 200000
71
0 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1 target triple = "x86_64-unknown-linux-gnu"
2
3 $__llvm_profile_filename = comdat any
4 $__llvm_profile_raw_version = comdat any
5
6 @odd = common dso_local global i32 0, align 4
7 @even = common dso_local global i32 0, align 4
8 @__llvm_profile_filename = constant [25 x i8] c"pass2/default_%m.profraw\00", comdat
9 @__llvm_profile_raw_version = constant i64 216172782113783812, comdat
10
11 define dso_local void @bar(i32 %n) !prof !29 {
12 entry:
13 %call = tail call fastcc i32 @cond(i32 %n)
14 %tobool = icmp eq i32 %call, 0
15 br i1 %tobool, label %if.else, label %if.then, !prof !30
16
17 if.then:
18 %0 = load i32, i32* @odd, align 4
19 %inc = add i32 %0, 1
20 store i32 %inc, i32* @odd, align 4
21 br label %if.end
22
23 if.else:
24 %1 = load i32, i32* @even, align 4
25 %inc1 = add i32 %1, 1
26 store i32 %inc1, i32* @even, align 4
27 br label %if.end
28
29 if.end:
30 ret void
31 }
32
33 define internal fastcc i32 @cond(i32 %i) #1 !prof !29 !PGOFuncName !35 {
34 entry:
35 %rem = srem i32 %i, 2
36 ret i32 %rem
37 }
38
39 attributes #1 = { inlinehint noinline }
40
41 !llvm.module.flags = !{!0, !1}
42
43 !0 = !{i32 1, !"wchar_size", i32 4}
44 !1 = !{i32 1, !"ProfileSummary", !2}
45 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
46 !3 = !{!"ProfileFormat", !"InstrProf"}
47 !4 = !{!"TotalCount", i64 500002}
48 !5 = !{!"MaxCount", i64 200000}
49 !6 = !{!"MaxInternalCount", i64 100000}
50 !7 = !{!"MaxFunctionCount", i64 200000}
51 !8 = !{!"NumCounts", i64 6}
52 !9 = !{!"NumFunctions", i64 4}
53 !10 = !{!"DetailedSummary", !11}
54 !11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
55 !12 = !{i32 10000, i64 200000, i32 1}
56 !13 = !{i32 100000, i64 200000, i32 1}
57 !14 = !{i32 200000, i64 200000, i32 1}
58 !15 = !{i32 300000, i64 200000, i32 1}
59 !16 = !{i32 400000, i64 200000, i32 1}
60 !17 = !{i32 500000, i64 100000, i32 4}
61 !18 = !{i32 600000, i64 100000, i32 4}
62 !19 = !{i32 700000, i64 100000, i32 4}
63 !20 = !{i32 800000, i64 100000, i32 4}
64 !21 = !{i32 900000, i64 100000, i32 4}
65 !22 = !{i32 950000, i64 100000, i32 4}
66 !23 = !{i32 990000, i64 100000, i32 4}
67 !24 = !{i32 999000, i64 100000, i32 4}
68 !25 = !{i32 999900, i64 100000, i32 4}
69 !26 = !{i32 999990, i64 100000, i32 4}
70 !27 = !{i32 999999, i64 1, i32 6}
71 !29 = !{!"function_entry_count", i64 200000}
72 !30 = !{!"branch_weights", i32 100000, i32 100000}
73 !35 = !{!"cspgo_bar.c:cond"}
0 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1 target triple = "x86_64-unknown-linux-gnu"
2
3 @odd = common dso_local global i32 0, align 4
4 @even = common dso_local global i32 0, align 4
5
6 define dso_local void @bar(i32 %n) #0 !prof !29 {
7 entry:
8 %call = tail call fastcc i32 @cond(i32 %n)
9 %tobool = icmp eq i32 %call, 0
10 br i1 %tobool, label %if.else, label %if.then, !prof !30
11
12 if.then:
13 %0 = load i32, i32* @odd, align 4
14 %inc = add i32 %0, 1
15 store i32 %inc, i32* @odd, align 4
16 br label %if.end
17
18 if.else:
19 %1 = load i32, i32* @even, align 4
20 %inc1 = add i32 %1, 1
21 store i32 %inc1, i32* @even, align 4
22 br label %if.end
23
24 if.end:
25 ret void
26 }
27
28 define internal fastcc i32 @cond(i32 %i) #1 !prof !29 !PGOFuncName !35 {
29 entry:
30 %rem = srem i32 %i, 2
31 ret i32 %rem
32 }
33
34 attributes #0 = { "target-cpu"="x86-64" }
35 attributes #1 = { inlinehint noinline }
36
37 !llvm.module.flags = !{!0, !1}
38
39 !0 = !{i32 1, !"wchar_size", i32 4}
40 !1 = !{i32 1, !"ProfileSummary", !2}
41 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
42 !3 = !{!"ProfileFormat", !"InstrProf"}
43 !4 = !{!"TotalCount", i64 500002}
44 !5 = !{!"MaxCount", i64 200000}
45 !6 = !{!"MaxInternalCount", i64 100000}
46 !7 = !{!"MaxFunctionCount", i64 200000}
47 !8 = !{!"NumCounts", i64 6}
48 !9 = !{!"NumFunctions", i64 4}
49 !10 = !{!"DetailedSummary", !11}
50 !11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
51 !12 = !{i32 10000, i64 200000, i32 1}
52 !13 = !{i32 100000, i64 200000, i32 1}
53 !14 = !{i32 200000, i64 200000, i32 1}
54 !15 = !{i32 300000, i64 200000, i32 1}
55 !16 = !{i32 400000, i64 200000, i32 1}
56 !17 = !{i32 500000, i64 100000, i32 4}
57 !18 = !{i32 600000, i64 100000, i32 4}
58 !19 = !{i32 700000, i64 100000, i32 4}
59 !20 = !{i32 800000, i64 100000, i32 4}
60 !21 = !{i32 900000, i64 100000, i32 4}
61 !22 = !{i32 950000, i64 100000, i32 4}
62 !23 = !{i32 990000, i64 100000, i32 4}
63 !24 = !{i32 999000, i64 100000, i32 4}
64 !25 = !{i32 999900, i64 100000, i32 4}
65 !26 = !{i32 999990, i64 100000, i32 4}
66 !27 = !{i32 999999, i64 1, i32 6}
67 !29 = !{!"function_entry_count", i64 200000}
68 !30 = !{!"branch_weights", i32 100000, i32 100000}
69 !35 = !{!"cspgo_bar.c:cond"}
0 ; Test the profile summary for context sensitive PGO (CSPGO)
1
2 ; RUN: llvm-profdata merge %S/Inputs/cspgo.proftext -o %t.profdata
3 ; RUN: opt < %s -O2 -disable-preinline -pgo-kind=pgo-instr-use-pipeline -profile-file=%t.profdata -S | FileCheck %s --check-prefix=PGOSUMMARY
4 ; RUN: opt < %s -O2 -disable-preinline -pgo-kind=pgo-instr-use-pipeline -profile-file=%t.profdata -S -cspgo-kind=cspgo-instr-use-pipeline| FileCheck %s --check-prefix=CSPGOSUMMARY
5
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-linux-gnu"
8
9 @odd = common dso_local global i32 0, align 4
10 @even = common dso_local global i32 0, align 4
11 @not_six = common dso_local global i32 0, align 4
12
13 define dso_local i32 @goo(i32 %n) {
14 entry:
15 %i = alloca i32, align 4
16 %i.0..sroa_cast = bitcast i32* %i to i8*
17 store volatile i32 %n, i32* %i, align 4
18 %i.0. = load volatile i32, i32* %i, align 4
19 ret i32 %i.0.
20 }
21
22 define dso_local void @bar(i32 %n) {
23 entry:
24 %call = call fastcc i32 @cond(i32 %n)
25 %tobool = icmp eq i32 %call, 0
26 br i1 %tobool, label %if.else, label %if.then
27
28 if.then:
29 %0 = load i32, i32* @odd, align 4
30 %inc = add i32 %0, 1
31 store i32 %inc, i32* @odd, align 4
32 br label %if.end
33
34 if.else:
35 %1 = load i32, i32* @even, align 4
36 %inc1 = add i32 %1, 1
37 store i32 %inc1, i32* @even, align 4
38 br label %if.end
39
40 if.end:
41 br label %for.cond
42
43 for.cond:
44 %i.0 = phi i32 [ 0, %if.end ], [ %inc6, %for.inc ]
45 %cmp = icmp ult i32 %i.0, 4
46 br i1 %cmp, label %for.body, label %for.end
47
48 for.body:
49 %mul = mul nsw i32 %i.0, %n
50 %rem = srem i32 %mul, 6
51 %tobool2 = icmp eq i32 %rem, 0
52 br i1 %tobool2, label %for.inc, label %if.then3
53
54 if.then3:
55 %2 = load i32, i32* @not_six, align 4
56 %inc4 = add i32 %2, 1
57 store i32 %inc4, i32* @not_six, align 4
58 br label %for.inc
59
60 for.inc:
61 %inc6 = add nuw nsw i32 %i.0, 1
62 br label %for.cond
63
64 for.end:
65 ret void
66 }
67 ; PGOSUMMARY-LABEL: @bar
68 ; PGOSUMMARY: %odd.sink = select i1 %tobool, i32* @even, i32* @odd
69 ; PGOSUMMARY-SAME: !prof ![[BW_PGO_BAR:[0-9]+]]
70 ; CSPGOSUMMARY-LABEL: @bar
71 ; CSPGOSUMMARY: %odd.sink = select i1 %tobool, i32* @even, i32* @odd
72 ; CSPGOSUMMARY-SAME: !prof ![[BW_CSPGO_BAR:[0-9]+]]
73
74 define internal fastcc i32 @cond(i32 %i) {
75 entry:
76 %rem = srem i32 %i, 2
77 ret i32 %rem
78 }
79
80 define dso_local void @foo() {
81 entry:
82 br label %for.cond
83
84 for.cond:
85 %i.0 = phi i32 [ 0, %entry ], [ %add4, %for.body ]
86 %cmp = icmp slt i32 %i.0, 200000
87 br i1 %cmp, label %for.body, label %for.end
88
89 for.body:
90 %call = call i32 @goo(i32 %i.0)
91 call void @bar(i32 %call)
92 %add = add nsw i32 %call, 1
93 call void @bar(i32 %add)
94 %call1 = call i32 @bar_m(i32 %call) #4
95 %call3 = call i32 @bar_m2(i32 %add) #4
96 call fastcc void @barbar()
97 %add4 = add nsw i32 %call, 2
98 br label %for.cond
99
100 for.end:
101 ret void
102 }
103 ; CSPGOSUMMARY-LABEL: @foo
104 ; CSPGOSUMMARY: %even.sink{{[0-9]*}} = select i1 %tobool.i{{[0-9]*}}, i32* @even, i32* @odd
105 ; CSPGOSUMMARY-SAME: !prof ![[BW1_CSPGO_FOO:[0-9]+]]
106 ; CSPGOSUMMARY: %even.sink{{[0-9]*}} = select i1 %tobool.i{{[0-9]*}}, i32* @even, i32* @odd
107 ; CSPGOSUMMARY-SAME: !prof ![[BW2_CSPGO_FOO:[0-9]+]]
108
109 declare dso_local i32 @bar_m(i32)
110 declare dso_local i32 @bar_m2(i32)
111
112 define internal fastcc void @barbar() {
113 entry:
114 %0 = load i32, i32* @odd, align 4
115 %inc = add i32 %0, 1
116 store i32 %inc, i32* @odd, align 4
117 ret void
118 }
119
120 define dso_local i32 @main() {
121 entry:
122 call void @foo()
123 ret i32 0
124 }
125
126 ; PGOSUMMARY: {{![0-9]+}} = !{i32 1, !"ProfileSummary", !{{[0-9]+}}}
127 ; PGOSUMMARY: {{![0-9]+}} = !{!"ProfileFormat", !"InstrProf"}
128 ; PGOSUMMARY: {{![0-9]+}} = !{!"TotalCount", i64 2100001}
129 ; PGOSUMMARY: {{![0-9]+}} = !{!"MaxCount", i64 800000}
130 ; PGOSUMMARY: {{![0-9]+}} = !{!"MaxInternalCount", i64 399999}
131 ; PGOSUMMARY: {{![0-9]+}} = !{!"MaxFunctionCount", i64 800000}
132 ; PGOSUMMARY: {{![0-9]+}} = !{!"NumCounts", i64 14}
133 ; PGOSUMMARY: {{![0-9]+}} = !{!"NumFunctions", i64 8}
134 ; PGOSUMMARY-DAG: ![[BW_PGO_BAR]] = !{!"branch_weights", i32 100000, i32 100000}
135
136 ; CSPGOSUMMARY: {{![0-9]+}} = !{i32 1, !"ProfileSummary", !1}
137 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"ProfileFormat", !"InstrProf"}
138 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"TotalCount", i64 2100001}
139 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"MaxCount", i64 800000}
140 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"MaxInternalCount", i64 399999}
141 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"MaxFunctionCount", i64 800000}
142 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"NumCounts", i64 14}
143 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"NumFunctions", i64 8}
144 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"DetailedSummary", !10}
145 ; CSPGOSUMMARY: {{![0-9]+}} = !{i32 1, !"CSProfileSummary", !{{[0-9]+}}}
146 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"ProfileFormat", !"CSInstrProf"}
147 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"TotalCount", i64 1299950}
148 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"MaxCount", i64 200000}
149 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"MaxInternalCount", i64 100000}
150 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"MaxFunctionCount", i64 200000}
151 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"NumCounts", i64 23}
152 ; CSPGOSUMMARY-DAG: ![[BW_CSPGO_BAR]] = !{!"branch_weights", i32 100000, i32 100000}
153 ; CSPGOSUMMARY-DAG: ![[BW1_CSPGO_FOO]] = !{!"branch_weights", i32 100000, i32 0}
154 ; CSPGOSUMMARY-DAG: ![[BW2_CSPGO_FOO]] = !{!"branch_weights", i32 0, i32 100000}
0 ; RUN: opt -module-summary %s -o %t1.bc
1 ; RUN: opt -module-summary %S/Inputs/thinlto_cspgo_bar_gen.ll -o %t2.bc
2 ; RUN: llvm-lto2 run -lto-cspgo-profile-file=alloc -lto-cspgo-gen -save-temps -o %t %t1.bc %t2.bc \
3 ; RUN: -r=%t1.bc,foo,pl \
4 ; RUN: -r=%t1.bc,bar,l \
5 ; RUN: -r=%t1.bc,main,plx \
6 ; RUN: -r=%t1.bc,__llvm_profile_filename,plx \
7 ; RUN: -r=%t1.bc,__llvm_profile_raw_version,plx \
8 ; RUN: -r=%t2.bc,bar,pl \
9 ; RUN: -r=%t2.bc,odd,pl \
10 ; RUN: -r=%t2.bc,even,pl \
11 ; RUN: -r=%t2.bc,__llvm_profile_filename,x \
12 ; RUN: -r=%t2.bc,__llvm_profile_raw_version,x
13 ; RUN: llvm-dis %t.1.4.opt.bc -o - | FileCheck %s --check-prefix=CSGEN
14
15 ; CSGEN: @__profc_
16 ; CSGEN: @__profd_
17
18 source_filename = "cspgo.c"
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
20 target triple = "x86_64-unknown-linux-gnu"
21
22 $__llvm_profile_filename = comdat any
23 $__llvm_profile_raw_version = comdat any
24 @__llvm_profile_filename = constant [25 x i8] c"pass2/default_%m.profraw\00", comdat
25 @__llvm_profile_raw_version = constant i64 216172782113783812, comdat
26
27 define dso_local void @foo() #0 !prof !29 {
28 entry:
29 br label %for.body
30
31 for.body:
32 %i.06 = phi i32 [ 0, %entry ], [ %add1, %for.body ]
33 tail call void @bar(i32 %i.06)
34 %add = or i32 %i.06, 1
35 tail call void @bar(i32 %add)
36 %add1 = add nuw nsw i32 %i.06, 2
37 %cmp = icmp ult i32 %add1, 200000
38 br i1 %cmp, label %for.body, label %for.end, !prof !30
39
40 for.end:
41 ret void
42 }
43
44 declare dso_local void @bar(i32)
45
46 define dso_local i32 @main() !prof !29 {
47 entry:
48 tail call void @foo()
49 ret i32 0
50 }
51
52 attributes #0 = { "target-cpu"="x86-64" }
53
54 !llvm.module.flags = !{!0, !1}
55
56 !0 = !{i32 1, !"wchar_size", i32 4}
57 !1 = !{i32 1, !"ProfileSummary", !2}
58 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
59 !3 = !{!"ProfileFormat", !"InstrProf"}
60 !4 = !{!"TotalCount", i64 500002}
61 !5 = !{!"MaxCount", i64 200000}
62 !6 = !{!"MaxInternalCount", i64 100000}
63 !7 = !{!"MaxFunctionCount", i64 200000}
64 !8 = !{!"NumCounts", i64 6}
65 !9 = !{!"NumFunctions", i64 4}
66 !10 = !{!"DetailedSummary", !11}
67 !11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
68 !12 = !{i32 10000, i64 200000, i32 1}
69 !13 = !{i32 100000, i64 200000, i32 1}
70 !14 = !{i32 200000, i64 200000, i32 1}
71 !15 = !{i32 300000, i64 200000, i32 1}
72 !16 = !{i32 400000, i64 200000, i32 1}
73 !17 = !{i32 500000, i64 100000, i32 4}
74 !18 = !{i32 600000, i64 100000, i32 4}
75 !19 = !{i32 700000, i64 100000, i32 4}
76 !20 = !{i32 800000, i64 100000, i32 4}
77 !21 = !{i32 900000, i64 100000, i32 4}
78 !22 = !{i32 950000, i64 100000, i32 4}
79 !23 = !{i32 990000, i64 100000, i32 4}
80 !24 = !{i32 999000, i64 100000, i32 4}
81 !25 = !{i32 999900, i64 100000, i32 4}
82 !26 = !{i32 999990, i64 100000, i32 4}
83 !27 = !{i32 999999, i64 1, i32 6}
84 !29 = !{!"function_entry_count", i64 1}
85 !30 = !{!"branch_weights", i32 100000, i32 1}
0 ; RUN: opt -module-summary %s -o %t1.bc
1 ; RUN: opt -module-summary %S/Inputs/thinlto_cspgo_bar_use.ll -o %t2.bc
2 ; RUN: llvm-profdata merge %S/Inputs/thinlto_cs.proftext -o %t3.profdata
3 ; RUN: llvm-lto2 run -lto-cspgo-profile-file=%t3.profdata -save-temps -o %t %t1.bc %t2.bc \
4 ; RUN: -r=%t1.bc,foo,pl \
5 ; RUN: -r=%t1.bc,bar,l \
6 ; RUN: -r=%t1.bc,main,plx \
7 ; RUN: -r=%t2.bc,bar,pl \
8 ; RUN: -r=%t2.bc,odd,pl \
9 ; RUN: -r=%t2.bc,even,pl
10 ; RUN: llvm-dis %t.1.4.opt.bc -o - | FileCheck %s --check-prefix=CSUSE
11
12 ; CSUSE: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}}
13 ; CSUSE: {{![0-9]+}} = !{i32 1, !"CSProfileSummary", {{![0-9]+}}}
14 ; CSUSE-DAG: {{![0-9]+}} = !{!"branch_weights", i32 100000, i32 0}
15 ; CSUSE-DAG: {{![0-9]+}} = !{!"branch_weights", i32 0, i32 100000}
16
17 source_filename = "cspgo.c"
18 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19 target triple = "x86_64-unknown-linux-gnu"
20
21 define dso_local void @foo() #0 !prof !29 {
22 entry:
23 br label %for.body
24
25 for.body:
26 %i.06 = phi i32 [ 0, %entry ], [ %add1, %for.body ]
27 tail call void @bar(i32 %i.06)
28 %add = or i32 %i.06, 1
29 tail call void @bar(i32 %add)
30 %add1 = add nuw nsw i32 %i.06, 2
31 %cmp = icmp ult i32 %add1, 200000
32 br i1 %cmp, label %for.body, label %for.end, !prof !30
33
34 for.end:
35 ret void
36 }
37
38 declare dso_local void @bar(i32)
39
40 define dso_local i32 @main() !prof !29 {
41 entry:
42 tail call void @foo()
43 ret i32 0
44 }
45
46 attributes #0 = { "target-cpu"="x86-64" }
47
48 !llvm.module.flags = !{!0, !1}
49
50 !0 = !{i32 1, !"wchar_size", i32 4}
51 !1 = !{i32 1, !"ProfileSummary", !2}
52 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
53 !3 = !{!"ProfileFormat", !"InstrProf"}
54 !4 = !{!"TotalCount", i64 500002}
55 !5 = !{!"MaxCount", i64 200000}
56 !6 = !{!"MaxInternalCount", i64 100000}
57 !7 = !{!"MaxFunctionCount", i64 200000}
58 !8 = !{!"NumCounts", i64 6}
59 !9 = !{!"NumFunctions", i64 4}
60 !10 = !{!"DetailedSummary", !11}
61 !11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
62 !12 = !{i32 10000, i64 200000, i32 1}
63 !13 = !{i32 100000, i64 200000, i32 1}
64 !14 = !{i32 200000, i64 200000, i32 1}
65 !15 = !{i32 300000, i64 200000, i32 1}
66 !16 = !{i32 400000, i64 200000, i32 1}
67 !17 = !{i32 500000, i64 100000, i32 4}
68 !18 = !{i32 600000, i64 100000, i32 4}
69 !19 = !{i32 700000, i64 100000, i32 4}
70 !20 = !{i32 800000, i64 100000, i32 4}
71 !21 = !{i32 900000, i64 100000, i32 4}
72 !22 = !{i32 950000, i64 100000, i32 4}
73 !23 = !{i32 990000, i64 100000, i32 4}
74 !24 = !{i32 999000, i64 100000, i32 4}
75 !25 = !{i32 999900, i64 100000, i32 4}
76 !26 = !{i32 999990, i64 100000, i32 4}
77 !27 = !{i32 999999, i64 1, i32 6}
78 !29 = !{!"function_entry_count", i64 1}
79 !30 = !{!"branch_weights", i32 100000, i32 1}
0 # CSIR level Instrumentation Flag
1 :csir
2 csfdo_bar.c:cond
3 # Func Hash:
4 1152921517491748863
5 # Num Counters:
6 1
7 # Counter Values:
8 200000
9
10 main
11 # Func Hash:
12 1152921517491748863
13 # Num Counters:
14 1
15 # Counter Values:
16 1
17
18 bar
19 # Func Hash:
20 1152921569533132113
21 # Num Counters:
22 5
23 # Counter Values:
24 100000
25 100000
26 166666
27 133333
28 100000
29
30 csfdo.c:foo
31 # Func Hash:
32 1152921527029665692
33 # Num Counters:
34 2
35 # Counter Values:
36 99999
37 1
38
0 source_filename = "csfdo_bar.c"
1 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
2 target triple = "x86_64-unknown-linux-gnu"
3
4 @odd = common dso_local local_unnamed_addr global i32 0, align 4
5 @even = common dso_local local_unnamed_addr global i32 0, align 4
6 @not_six = common dso_local local_unnamed_addr global i32 0, align 4
7
8 define void @bar(i32 %n) !prof !29 {
9 entry:
10 %call = tail call fastcc i32 @cond(i32 %n)
11 %tobool = icmp eq i32 %call, 0
12 br i1 %tobool, label %if.else, label %if.then, !prof !30
13
14 if.then:
15 %0 = load i32, i32* @odd, align 4
16 %inc = add i32 %0, 1
17 store i32 %inc, i32* @odd, align 4
18 br label %for.inc
19
20 if.else:
21 %1 = load i32, i32* @even, align 4
22 %inc1 = add i32 %1, 1
23 store i32 %inc1, i32* @even, align 4
24 br label %for.inc
25
26 for.inc:
27 %rem.1 = srem i32 %n, 6
28 %tobool2.1 = icmp eq i32 %rem.1, 0
29 br i1 %tobool2.1, label %for.inc.1, label %if.then3.1, !prof !35
30
31 if.then3.1:
32 %2 = load i32, i32* @not_six, align 4
33 %inc4.1 = add i32 %2, 1
34 store i32 %inc4.1, i32* @not_six, align 4
35 br label %for.inc.1
36
37 for.inc.1:
38 %mul.2 = shl nsw i32 %n, 1
39 %rem.2 = srem i32 %mul.2, 6
40 %tobool2.2 = icmp eq i32 %rem.2, 0
41 br i1 %tobool2.2, label %for.inc.2, label %if.then3.2, !prof !35
42
43 if.then3.2:
44 %3 = load i32, i32* @not_six, align 4
45 %inc4.2 = add i32 %3, 1
46 store i32 %inc4.2, i32* @not_six, align 4
47 br label %for.inc.2
48
49 for.inc.2:
50 %mul.3 = mul nsw i32 %n, 3
51 %rem.3 = srem i32 %mul.3, 6
52 %tobool2.3 = icmp eq i32 %rem.3, 0
53 br i1 %tobool2.3, label %for.inc.3, label %if.then3.3, !prof !35
54
55 if.then3.3:
56 %4 = load i32, i32* @not_six, align 4
57 %inc4.3 = add i32 %4, 1
58 store i32 %inc4.3, i32* @not_six, align 4
59 br label %for.inc.3
60
61 for.inc.3:
62 ret void
63 }
64
65 define internal fastcc i32 @cond(i32 %i) #1 !prof !29 !PGOFuncName !36 {
66 entry:
67 %rem = srem i32 %i, 2
68 ret i32 %rem
69 }
70
71 attributes #1 = { inlinehint noinline }
72
73 !llvm.module.flags = !{!0, !1}
74
75 !0 = !{i32 1, !"wchar_size", i32 4}
76 !1 = !{i32 1, !"ProfileSummary", !2}
77 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
78 !3 = !{!"ProfileFormat", !"InstrProf"}
79 !4 = !{!"TotalCount", i64 1700001}
80 !5 = !{!"MaxCount", i64 800000}
81 !6 = !{!"MaxInternalCount", i64 399999}
82 !7 = !{!"MaxFunctionCount", i64 800000}
83 !8 = !{!"NumCounts", i64 8}
84 !9 = !{!"NumFunctions", i64 4}
85 !10 = !{!"DetailedSummary", !11}
86 !11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
87 !12 = !{i32 10000, i64 800000, i32 1}
88 !13 = !{i32 100000, i64 800000, i32 1}
89 !14 = !{i32 200000, i64 800000, i32 1}
90 !15 = !{i32 300000, i64 800000, i32 1}
91 !16 = !{i32 400000, i64 800000, i32 1}
92 !17 = !{i32 500000, i64 399999, i32 2}
93 !18 = !{i32 600000, i64 399999, i32 2}
94 !19 = !{i32 700000, i64 399999, i32 2}
95 !20 = !{i32 800000, i64 200000, i32 3}
96 !21 = !{i32 900000, i64 100000, i32 6}
97 !22 = !{i32 950000, i64 100000, i32 6}
98 !23 = !{i32 990000, i64 100000, i32 6}
99 !24 = !{i32 999000, i64 100000, i32 6}
100 !25 = !{i32 999900, i64 100000, i32 6}
101 !26 = !{i32 999990, i64 100000, i32 6}
102 !27 = !{i32 999999, i64 100000, i32 6}
103 !29 = !{!"function_entry_count", i64 200000}
104 !30 = !{!"branch_weights", i32 100000, i32 100000}
105 !31 = !{!32, !32, i64 0}
106 !32 = !{!"int", !33, i64 0}
107 !33 = !{!"omnipotent char", !34, i64 0}
108 !34 = !{!"Simple C/C++ TBAA"}
109 !35 = !{!"branch_weights", i32 400001, i32 399999}
110 !36 = !{!"csfdo_bar.c:cond"}
0 ; Generate summary sections
1 ; RUN: opt -module-summary %s -o %t1.o
2 ; RUN: opt -module-summary %p/Inputs/thinlto_cspgo_bar.ll -o %t2.o
3 ; RUN: llvm-profdata merge -o %t.profdata %p/Inputs/cspgo.proftext
4
5 ; RUN: rm -f %t1.o.4.opt.bc
6 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
7 ; RUN: -m elf_x86_64 \
8 ; RUN: --plugin-opt=thinlto \
9 ; RUN: --plugin-opt=save-temps \
10 ; RUN: --plugin-opt=cs-profile-path=%t.profdata \
11 ; RUN: --plugin-opt=jobs=1 \
12 ; RUN: %t1.o %t2.o -o %t3
13 ; RUN: opt -S %t2.o.4.opt.bc | FileCheck %s
14
15 source_filename = "cspgo.c"
16 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
17 target triple = "x86_64-unknown-linux-gnu"
18
19 ; CHECK: CSProfileSummary
20
21 define dso_local void @foo() #0 !prof !29 {
22 entry:
23 br label %for.body
24
25 for.body:
26 %i.06 = phi i32 [ 0, %entry ], [ %add1, %for.body ]
27 tail call void @bar(i32 %i.06)
28 %add = or i32 %i.06, 1
29 tail call void @bar(i32 %add)
30 %add1 = add nuw nsw i32 %i.06, 2
31 %cmp = icmp ult i32 %add1, 200000
32 br i1 %cmp, label %for.body, label %for.end, !prof !30
33
34 for.end:
35 ret void
36 }
37
38 declare dso_local void @bar(i32)
39
40 define i32 @main() !prof !29 {
41 entry:
42 tail call void @foo()
43 ret i32 0
44 }
45
46 attributes #0 = { "target-cpu"="x86-64" }
47
48 !llvm.module.flags = !{!0, !1}
49
50 !0 = !{i32 1, !"wchar_size", i32 4}
51 !1 = !{i32 1, !"ProfileSummary", !2}
52 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
53 !3 = !{!"ProfileFormat", !"InstrProf"}
54 !4 = !{!"TotalCount", i64 1700001}
55 !5 = !{!"MaxCount", i64 800000}
56 !6 = !{!"MaxInternalCount", i64 399999}
57 !7 = !{!"MaxFunctionCount", i64 800000}
58 !8 = !{!"NumCounts", i64 8}
59 !9 = !{!"NumFunctions", i64 4}
60 !10 = !{!"DetailedSummary", !11}
61 !11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
62 !12 = !{i32 10000, i64 800000, i32 1}
63 !13 = !{i32 100000, i64 800000, i32 1}
64 !14 = !{i32 200000, i64 800000, i32 1}
65 !15 = !{i32 300000, i64 800000, i32 1}
66 !16 = !{i32 400000, i64 800000, i32 1}
67 !17 = !{i32 500000, i64 399999, i32 2}
68 !18 = !{i32 600000, i64 399999, i32 2}
69 !19 = !{i32 700000, i64 399999, i32 2}
70 !20 = !{i32 800000, i64 200000, i32 3}
71 !21 = !{i32 900000, i64 100000, i32 6}
72 !22 = !{i32 950000, i64 100000, i32 6}
73 !23 = !{i32 990000, i64 100000, i32 6}
74 !24 = !{i32 999000, i64 100000, i32 6}
75 !25 = !{i32 999900, i64 100000, i32 6}
76 !26 = !{i32 999990, i64 100000, i32 6}
77 !27 = !{i32 999999, i64 100000, i32 6}
78 !29 = !{!"function_entry_count", i64 1}
79 !30 = !{!"branch_weights", i32 100000, i32 1}
0 # CSIR level Instrumentation Flag
1 :csir
2 bar
3 # Func Hash:
4 1152921534274394772
5 # Num Counters:
6 2
7 # Counter Values:
8 99938
9 62
10
0 # CSIR level Instrumentation Flag
1 :csir
2 bar
3 # Func Hash:
4 1152921534274394772
5 # Num Counters:
6 2
7 # Counter Values:
8 99938
9 62
0 # IR level Instrumentation Flag
1 :ir
2 bar
3 # Func Hash:
4 29667547796
5 # Num Counters:
6 2
7 # Counter Values:
8 99938
9 62
10
0 Basic test for option -showcs:
1 RUN: llvm-profdata show %p/Inputs/cs.proftext | FileCheck %s -check-prefix=ZEROSUMMARY
2 RUN: llvm-profdata show %p/Inputs/noncs.proftext | FileCheck %s -check-prefix=SUMMARY
3 RUN: llvm-profdata show -showcs %p/Inputs/cs.proftext | FileCheck %s -check-prefix=SUMMARY
4 RUN: llvm-profdata show -showcs %p/Inputs/noncs.proftext | FileCheck %s -check-prefix=ZEROSUMMARY
5 ZEROSUMMARY: Instrumentation level: IR
6 ZEROSUMMARY: Total functions: 0
7 ZEROSUMMARY: Maximum function count: 0
8 ZEROSUMMARY: Maximum internal block count: 0
9 SUMMARY: Instrumentation level: IR
10 SUMMARY: Total functions: 1
11 SUMMARY: Maximum function count: 99938
12 SUMMARY: Maximum internal block count: 62
13
14 Basic tests for context sensitive profile dump functions:
15 RUN: llvm-profdata merge -o %t-combined.profdata %p/Inputs/cs.proftext %p/Inputs/noncs.proftext
16
17 RUN: llvm-profdata show --all-functions -counts -showcs %p/Inputs/cs.proftext > %t-text.csdump
18 RUN: llvm-profdata show --all-functions -counts -showcs %t-combined.profdata > %t-index.csdump
19 RUN: diff %t-text.csdump %t-index.csdump
20
21 RUN: llvm-profdata show --all-functions -counts %p/Inputs/noncs.proftext > %t-text.noncsdump
22 RUN: llvm-profdata show --all-functions -counts %t-combined.profdata > %t-index.noncsdump
23 RUN: diff %t-text.noncsdump %t-index.noncsdump
24
25 Roundtrip test:
26
27 RUN: llvm-profdata merge -o %t.0.profdata %S/Inputs/CSIR_profile.proftext
28 RUN: llvm-profdata merge -text -o %t.0.proftext %t.0.profdata
29 RUN: diff %t.0.proftext %S/Inputs/CSIR_profile.proftext
30