1 ; Test case for capping the cloning in CHR.
2 ; RUN: opt < %s -passes='require<profile-summary>,function(chr)' -chr-dup-threshold=2 -S | FileCheck %s
4 ; c sources for the test case.
5 ; extern void foo(int);
6 ; __attribute__((noinline)) void goo(int r, int s, int t) {
45 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
46 target triple = "x86_64-unknown-linux-gnu"
48 define dso_local void @goo(i32 noundef %r, i32 noundef %s, i32 noundef %t) !prof !34 {
51 %cmp.not = icmp eq i32 %and, 0
52 br i1 %cmp.not, label %if.end24, label %if.then, !prof !35
56 %cmp2.not = icmp eq i32 %and1, 0
57 br i1 %cmp2.not, label %if.end11, label %if.then3, !prof !35
61 %cmp5.not = icmp eq i32 %and4, 0
62 br i1 %cmp5.not, label %if.end, label %if.then6, !prof !35
65 tail call void @foo(i32 noundef 111)
70 %cmp8.not = icmp eq i32 %and7, 0
71 br i1 %cmp8.not, label %if.end11, label %if.then9, !prof !35
74 tail call void @foo(i32 noundef 112)
78 %and12 = and i32 %s, 4
79 %cmp13.not = icmp eq i32 %and12, 0
80 br i1 %cmp13.not, label %if.end24, label %if.then14, !prof !35
83 %and15 = and i32 %t, 2
84 %cmp16.not = icmp eq i32 %and15, 0
85 br i1 %cmp16.not, label %if.end18, label %if.then17, !prof !35
88 tail call void @foo(i32 noundef 121)
92 %and19 = and i32 %t, 4
93 %cmp20.not = icmp eq i32 %and19, 0
94 br i1 %cmp20.not, label %if.end24, label %if.then21, !prof !35
97 tail call void @foo(i32 noundef 122)
101 %and25 = and i32 %r, 4
102 %cmp26.not = icmp eq i32 %and25, 0
103 br i1 %cmp26.not, label %if.end52, label %if.then27, !prof !35
106 %and28 = and i32 %s, 2
107 %cmp29.not = icmp eq i32 %and28, 0
108 br i1 %cmp29.not, label %if.end39, label %if.then30, !prof !35
111 %and31 = and i32 %t, 2
112 %cmp32.not = icmp eq i32 %and31, 0
113 br i1 %cmp32.not, label %if.end34, label %if.then33, !prof !35
116 tail call void @foo(i32 noundef 211)
120 %and35 = and i32 %t, 4
121 %cmp36.not = icmp eq i32 %and35, 0
122 br i1 %cmp36.not, label %if.end39, label %if.then37, !prof !35
125 tail call void @foo(i32 noundef 212)
129 %and40 = and i32 %s, 4
130 %cmp41.not = icmp eq i32 %and40, 0
131 br i1 %cmp41.not, label %if.end52, label %if.then42, !prof !35
134 %and43 = and i32 %t, 2
135 %cmp44.not = icmp eq i32 %and43, 0
136 br i1 %cmp44.not, label %if.end46, label %if.then45, !prof !35
139 tail call void @foo(i32 noundef 221)
143 %and47 = and i32 %t, 4
144 %cmp48.not = icmp eq i32 %and47, 0
145 br i1 %cmp48.not, label %if.end52, label %if.then49, !prof !35
148 tail call void @foo(i32 noundef 222)
156 ; CHECK-COUNT-3: {{.*}}.split:
157 ; CHECK-NOT: {{.*}}.split:
159 declare void @foo(i32 noundef)
161 !llvm.module.flags = !{!4}
163 !4 = !{i32 1, !"ProfileSummary", !5}
164 !5 = !{!6, !7, !8, !9, !10, !11, !12, !13, !14, !15}
165 !6 = !{!"ProfileFormat", !"InstrProf"}
166 !7 = !{!"TotalCount", i64 2400001}
167 !8 = !{!"MaxCount", i64 800000}
168 !9 = !{!"MaxInternalCount", i64 100000}
169 !10 = !{!"MaxFunctionCount", i64 800000}
170 !11 = !{!"NumCounts", i64 19}
171 !12 = !{!"NumFunctions", i64 4}
172 !13 = !{!"IsPartialProfile", i64 0}
173 !14 = !{!"PartialProfileRatio", double 0.000000e+00}
174 !15 = !{!"DetailedSummary", !16}
175 !16 = !{!17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32}
176 !17 = !{i32 10000, i64 800000, i32 1}
177 !18 = !{i32 100000, i64 800000, i32 1}
178 !19 = !{i32 200000, i64 800000, i32 1}
179 !20 = !{i32 300000, i64 800000, i32 1}
180 !21 = !{i32 400000, i64 100000, i32 17}
181 !22 = !{i32 500000, i64 100000, i32 17}
182 !23 = !{i32 600000, i64 100000, i32 17}
183 !24 = !{i32 700000, i64 100000, i32 17}
184 !25 = !{i32 800000, i64 100000, i32 17}
185 !26 = !{i32 900000, i64 100000, i32 17}
186 !27 = !{i32 950000, i64 100000, i32 17}
187 !28 = !{i32 990000, i64 100000, i32 17}
188 !29 = !{i32 999000, i64 100000, i32 17}
189 !30 = !{i32 999900, i64 100000, i32 17}
190 !31 = !{i32 999990, i64 100000, i32 17}
191 !32 = !{i32 999999, i64 100000, i32 17}
192 !34 = !{!"function_entry_count", i64 100000}
193 !35 = !{!"branch_weights", i32 0, i32 100000}
194 !36 = !{!"function_entry_count", i64 1}
195 !37 = !{!"branch_weights", i32 100000, i32 1}