1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -S -passes='require<profile-summary>,chr' -verify-region-info < %s | FileCheck %s
4 define void @test(i1 %c, i1 %c2) !prof !29 {
5 ; CHECK-LABEL: define void @test
6 ; CHECK-SAME: (i1 [[C:%.*]], i1 [[C2:%.*]]) !prof [[PROF29:![0-9]+]] {
8 ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 true, [[C]]
9 ; CHECK-NEXT: [[TMP1:%.*]] = freeze i1 [[TMP0]]
10 ; CHECK-NEXT: [[TMP2:%.*]] = select i1 true, i1 [[TMP1]], i1 false
11 ; CHECK-NEXT: [[TMP3:%.*]] = xor i1 true, [[C2]]
12 ; CHECK-NEXT: [[TMP4:%.*]] = freeze i1 [[TMP3]]
13 ; CHECK-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i1 [[TMP4]], i1 false
14 ; CHECK-NEXT: br i1 [[TMP5]], label [[ENTRY_SPLIT:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF30:![0-9]+]]
16 ; CHECK-NEXT: switch i8 0, label [[BB1:%.*]] [
17 ; CHECK-NEXT: i8 1, label [[BB2:%.*]]
18 ; CHECK-NEXT: i8 2, label [[BB3:%.*]]
21 ; CHECK-NEXT: [[SELECT:%.*]] = select i1 false, i32 0, i32 1, !prof [[PROF31:![0-9]+]]
22 ; CHECK-NEXT: br label [[EXIT:%.*]]
24 ; CHECK-NEXT: [[SELECT3:%.*]] = select i1 false, i32 0, i32 1, !prof [[PROF32:![0-9]+]]
25 ; CHECK-NEXT: br label [[EXIT]]
27 ; CHECK-NEXT: br label [[BB3]]
29 ; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ 0, [[DEAD:%.*]] ], [ 1, [[ENTRY_SPLIT]] ]
30 ; CHECK-NEXT: br label [[EXIT]]
31 ; CHECK: entry.split.nonchr:
32 ; CHECK-NEXT: switch i8 0, label [[BB1_NONCHR:%.*]] [
33 ; CHECK-NEXT: i8 1, label [[BB2_NONCHR:%.*]]
34 ; CHECK-NEXT: i8 2, label [[BB3_NONCHR:%.*]]
37 ; CHECK-NEXT: [[SELECT_NONCHR:%.*]] = select i1 [[C]], i32 0, i32 1, !prof [[PROF31]]
38 ; CHECK-NEXT: br label [[EXIT]]
40 ; CHECK-NEXT: [[SELECT3_NONCHR:%.*]] = select i1 [[C2]], i32 0, i32 1, !prof [[PROF32]]
41 ; CHECK-NEXT: br label [[EXIT]]
43 ; CHECK-NEXT: [[PHI_NONCHR:%.*]] = phi i64 [ 1, [[ENTRY_SPLIT_NONCHR]] ]
44 ; CHECK-NEXT: br label [[EXIT]]
46 ; CHECK-NEXT: ret void
49 switch i8 0, label %bb1 [
55 %select = select i1 %c, i32 0, i32 1, !prof !30
59 %select3 = select i1 %c2, i32 0, i32 1, !prof !31
62 dead: ; No predecessors!
65 bb3: ; preds = %dead, %entry
66 %phi = phi i64 [ 0, %dead ], [ 1, %entry ]
69 exit: ; preds = %bb3, %bb2, %bb1
73 !llvm.module.flags = !{!0}
75 !0 = !{i32 1, !"ProfileSummary", !1}
76 !1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10, !11}
77 !2 = !{!"ProfileFormat", !"InstrProf"}
78 !3 = !{!"TotalCount", i64 597326977313}
79 !4 = !{!"MaxCount", i64 12561793713}
80 !5 = !{!"MaxInternalCount", i64 2509052618}
81 !6 = !{!"MaxFunctionCount", i64 12561793713}
82 !7 = !{!"NumCounts", i64 1694881}
83 !8 = !{!"NumFunctions", i64 129214}
84 !9 = !{!"IsPartialProfile", i64 0}
85 !10 = !{!"PartialProfileRatio", double 0.000000e+00}
86 !11 = !{!"DetailedSummary", !12}
87 !12 = !{!13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}
88 !13 = !{i32 10000, i64 12561793713, i32 1}
89 !14 = !{i32 100000, i64 1733566697, i32 20}
90 !15 = !{i32 200000, i64 820928443, i32 71}
91 !16 = !{i32 300000, i64 404967336, i32 182}
92 !17 = !{i32 400000, i64 233162193, i32 376}
93 !18 = !{i32 500000, i64 120552435, i32 741}
94 !19 = !{i32 600000, i64 69388652, i32 1402}
95 !20 = !{i32 700000, i64 33926336, i32 2643}
96 !21 = !{i32 800000, i64 15635940, i32 5288}
97 !22 = !{i32 900000, i64 5547105, i32 11637}
98 !23 = !{i32 950000, i64 2224405, i32 20074}
99 !24 = !{i32 990000, i64 359838, i32 44778}
100 !25 = !{i32 999000, i64 37485, i32 81744}
101 !26 = !{i32 999900, i64 3465, i32 119656}
102 !27 = !{i32 999990, i64 529, i32 155440}
103 !28 = !{i32 999999, i64 70, i32 178344}
104 !29 = !{!"function_entry_count", i64 33781183}
105 !30 = !{!"branch_weights", i32 0, i32 9263770}
106 !31 = !{!"branch_weights", i32 0, i32 634318}