1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes='require<profile-summary>,function(chr)' -S | FileCheck %s
4 ; Make sure we freeze poison.
5 define void @chr_poison(i1 %arg) !prof !15 {
6 ; CHECK-LABEL: @chr_poison(
7 ; CHECK-NEXT: [[TMP1:%.*]] = freeze i1 poison
8 ; CHECK-NEXT: [[TMP2:%.*]] = select i1 true, i1 [[TMP1]], i1 false
9 ; CHECK-NEXT: [[TMP3:%.*]] = freeze i1 [[ARG:%.*]]
10 ; CHECK-NEXT: [[TMP4:%.*]] = select i1 [[TMP2]], i1 [[TMP3]], i1 false
11 ; CHECK-NEXT: br i1 [[TMP4]], label [[DOTSPLIT:%.*]], label [[DOTSPLIT_NONCHR:%.*]], !prof [[PROF30:![0-9]+]]
13 ; CHECK-NEXT: br i1 false, label [[BB3:%.*]], label [[BB4:%.*]]
15 ; CHECK-NEXT: [[SEL:%.*]] = select i1 false, ptr null, ptr null
16 ; CHECK-NEXT: br label [[BB6:%.*]]
18 ; CHECK-NEXT: br i1 true, label [[BB6]], label [[BB5:%.*]], !prof [[PROF31:![0-9]+]]
20 ; CHECK-NEXT: br label [[BB6]]
22 ; CHECK-NEXT: br i1 false, label [[BB9:%.*]], label [[BB7:%.*]]
24 ; CHECK-NEXT: br i1 true, label [[BB9]], label [[BB8:%.*]], !prof [[PROF32:![0-9]+]]
26 ; CHECK-NEXT: br label [[BB9]]
27 ; CHECK: .split.nonchr:
28 ; CHECK-NEXT: br i1 false, label [[BB3_NONCHR:%.*]], label [[BB4_NONCHR:%.*]]
30 ; CHECK-NEXT: [[SEL_NONCHR:%.*]] = select i1 false, ptr null, ptr null
31 ; CHECK-NEXT: br label [[BB6_NONCHR:%.*]]
33 ; CHECK-NEXT: br i1 poison, label [[BB6_NONCHR]], label [[BB5_NONCHR:%.*]], !prof [[PROF31]]
35 ; CHECK-NEXT: br label [[BB6_NONCHR]]
37 ; CHECK-NEXT: br i1 false, label [[BB9]], label [[BB7_NONCHR:%.*]]
39 ; CHECK-NEXT: br i1 [[ARG]], label [[BB9]], label [[BB8_NONCHR:%.*]], !prof [[PROF32]]
41 ; CHECK-NEXT: br label [[BB9]]
43 ; CHECK-NEXT: ret void
45 br i1 false, label %bb3, label %bb4
48 %sel = select i1 false, ptr null, ptr null
52 br i1 poison, label %bb6, label %bb5, !prof !16
58 br i1 false, label %bb9, label %bb7
61 br i1 %arg, label %bb9, label %bb8, !prof !17
70 !llvm.module.flags = !{!0}
72 !0 = !{i32 1, !"ProfileSummary", !1}
73 !1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10, !11}
74 !2 = !{!"ProfileFormat", !"SampleProfile"}
75 !3 = !{!"TotalCount", i64 2625732223}
76 !4 = !{!"MaxCount", i64 6099111}
77 !5 = !{!"MaxInternalCount", i64 0}
78 !6 = !{!"MaxFunctionCount", i64 1000000}
79 !7 = !{!"NumCounts", i64 1000000}
80 !8 = !{!"NumFunctions", i64 14940}
81 !9 = !{!"IsPartialProfile", i64 0}
82 !10 = !{!"PartialProfileRatio", double 0.000000e+00}
83 !11 = !{!"DetailedSummary", !12}
85 !13 = !{i32 100000, i64 6083920, i32 44}
86 !14 = !{i32 999999, i64 1, i32 1000000}
87 !15 = !{!"function_entry_count", i64 1000}
88 !16 = !{!"branch_weights", i32 1, i32 0}
89 !17 = !{!"branch_weights", i32 1, i32 0}