Index: llvm/include/llvm/IR/ProfileSummary.h
===================================================================
--- llvm/include/llvm/IR/ProfileSummary.h
+++ llvm/include/llvm/IR/ProfileSummary.h
@@ -64,11 +64,12 @@
   ProfileSummary(Kind K, SummaryEntryVector DetailedSummary,
                  uint64_t TotalCount, uint64_t MaxCount,
                  uint64_t MaxInternalCount, uint64_t MaxFunctionCount,
-                 uint32_t NumCounts, uint32_t NumFunctions)
+                 uint32_t NumCounts, uint32_t NumFunctions,
+                 bool Partial = false)
       : PSK(K), DetailedSummary(std::move(DetailedSummary)),
         TotalCount(TotalCount), MaxCount(MaxCount),
         MaxInternalCount(MaxInternalCount), MaxFunctionCount(MaxFunctionCount),
-        NumCounts(NumCounts), NumFunctions(NumFunctions) {}
+        NumCounts(NumCounts), NumFunctions(NumFunctions), Partial(Partial) {}
 
   Kind getKind() const { return PSK; }
   /// Return summary information as metadata.
Index: llvm/lib/IR/ProfileSummary.cpp
===================================================================
--- llvm/lib/IR/ProfileSummary.cpp
+++ llvm/lib/IR/ProfileSummary.cpp
@@ -68,14 +68,15 @@
 Metadata *ProfileSummary::getMD(LLVMContext &Context) {
   const char *KindStr[3] = {"InstrProf", "CSInstrProf", "SampleProfile"};
   Metadata *Components[] = {
-    getKeyValMD(Context, "ProfileFormat", KindStr[PSK]),
-    getKeyValMD(Context, "TotalCount", getTotalCount()),
-    getKeyValMD(Context, "MaxCount", getMaxCount()),
-    getKeyValMD(Context, "MaxInternalCount", getMaxInternalCount()),
-    getKeyValMD(Context, "MaxFunctionCount", getMaxFunctionCount()),
-    getKeyValMD(Context, "NumCounts", getNumCounts()),
-    getKeyValMD(Context, "NumFunctions", getNumFunctions()),
-    getDetailedSummaryMD(Context),
+      getKeyValMD(Context, "ProfileFormat", KindStr[PSK]),
+      getKeyValMD(Context, "TotalCount", getTotalCount()),
+      getKeyValMD(Context, "MaxCount", getMaxCount()),
+      getKeyValMD(Context, "MaxInternalCount", getMaxInternalCount()),
+      getKeyValMD(Context, "MaxFunctionCount", getMaxFunctionCount()),
+      getKeyValMD(Context, "NumCounts", getNumCounts()),
+      getKeyValMD(Context, "NumFunctions", getNumFunctions()),
+      getKeyValMD(Context, "IsPartialProfile", isPartialProfile()),
+      getDetailedSummaryMD(Context),
   };
   return MDTuple::get(Context, Components);
 }
@@ -141,7 +142,7 @@
 
 ProfileSummary *ProfileSummary::getFromMD(Metadata *MD) {
   MDTuple *Tuple = dyn_cast_or_null<MDTuple>(MD);
-  if (!Tuple || Tuple->getNumOperands() != 8)
+  if (!Tuple || Tuple->getNumOperands() != 9)
     return nullptr;
 
   auto &FormatMD = Tuple->getOperand(0);
@@ -159,7 +160,7 @@
     return nullptr;
 
   uint64_t NumCounts, TotalCount, NumFunctions, MaxFunctionCount, MaxCount,
-      MaxInternalCount;
+      MaxInternalCount, IsPartialProfile;
   if (!getVal(dyn_cast<MDTuple>(Tuple->getOperand(1)), "TotalCount",
               TotalCount))
     return nullptr;
@@ -176,11 +177,14 @@
   if (!getVal(dyn_cast<MDTuple>(Tuple->getOperand(6)), "NumFunctions",
               NumFunctions))
     return nullptr;
+  if (!getVal(dyn_cast<MDTuple>(Tuple->getOperand(7)), "IsPartialProfile",
+              IsPartialProfile))
+    return nullptr;
 
   SummaryEntryVector Summary;
-  if (!getSummaryFromMD(dyn_cast<MDTuple>(Tuple->getOperand(7)), Summary))
+  if (!getSummaryFromMD(dyn_cast<MDTuple>(Tuple->getOperand(8)), Summary))
     return nullptr;
   return new ProfileSummary(SummaryKind, std::move(Summary), TotalCount,
                             MaxCount, MaxInternalCount, MaxFunctionCount,
-                            NumCounts, NumFunctions);
+                            NumCounts, NumFunctions, IsPartialProfile);
 }
Index: llvm/test/Analysis/ProfileSummary/basic.ll
===================================================================
--- llvm/test/Analysis/ProfileSummary/basic.ll
+++ llvm/test/Analysis/ProfileSummary/basic.ll
@@ -3,7 +3,7 @@
 ; RUN: opt < %s -disable-output -profile-summary-cold-count=0 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-COLD
 ; RUN: opt < %s -disable-output -profile-summary-cold-count=200 -profile-summary-hot-count=1000 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-BOTH
 
-define void @f1() !prof !20 {
+define void @f1() !prof !21 {
 ; CHECK-LABEL: f1 :hot
 ; OVERRIDE-HOT-LABEL: f1
 ; OVERRIDE-COLD-LABEL: f1 :hot
@@ -12,7 +12,7 @@
   ret void
 }
 
-define void @f2() !prof !21 {
+define void @f2() !prof !22 {
 ; CHECK-LABEL: f2 :cold
 ; OVERRIDE-HOT-LABEL: f2 :cold
 ; OVERRIDE-COLD-LABEL: f2
@@ -21,7 +21,7 @@
   ret void
 }
 
-define void @f3() !prof !22 {
+define void @f3() !prof !23 {
 ; CHECK-LABEL: f3
 ; OVERRIDE-HOT-LABEL: f3
 ; OVERRIDE-COLD-LABEL: f3
@@ -31,12 +31,12 @@
 }
 
 !llvm.module.flags = !{!1}
-!20 = !{!"function_entry_count", i64 400}
-!21 = !{!"function_entry_count", i64 1}
-!22 = !{!"function_entry_count", i64 100}
+!21 = !{!"function_entry_count", i64 400}
+!22 = !{!"function_entry_count", i64 1}
+!23 = !{!"function_entry_count", i64 100}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 10}
@@ -44,8 +44,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
Index: llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
===================================================================
--- llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
+++ llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
@@ -47,9 +47,9 @@
 ; CHECK-LABEL:       <GLOBALVAL_SUMMARY_BLOCK
 ; CHECK-NEXT:    <VERSION
 ; CHECK-NEXT:    <FLAGS
-; CHECK-NEXT:    <VALUE_GUID op0=25 op1=123/>
+; CHECK-NEXT:    <VALUE_GUID op0=26 op1=123/>
 ; op4=hot1 op6=cold op8=hot2 op10=hot4 op12=none1 op14=hot3 op16=none2 op18=none3 op20=123
-; CHECK-NEXT:    <PERMODULE_PROFILE {{.*}} op7=1 op8=3 op9=5 op10=1 op11=2 op12=3 op13=4 op14=1 op15=6 op16=2 op17=3 op18=3 op19=7 op20=2 op21=8 op22=2 op23=25 op24=4/>
+; CHECK-NEXT:    <PERMODULE_PROFILE {{.*}} op7=1 op8=3 op9=5 op10=1 op11=2 op12=3 op13=4 op14=1 op15=6 op16=2 op17=3 op18=3 op19=7 op20=2 op21=8 op22=2 op23=26 op24=4/>
 ; CHECK-NEXT:  </GLOBALVAL_SUMMARY_BLOCK>
 
 ; CHECK: <STRTAB_BLOCK
@@ -82,20 +82,20 @@
 target triple = "x86_64-unknown-linux-gnu"
 
 ; This function have high profile count, so entry block is hot.
-define void @hot_function(i1 %a, i1 %a2) !prof !20 {
+define void @hot_function(i1 %a, i1 %a2) !prof !21 {
 entry:
     call void @hot1()
-    br i1 %a, label %Cold, label %Hot, !prof !41
+    br i1 %a, label %Cold, label %Hot, !prof !42
 Cold:           ; 1/1000 goes here
   call void @cold()
   call void @hot2()
-  call void @hot4(), !prof !15
+  call void @hot4(), !prof !16
   call void @none1()
   br label %exit
 Hot:            ; 999/1000 goes here
   call void @hot2()
   call void @hot3()
-  br i1 %a2, label %None1, label %None2, !prof !42
+  br i1 %a2, label %None1, label %None2, !prof !43
 None1:          ; half goes here
   call void @none1()
   call void @none2()
@@ -117,16 +117,16 @@
 declare void @none3() #1
 
 
-!41 = !{!"branch_weights", i32 1, i32 1000}
-!42 = !{!"branch_weights", i32 1, i32 1}
+!42 = !{!"branch_weights", i32 1, i32 1000}
+!43 = !{!"branch_weights", i32 1, i32 1}
 
 
 
 !llvm.module.flags = !{!1}
-!20 = !{!"function_entry_count", i64 110, i64 123}
+!21 = !{!"function_entry_count", i64 110, i64 123}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 10}
@@ -134,12 +134,13 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
-!15 = !{!"branch_weights", i32 100}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
+!16 = !{!"branch_weights", i32 100}
 
 ; DIS: ^0 = module: (path: "{{.*}}thinlto-function-summary-callgraph-profile-summary.ll.tmp.o{{.*}}", hash: (0, 0, 0, 0, 0))
 ; DIS: ^1 = gv: (guid: 123)
Index: llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
===================================================================
--- llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
+++ llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
@@ -30,9 +30,9 @@
 ; CHECK-LABEL:       <GLOBALVAL_SUMMARY_BLOCK
 ; CHECK-NEXT:    <VERSION
 ; CHECK-NEXT:    <FLAGS
-; CHECK-NEXT:    <VALUE_GUID op0=26 op1=123/>
+; CHECK-NEXT:    <VALUE_GUID op0=27 op1=123/>
 ; op4=none1 op6=hot1 op8=cold1 op10=none2 op12=hot2 op14=cold2 op16=none3 op18=hot3 op20=cold3 op22=123
-; CHECK-NEXT:    <PERMODULE_PROFILE {{.*}} op7=7 op8=0 op9=1 op10=3 op11=4 op12=1 op13=8 op14=0 op15=2 op16=3 op17=5 op18=1 op19=9 op20=0 op21=3 op22=3 op23=6 op24=1 op25=26 op26=4/>
+; CHECK-NEXT:    <PERMODULE_PROFILE {{.*}} op7=7 op8=0 op9=1 op10=3 op11=4 op12=1 op13=8 op14=0 op15=2 op16=3 op17=5 op18=1 op19=9 op20=0 op21=3 op22=3 op23=6 op24=1 op25=27 op26=4/>
 ; CHECK-NEXT:  </GLOBALVAL_SUMMARY_BLOCK>
 
 ; CHECK: <STRTAB_BLOCK
@@ -69,21 +69,21 @@
 target triple = "x86_64-unknown-linux-gnu"
 
 ; This function have high profile count, so entry block is hot.
-define void @hot_function(i1 %a, i1 %a2) !prof !20 {
+define void @hot_function(i1 %a, i1 %a2) !prof !21 {
 entry:
   call void @none1()
-  call void @hot1(), !prof !15
-  call void @cold1(), !prof !16
-  br i1 %a, label %Cold, label %Hot, !prof !41
+  call void @hot1(), !prof !16
+  call void @cold1(), !prof !17
+  br i1 %a, label %Cold, label %Hot, !prof !42
 Cold:           ; 1/1000 goes here
   call void @none2()
-  call void @hot2(), !prof !15
-  call void @cold2(), !prof !16
+  call void @hot2(), !prof !16
+  call void @cold2(), !prof !17
   br label %exit
 Hot:            ; 999/1000 goes here
   call void @none3()
-  call void @hot3(), !prof !15
-  call void @cold3(), !prof !16
+  call void @hot3(), !prof !16
+  call void @cold3(), !prof !17
   br label %exit
 exit:
   ret void
@@ -99,13 +99,13 @@
 declare void @none2() #1
 declare void @none3() #1
 
-!41 = !{!"branch_weights", i32 1, i32 1000}
+!42 = !{!"branch_weights", i32 1, i32 1000}
 
 !llvm.module.flags = !{!1}
-!20 = !{!"function_entry_count", i64 110, i64 123}
+!21 = !{!"function_entry_count", i64 110, i64 123}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"SampleProfile"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 10}
@@ -113,10 +113,11 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
-!15 = !{!"branch_weights", i32 100}
-!16 = !{!"branch_weights", i32 1}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
+!16 = !{!"branch_weights", i32 100}
+!17 = !{!"branch_weights", i32 1}
Index: llvm/test/CodeGen/AArch64/arm64-memset-to-bzero-pgso.ll
===================================================================
--- llvm/test/CodeGen/AArch64/arm64-memset-to-bzero-pgso.ll
+++ llvm/test/CodeGen/AArch64/arm64-memset-to-bzero-pgso.ll
@@ -6,7 +6,7 @@
 ; For small size (<= 256), we do not change memset to bzero.
 ; CHECK-DARWIN: {{b|bl}} _memset
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct1(i8* nocapture %ptr) !prof !14 {
+define void @fct1(i8* nocapture %ptr) !prof !15 {
 entry:
   tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 256, i1 false)
   ret void
@@ -18,7 +18,7 @@
 ; When the size is bigger than 256, change into bzero.
 ; CHECK-DARWIN: {{b|bl}} _bzero
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct2(i8* nocapture %ptr) !prof !14 {
+define void @fct2(i8* nocapture %ptr) !prof !15 {
 entry:
   tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 257, i1 false)
   ret void
@@ -28,7 +28,7 @@
 ; For unknown size, change to bzero.
 ; CHECK-DARWIN: {{b|bl}} _bzero
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct3(i8* nocapture %ptr, i32 %unknown) !prof !14 {
+define void @fct3(i8* nocapture %ptr, i32 %unknown) !prof !15 {
 entry:
   %conv = sext i32 %unknown to i64
   tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 %conv, i1 false)
@@ -39,7 +39,7 @@
 ; Size <= 256, no change.
 ; CHECK-DARWIN: {{b|bl}} _memset
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct4(i8* %ptr) !prof !14 {
+define void @fct4(i8* %ptr) !prof !15 {
 entry:
   %tmp = tail call i64 @llvm.objectsize.i64(i8* %ptr, i1 false)
   %call = tail call i8* @__memset_chk(i8* %ptr, i32 0, i64 256, i64 %tmp)
@@ -54,7 +54,7 @@
 ; Size > 256, change.
 ; CHECK-DARWIN: {{b|bl}} _bzero
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct5(i8* %ptr) !prof !14 {
+define void @fct5(i8* %ptr) !prof !15 {
 entry:
   %tmp = tail call i64 @llvm.objectsize.i64(i8* %ptr, i1 false)
   %call = tail call i8* @__memset_chk(i8* %ptr, i32 0, i64 257, i64 %tmp)
@@ -65,7 +65,7 @@
 ; Size = unknown, change.
 ; CHECK-DARWIN: {{b|bl}} _bzero
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct6(i8* %ptr, i32 %unknown) !prof !14 {
+define void @fct6(i8* %ptr, i32 %unknown) !prof !15 {
 entry:
   %conv = sext i32 %unknown to i64
   %tmp = tail call i64 @llvm.objectsize.i64(i8* %ptr, i1 false)
@@ -80,7 +80,7 @@
 ; memset with something that is not a zero, no change.
 ; CHECK-DARWIN: {{b|bl}} _memset
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct7(i8* %ptr) !prof !14 {
+define void @fct7(i8* %ptr) !prof !15 {
 entry:
   %tmp = tail call i64 @llvm.objectsize.i64(i8* %ptr, i1 false)
   %call = tail call i8* @__memset_chk(i8* %ptr, i32 1, i64 256, i64 %tmp)
@@ -91,7 +91,7 @@
 ; memset with something that is not a zero, no change.
 ; CHECK-DARWIN: {{b|bl}} _memset
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct8(i8* %ptr) !prof !14 {
+define void @fct8(i8* %ptr) !prof !15 {
 entry:
   %tmp = tail call i64 @llvm.objectsize.i64(i8* %ptr, i1 false)
   %call = tail call i8* @__memset_chk(i8* %ptr, i32 1, i64 257, i64 %tmp)
@@ -102,7 +102,7 @@
 ; memset with something that is not a zero, no change.
 ; CHECK-DARWIN: {{b|bl}} _memset
 ; CHECK-LINUX: {{b|bl}} memset
-define void @fct9(i8* %ptr, i32 %unknown) !prof !14 {
+define void @fct9(i8* %ptr, i32 %unknown) !prof !15 {
 entry:
   %conv = sext i32 %unknown to i64
   %tmp = tail call i64 @llvm.objectsize.i64(i8* %ptr, i1 false)
@@ -112,7 +112,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -120,9 +120,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/AArch64/max-jump-table.ll
===================================================================
--- llvm/test/CodeGen/AArch64/max-jump-table.ll
+++ llvm/test/CodeGen/AArch64/max-jump-table.ll
@@ -262,7 +262,7 @@
 return: ret i32 %b
 }
 
-define i32 @jt1_pgso(i32 %a, i32 %b) !prof !14 {
+define i32 @jt1_pgso(i32 %a, i32 %b) !prof !15 {
 entry:
   switch i32 %a, label %return [
     i32 1,  label %bb1
@@ -322,7 +322,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -330,9 +330,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/ARM/constantpool-align.ll
===================================================================
--- llvm/test/CodeGen/ARM/constantpool-align.ll
+++ llvm/test/CodeGen/ARM/constantpool-align.ll
@@ -21,14 +21,14 @@
 ; CHECK-LABEL: f_pgso:
 ; CHECK: vld1.64 {{.*}}, [r1]
 ; CHECK: .p2align 3
-define void @f_pgso(<4 x i32>* %p) !prof !14 {
+define void @f_pgso(<4 x i32>* %p) !prof !15 {
   store <4 x i32> <i32 -1, i32 0, i32 0, i32 -1>, <4 x i32>* %p, align 4
   ret void 
 }
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -36,9 +36,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/RISCV/tail-calls.ll
===================================================================
--- llvm/test/CodeGen/RISCV/tail-calls.ll
+++ llvm/test/CodeGen/RISCV/tail-calls.ll
@@ -25,7 +25,7 @@
 
 ; Perform tail call optimization for external symbol.
 @dest_pgso = global [2 x i8] zeroinitializer
-define void @caller_extern_pgso(i8* %src) !prof !14 {
+define void @caller_extern_pgso(i8* %src) !prof !15 {
 entry:
 ; CHECK: caller_extern_pgso
 ; CHECK-NOT: call memcpy
@@ -214,7 +214,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -222,9 +222,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/atom-pad-short-functions.ll
===================================================================
--- llvm/test/CodeGen/X86/atom-pad-short-functions.ll
+++ llvm/test/CodeGen/X86/atom-pad-short-functions.ll
@@ -29,7 +29,7 @@
   ret i32 %a
 }
 
-define i32 @test_pgso(i32 %a) nounwind !prof !14 {
+define i32 @test_pgso(i32 %a) nounwind !prof !15 {
 ; CHECK: test_pgso
 ; CHECK: movl
 ; CHECK-NEXT: ret
@@ -110,7 +110,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -118,9 +118,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/avx-cvt.ll
===================================================================
--- llvm/test/CodeGen/X86/avx-cvt.ll
+++ llvm/test/CodeGen/X86/avx-cvt.ll
@@ -190,7 +190,7 @@
   ret float %res
 }
 
-define float @floor_f32_load_pgso(float* %aptr) !prof !14 {
+define float @floor_f32_load_pgso(float* %aptr) !prof !15 {
 ; CHECK-LABEL: floor_f32_load_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    vroundss $9, (%rdi), %xmm0, %xmm0
@@ -210,7 +210,7 @@
   ret double %res
 }
 
-define double @nearbyint_f64_load_pgso(double* %aptr) !prof !14 {
+define double @nearbyint_f64_load_pgso(double* %aptr) !prof !15 {
 ; CHECK-LABEL: nearbyint_f64_load_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    vroundsd $12, (%rdi), %xmm0, %xmm0
@@ -222,7 +222,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -230,9 +230,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/avx512-mask-op.ll
===================================================================
--- llvm/test/CodeGen/X86/avx512-mask-op.ll
+++ llvm/test/CodeGen/X86/avx512-mask-op.ll
@@ -1945,7 +1945,7 @@
   ret <32 x i16> %ret
 }
 
-define <32 x i16> @test_build_vec_v32i1_pgso(<32 x i16> %x) !prof !14 {
+define <32 x i16> @test_build_vec_v32i1_pgso(<32 x i16> %x) !prof !15 {
 ; KNL-LABEL: test_build_vec_v32i1_pgso:
 ; KNL:       ## %bb.0:
 ; KNL-NEXT:    vandps {{.*}}(%rip), %ymm0, %ymm1
@@ -5698,7 +5698,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -5706,9 +5706,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/bypass-slow-division-tune.ll
===================================================================
--- llvm/test/CodeGen/X86/bypass-slow-division-tune.ll
+++ llvm/test/CodeGen/X86/bypass-slow-division-tune.ll
@@ -138,7 +138,7 @@
   ret i64 %div
 }
 
-define i64 @div64_pgso(i64 %a, i64 %b) !prof !15 {
+define i64 @div64_pgso(i64 %a, i64 %b) !prof !16 {
 ; CHECK-LABEL: div64_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -246,7 +246,7 @@
   ret i32 %div
 }
 
-define i32 @div32_pgso(i32 %a, i32 %b) !prof !15 {
+define i32 @div32_pgso(i32 %a, i32 %b) !prof !16 {
 ; CHECK-LABEL: div32_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movl %edi, %eax
@@ -284,7 +284,7 @@
 
 !llvm.module.flags = !{!1}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -292,9 +292,10 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 1000, i32 1}
-!13 = !{i32 999000, i64 1000, i32 3}
-!14 = !{i32 999999, i64 5, i32 3}
-!15 = !{!"function_entry_count", i64 0}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 1000, i32 1}
+!14 = !{i32 999000, i64 1000, i32 3}
+!15 = !{i32 999999, i64 5, i32 3}
+!16 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/cmov-into-branch.ll
===================================================================
--- llvm/test/CodeGen/X86/cmov-into-branch.ll
+++ llvm/test/CodeGen/X86/cmov-into-branch.ll
@@ -88,7 +88,7 @@
 ; CHECK-NEXT:    cmovnel %edi, %eax
 ; CHECK-NEXT:    retq
   %cmp = icmp ne i32 %a, 0
-  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !15
+  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !16
   ret i32 %sel
 }
 
@@ -104,7 +104,7 @@
 ; CHECK-NEXT:  .LBB6_2: # %select.end
 ; CHECK-NEXT:    retq
   %cmp = icmp ne i32 %a, 0
-  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !16
+  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !17
   ret i32 %sel
 }
 
@@ -124,7 +124,7 @@
 ; CHECK-NEXT:    movl %esi, %eax
 ; CHECK-NEXT:    retq
   %cmp = icmp ne i32 %a, 0
-  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !17
+  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !18
   ret i32 %sel
 }
 
@@ -137,7 +137,7 @@
 ; CHECK-NEXT:    cmovnel %edi, %eax
 ; CHECK-NEXT:    retq
   %cmp = icmp ne i32 %a, 0
-  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !18
+  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !19
   ret i32 %sel
 }
 
@@ -149,11 +149,11 @@
 ; CHECK-NEXT:    cmovnel %edi, %eax
 ; CHECK-NEXT:    retq
   %cmp = icmp ne i32 %a, 0
-  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !16
+  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !17
   ret i32 %sel
 }
 
-define i32 @weighted_select_pgso(i32 %a, i32 %b) !prof !14 {
+define i32 @weighted_select_pgso(i32 %a, i32 %b) !prof !15 {
 ; CHECK-LABEL: weighted_select_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movl %esi, %eax
@@ -161,12 +161,12 @@
 ; CHECK-NEXT:    cmovnel %edi, %eax
 ; CHECK-NEXT:    retq
   %cmp = icmp ne i32 %a, 0
-  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !16
+  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !17
   ret i32 %sel
 }
 
 ; If two selects in a row are predictable, turn them into branches.
-define i32 @weighted_selects(i32 %a, i32 %b) !prof !19 {
+define i32 @weighted_selects(i32 %a, i32 %b) !prof !20 {
 ; CHECK-LABEL: weighted_selects:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movl %esi, %eax
@@ -183,15 +183,15 @@
 ; CHECK-NEXT:  .LBB11_4: # %select.end1
 ; CHECK-NEXT:    retq
   %cmp = icmp ne i32 %a, 0
-  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !16
+  %sel = select i1 %cmp, i32 %a, i32 %b, !prof !17
   %cmp1 = icmp ne i32 %sel, 0
-  %sel1 = select i1 %cmp1, i32 %b, i32 %a, !prof !16
+  %sel1 = select i1 %cmp1, i32 %b, i32 %a, !prof !17
   ret i32 %sel1
 }
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -199,14 +199,15 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
-!15 = !{!"branch_weights", i32 1, i32 99}
-!16 = !{!"branch_weights", i32 1, i32 100}
-!17 = !{!"branch_weights", i32 100, i32 1}
-!18 = !{!"branch_weights", i32 0, i32 0}
-!19 = !{!"function_entry_count", i64 100}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
+!16 = !{!"branch_weights", i32 1, i32 99}
+!17 = !{!"branch_weights", i32 1, i32 100}
+!18 = !{!"branch_weights", i32 100, i32 1}
+!19 = !{!"branch_weights", i32 0, i32 0}
+!20 = !{!"function_entry_count", i64 100}
Index: llvm/test/CodeGen/X86/conditional-tailcall-pgso.ll
===================================================================
--- llvm/test/CodeGen/X86/conditional-tailcall-pgso.ll
+++ llvm/test/CodeGen/X86/conditional-tailcall-pgso.ll
@@ -6,7 +6,7 @@
 declare void @foo()
 declare void @bar()
 
-define void @f(i32 %x, i32 %y) !prof !14 {
+define void @f(i32 %x, i32 %y) !prof !15 {
 ; CHECK32-LABEL: f:
 ; CHECK32:       # %bb.0: # %entry
 ; CHECK32-NEXT:    movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
@@ -53,7 +53,7 @@
 ; Check that the asm doesn't just look good, but uses the correct encoding.
 }
 
-define void @f_non_leaf(i32 %x, i32 %y) !prof !14 {
+define void @f_non_leaf(i32 %x, i32 %y) !prof !15 {
 ; CHECK32-LABEL: f_non_leaf:
 ; CHECK32:       # %bb.0: # %entry
 ; CHECK32-NEXT:    pushl %ebx # encoding: [0x53]
@@ -144,7 +144,7 @@
 }
 
 declare x86_thiscallcc zeroext i1 @baz(i8*, i32)
-define x86_thiscallcc zeroext i1 @BlockPlacementTest(i8* %this, i32 %x) !prof !14 {
+define x86_thiscallcc zeroext i1 @BlockPlacementTest(i8* %this, i32 %x) !prof !15 {
 ; CHECK32-LABEL: BlockPlacementTest:
 ; CHECK32:       # %bb.0: # %entry
 ; CHECK32-NEXT:    movl {{[0-9]+}}(%esp), %edx # encoding: [0x8b,0x54,0x24,0x04]
@@ -226,7 +226,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -234,9 +234,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/fixup-lea.ll
===================================================================
--- llvm/test/CodeGen/X86/fixup-lea.ll
+++ llvm/test/CodeGen/X86/fixup-lea.ll
@@ -108,7 +108,7 @@
   ret void
 }
 
-define void @foo_pgso(i32 inreg %dns) !prof !14 {
+define void @foo_pgso(i32 inreg %dns) !prof !15 {
 ; SLOW-LABEL: foo_pgso:
 ; SLOW:       # %bb.0: # %entry
 ; SLOW-NEXT:    xorl %ecx, %ecx
@@ -148,7 +148,7 @@
   ret void
 }
 
-define void @bar_pgso(i32 inreg %dns) !prof !14 {
+define void @bar_pgso(i32 inreg %dns) !prof !15 {
 ; SLOW-LABEL: bar_pgso:
 ; SLOW:       # %bb.0: # %entry
 ; SLOW-NEXT:    xorl %ecx, %ecx
@@ -268,7 +268,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -276,9 +276,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/fold-load-unops.ll
===================================================================
--- llvm/test/CodeGen/X86/fold-load-unops.ll
+++ llvm/test/CodeGen/X86/fold-load-unops.ll
@@ -113,7 +113,7 @@
     ret <4 x float> %res
 }
 
-define float @rcpss_pgso(float* %a) !prof !14 {
+define float @rcpss_pgso(float* %a) !prof !15 {
 ; SSE-LABEL: rcpss_pgso:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    rcpss (%rdi), %xmm0
@@ -130,7 +130,7 @@
     ret float %ext
 }
 
-define <4 x float> @rcpss_full_pgso(<4 x float>* %a) !prof !14 {
+define <4 x float> @rcpss_full_pgso(<4 x float>* %a) !prof !15 {
 ; SSE-LABEL: rcpss_full_pgso:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    rcpss (%rdi), %xmm0
@@ -177,7 +177,7 @@
     ret <4 x float> %res
 }
 
-define float @rsqrtss_pgso(float* %a) !prof !14 {
+define float @rsqrtss_pgso(float* %a) !prof !15 {
 ; SSE-LABEL: rsqrtss_pgso:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    rsqrtss (%rdi), %xmm0
@@ -194,7 +194,7 @@
     ret float %ext
 }
 
-define <4 x float> @rsqrtss_full_pgso(<4 x float>* %a) !prof !14 {
+define <4 x float> @rsqrtss_full_pgso(<4 x float>* %a) !prof !15 {
 ; SSE-LABEL: rsqrtss_full_pgso:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    rsqrtss (%rdi), %xmm0
@@ -260,7 +260,7 @@
     ret <4 x float> %res
 }
 
-define float @sqrtss_pgso(float* %a) !prof !14 {
+define float @sqrtss_pgso(float* %a) !prof !15 {
 ; SSE-LABEL: sqrtss_pgso:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    sqrtss (%rdi), %xmm0
@@ -277,7 +277,7 @@
     ret float %ext
 }
 
-define <4 x float> @sqrtss_full_pgso(<4 x float>* %a) !prof !14 {
+define <4 x float> @sqrtss_full_pgso(<4 x float>* %a) !prof !15 {
 ; SSE-LABEL: sqrtss_full_pgso:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    movaps (%rdi), %xmm0
@@ -294,7 +294,7 @@
     ret <4 x float> %res
 }
 
-define <4 x float> @sqrtss_full_pgso_volatile(<4 x float>* %a) !prof !14 {
+define <4 x float> @sqrtss_full_pgso_volatile(<4 x float>* %a) !prof !15 {
 ; SSE-LABEL: sqrtss_full_pgso_volatile:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    movaps (%rdi), %xmm0
@@ -362,7 +362,7 @@
     ret <2 x double> %res
 }
 
-define double @sqrtsd_pgso(double* %a) !prof !14 {
+define double @sqrtsd_pgso(double* %a) !prof !15 {
 ; SSE-LABEL: sqrtsd_pgso:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    sqrtsd (%rdi), %xmm0
@@ -379,7 +379,7 @@
     ret double %ext
 }
 
-define <2 x double> @sqrtsd_full_pgso(<2 x double>* %a) !prof !14 {
+define <2 x double> @sqrtsd_full_pgso(<2 x double>* %a) !prof !15 {
 ; SSE-LABEL: sqrtsd_full_pgso:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    movapd (%rdi), %xmm0
@@ -396,7 +396,7 @@
     ret <2 x double> %res
 }
 
-define <2 x double> @sqrtsd_full_pgso_volatile(<2 x double>* %a) !prof !14 {
+define <2 x double> @sqrtsd_full_pgso_volatile(<2 x double>* %a) !prof !15 {
 ; SSE-LABEL: sqrtsd_full_pgso_volatile:
 ; SSE:       # %bb.0:
 ; SSE-NEXT:    movapd (%rdi), %xmm0
@@ -420,7 +420,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -428,9 +428,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/fshl.ll
===================================================================
--- llvm/test/CodeGen/X86/fshl.ll
+++ llvm/test/CodeGen/X86/fshl.ll
@@ -196,7 +196,7 @@
   ret i32 %tmp
 }
 
-define i32 @var_shift_i32_pgso(i32 %x, i32 %y, i32 %z) nounwind !prof !14 {
+define i32 @var_shift_i32_pgso(i32 %x, i32 %y, i32 %z) nounwind !prof !15 {
 ; X86-LABEL: var_shift_i32_pgso:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movb {{[0-9]+}}(%esp), %cl
@@ -606,7 +606,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -614,9 +614,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/fshr.ll
===================================================================
--- llvm/test/CodeGen/X86/fshr.ll
+++ llvm/test/CodeGen/X86/fshr.ll
@@ -195,7 +195,7 @@
   ret i32 %tmp
 }
 
-define i32 @var_shift_i32_pgso(i32 %x, i32 %y, i32 %z) nounwind !prof !14 {
+define i32 @var_shift_i32_pgso(i32 %x, i32 %y, i32 %z) nounwind !prof !15 {
 ; X86-LABEL: var_shift_i32_pgso:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movb {{[0-9]+}}(%esp), %cl
@@ -601,7 +601,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -609,9 +609,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/haddsub.ll
===================================================================
--- llvm/test/CodeGen/X86/haddsub.ll
+++ llvm/test/CodeGen/X86/haddsub.ll
@@ -1983,7 +1983,7 @@
   ret float %x230
 }
 
-define float @hadd32_4_pgso(<4 x float> %x225) !prof !14 {
+define float @hadd32_4_pgso(<4 x float> %x225) !prof !15 {
 ; SSE3-LABEL: hadd32_4_pgso:
 ; SSE3:       # %bb.0:
 ; SSE3-NEXT:    movaps %xmm0, %xmm1
@@ -2007,7 +2007,7 @@
   ret float %x230
 }
 
-define float @hadd32_8_pgso(<8 x float> %x225) !prof !14 {
+define float @hadd32_8_pgso(<8 x float> %x225) !prof !15 {
 ; SSE3-LABEL: hadd32_8_pgso:
 ; SSE3:       # %bb.0:
 ; SSE3-NEXT:    movaps %xmm0, %xmm1
@@ -2032,7 +2032,7 @@
   ret float %x230
 }
 
-define float @hadd32_16_pgso(<16 x float> %x225) !prof !14 {
+define float @hadd32_16_pgso(<16 x float> %x225) !prof !15 {
 ; SSE3-LABEL: hadd32_16_pgso:
 ; SSE3:       # %bb.0:
 ; SSE3-NEXT:    movaps %xmm0, %xmm1
@@ -2192,7 +2192,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -2200,9 +2200,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/immediate_merging.ll
===================================================================
--- llvm/test/CodeGen/X86/immediate_merging.ll
+++ llvm/test/CodeGen/X86/immediate_merging.ll
@@ -75,7 +75,7 @@
 
 ; Test PGSO to make sure immediates with multiple users don't get pulled in to
 ; instructions.
-define i32 @foo_pgso() !prof !14 {
+define i32 @foo_pgso() !prof !15 {
 ; X86-LABEL: foo_pgso:
 ; X86:       # %bb.0: # %entry
 ; X86-NEXT:    movl $1234, %eax # imm = 0x4D2
@@ -190,7 +190,7 @@
 ; memset gets lowered in DAG. Constant merging should hoist all the
 ; immediates used to store to the individual memory locations. Make
 ; sure we don't directly store the immediates.
-define void @foomemset_pgso() !prof !14 {
+define void @foomemset_pgso() !prof !15 {
 ; X86-LABEL: foomemset_pgso:
 ; X86:       # %bb.0: # %entry
 ; X86-NEXT:    movl $555819297, %eax # imm = 0x21212121
@@ -216,7 +216,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -224,9 +224,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/immediate_merging64.ll
===================================================================
--- llvm/test/CodeGen/X86/immediate_merging64.ll
+++ llvm/test/CodeGen/X86/immediate_merging64.ll
@@ -19,7 +19,7 @@
   ret i1 %cmp
 }
 
-define i1 @imm_multiple_users_pgso(i64 %a, i64* %b) !prof !14 {
+define i1 @imm_multiple_users_pgso(i64 %a, i64* %b) !prof !15 {
 ; CHECK-LABEL: imm_multiple_users_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq $-1, %rax
@@ -48,7 +48,7 @@
   ret void
 }
 
-define void @memset_zero_pgso(i8* noalias nocapture %D) !prof !14 {
+define void @memset_zero_pgso(i8* noalias nocapture %D) !prof !15 {
 ; CHECK-LABEL: memset_zero_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    xorl %eax, %eax
@@ -61,7 +61,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -69,9 +69,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/insert-prefetch.ll
===================================================================
--- llvm/test/CodeGen/X86/insert-prefetch.ll
+++ llvm/test/CodeGen/X86/insert-prefetch.ll
@@ -16,23 +16,23 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define i32 @sum(i32* %arr, i32 %pos1, i32 %pos2) !dbg !35 !prof !37 {
+define i32 @sum(i32* %arr, i32 %pos1, i32 %pos2) !dbg !36 !prof !38 {
 entry:
-  %idxprom = sext i32 %pos1 to i64, !dbg !38
-  %arrayidx = getelementptr inbounds i32, i32* %arr, i64 %idxprom, !dbg !38
-  %0 = load i32, i32* %arrayidx, align 4, !dbg !38, !tbaa !39
-  %idxprom1 = sext i32 %pos2 to i64, !dbg !43
-  %arrayidx2 = getelementptr inbounds i32, i32* %arr, i64 %idxprom1, !dbg !43
-  %1 = load i32, i32* %arrayidx2, align 4, !dbg !43, !tbaa !39
-  %add = add nsw i32 %1, %0, !dbg !44
-  ret i32 %add, !dbg !45
+  %idxprom = sext i32 %pos1 to i64, !dbg !39
+  %arrayidx = getelementptr inbounds i32, i32* %arr, i64 %idxprom, !dbg !39
+  %0 = load i32, i32* %arrayidx, align 4, !dbg !39, !tbaa !40
+  %idxprom1 = sext i32 %pos2 to i64, !dbg !44
+  %arrayidx2 = getelementptr inbounds i32, i32* %arr, i64 %idxprom1, !dbg !44
+  %1 = load i32, i32* %arrayidx2, align 4, !dbg !44, !tbaa !40
+  %add = add nsw i32 %1, %0, !dbg !45
+  ret i32 %add, !dbg !46
 }
 
 attributes #0 = { "target-cpu"="x86-64" }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3, !4, !5, !6}
-!llvm.ident = !{!33}
+!llvm.ident = !{!34}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, debugInfoForProfiling: true)
 !1 = !DIFile(filename: "test.cc", directory: "/tmp")
@@ -41,7 +41,7 @@
 !4 = !{i32 2, !"Debug Info Version", i32 3}
 !5 = !{i32 1, !"wchar_size", i32 4}
 !6 = !{i32 1, !"ProfileSummary", !7}
-!7 = !{!8, !9, !10, !11, !12, !13, !14, !15}
+!7 = !{!8, !9, !10, !11, !12, !13, !14, !15, !16}
 !8 = !{!"ProfileFormat", !"SampleProfile"}
 !9 = !{!"TotalCount", i64 0}
 !10 = !{!"MaxCount", i64 0}
@@ -49,36 +49,37 @@
 !12 = !{!"MaxFunctionCount", i64 0}
 !13 = !{!"NumCounts", i64 2}
 !14 = !{!"NumFunctions", i64 1}
-!15 = !{!"DetailedSummary", !16}
-!16 = !{!17, !18, !19, !20, !21, !22, !22, !23, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32}
-!17 = !{i32 10000, i64 0, i32 0}
-!18 = !{i32 100000, i64 0, i32 0}
-!19 = !{i32 200000, i64 0, i32 0}
-!20 = !{i32 300000, i64 0, i32 0}
-!21 = !{i32 400000, i64 0, i32 0}
-!22 = !{i32 500000, i64 0, i32 0}
-!23 = !{i32 600000, i64 0, i32 0}
-!24 = !{i32 700000, i64 0, i32 0}
-!25 = !{i32 800000, i64 0, i32 0}
-!26 = !{i32 900000, i64 0, i32 0}
-!27 = !{i32 950000, i64 0, i32 0}
-!28 = !{i32 990000, i64 0, i32 0}
-!29 = !{i32 999000, i64 0, i32 0}
-!30 = !{i32 999900, i64 0, i32 0}
-!31 = !{i32 999990, i64 0, i32 0}
-!32 = !{i32 999999, i64 0, i32 0}
-!33 = !{!"clang version 7.0.0 (trunk 322593) (llvm/trunk 322526)"}
-!35 = distinct !DISubprogram(name: "sum", linkageName: "sum", scope: !1, file: !1, line: 15, type: !36, isLocal: false, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
-!36 = !DISubroutineType(types: !2)
-!37 = !{!"function_entry_count", i64 -1}
-!38 = !DILocation(line: 16, column: 10, scope: !35)
-!39 = !{!40, !40, i64 0}
-!40 = !{!"int", !41, i64 0}
-!41 = !{!"omnipotent char", !42, i64 0}
-!42 = !{!"Simple C++ TBAA"}
-!43 = !DILocation(line: 16, column: 22, scope: !35)
-!44 = !DILocation(line: 16, column: 20, scope: !35)
-!45 = !DILocation(line: 16, column: 3, scope: !35)
+!15 = !{!"IsPartialProfile", i64 0}
+!16 = !{!"DetailedSummary", !17}
+!17 = !{!18, !19, !20, !21, !22, !23, !23, !24, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33}
+!18 = !{i32 10000, i64 0, i32 0}
+!19 = !{i32 100000, i64 0, i32 0}
+!20 = !{i32 200000, i64 0, i32 0}
+!21 = !{i32 300000, i64 0, i32 0}
+!22 = !{i32 400000, i64 0, i32 0}
+!23 = !{i32 500000, i64 0, i32 0}
+!24 = !{i32 600000, i64 0, i32 0}
+!25 = !{i32 700000, i64 0, i32 0}
+!26 = !{i32 800000, i64 0, i32 0}
+!27 = !{i32 900000, i64 0, i32 0}
+!28 = !{i32 950000, i64 0, i32 0}
+!29 = !{i32 990000, i64 0, i32 0}
+!30 = !{i32 999000, i64 0, i32 0}
+!31 = !{i32 999900, i64 0, i32 0}
+!32 = !{i32 999990, i64 0, i32 0}
+!33 = !{i32 999999, i64 0, i32 0}
+!34 = !{!"clang version 7.0.0 (trunk 322593) (llvm/trunk 322526)"}
+!36 = distinct !DISubprogram(name: "sum", linkageName: "sum", scope: !1, file: !1, line: 15, type: !37, isLocal: false, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
+!37 = !DISubroutineType(types: !2)
+!38 = !{!"function_entry_count", i64 -1}
+!39 = !DILocation(line: 16, column: 10, scope: !36)
+!40 = !{!41, !41, i64 0}
+!41 = !{!"int", !42, i64 0}
+!42 = !{!"omnipotent char", !43, i64 0}
+!43 = !{!"Simple C++ TBAA"}
+!44 = !DILocation(line: 16, column: 22, scope: !36)
+!45 = !DILocation(line: 16, column: 20, scope: !36)
+!46 = !DILocation(line: 16, column: 3, scope: !36)
 
 ;CHECK-LABEL: sum:
 ;CHECK:       # %bb.0:
Index: llvm/test/CodeGen/X86/loop-blocks.ll
===================================================================
--- llvm/test/CodeGen/X86/loop-blocks.ll
+++ llvm/test/CodeGen/X86/loop-blocks.ll
@@ -274,7 +274,7 @@
 ; CHECK:          .LBB6_1:
 ; CHECK-NEXT:     callq body
 
-define void @slightly_more_involved_2_pgso() norecurse nounwind readnone uwtable !prof !14 {
+define void @slightly_more_involved_2_pgso() norecurse nounwind readnone uwtable !prof !15 {
 entry:
   br label %loop
 
@@ -313,7 +313,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -321,9 +321,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/materialize.ll
===================================================================
--- llvm/test/CodeGen/X86/materialize.ll
+++ llvm/test/CodeGen/X86/materialize.ll
@@ -37,7 +37,7 @@
 ; CHECK64-NEXT:  retq
 }
 
-define i32 @one32_pgso() !prof !14 {
+define i32 @one32_pgso() !prof !15 {
 entry:
   ret i32 1
 
@@ -142,7 +142,7 @@
 ; CHECK32-NEXT:  retl
 }
 
-define i32 @minus_one32_pgso() !prof !14 {
+define i32 @minus_one32_pgso() !prof !15 {
 entry:
   ret i32 -1
 
@@ -185,7 +185,7 @@
 ; CHECK32-NEXT:  retl
 }
 
-define i16 @one16_pgso() !prof !14 {
+define i16 @one16_pgso() !prof !15 {
 entry:
   ret i16 1
 
@@ -196,7 +196,7 @@
 ; CHECK32-NEXT:  retl
 }
 
-define i16 @minus_one16_pgso() !prof !14 {
+define i16 @minus_one16_pgso() !prof !15 {
 entry:
   ret i16 -1
 
@@ -280,7 +280,7 @@
 ; CHECK32:       retl
 }
 
-define i32 @rematerialize_minus_one_pgso() !prof !14 {
+define i32 @rematerialize_minus_one_pgso() !prof !15 {
 entry:
   ; Materialize -1 (thiscall forces it into %ecx).
   tail call x86_thiscallcc void @f(i32 -1)
@@ -302,7 +302,7 @@
 ; CHECK32:       retl
 }
 
-define i32 @rematerialize_minus_one_eflags_pgso(i32 %x) !prof !14 {
+define i32 @rematerialize_minus_one_eflags_pgso(i32 %x) !prof !15 {
 entry:
   ; Materialize -1 (thiscall forces it into %ecx).
   tail call x86_thiscallcc void @f(i32 -1)
@@ -335,7 +335,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -343,9 +343,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/memcmp-pgso.ll
===================================================================
--- llvm/test/CodeGen/X86/memcmp-pgso.ll
+++ llvm/test/CodeGen/X86/memcmp-pgso.ll
@@ -13,7 +13,7 @@
 declare i32 @memcmp(i8*, i8*, i64)
 declare i32 @bcmp(i8*, i8*, i64)
 
-define i32 @length2(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length2(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length2:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -41,7 +41,7 @@
   ret i32 %m
 }
 
-define i1 @length2_eq(i8* %X, i8* %Y) nounwind !prof !14 {
+define i1 @length2_eq(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length2_eq:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -62,7 +62,7 @@
   ret i1 %c
 }
 
-define i1 @length2_eq_const(i8* %X) nounwind !prof !14 {
+define i1 @length2_eq_const(i8* %X) nounwind !prof !15 {
 ; X86-LABEL: length2_eq_const:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -82,7 +82,7 @@
   ret i1 %c
 }
 
-define i1 @length2_eq_nobuiltin_attr(i8* %X, i8* %Y) nounwind !prof !14 {
+define i1 @length2_eq_nobuiltin_attr(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length2_eq_nobuiltin_attr:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -109,7 +109,7 @@
   ret i1 %c
 }
 
-define i32 @length3(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length3(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length3:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl %esi
@@ -156,7 +156,7 @@
   ret i32 %m
 }
 
-define i1 @length3_eq(i8* %X, i8* %Y) nounwind !prof !14 {
+define i1 @length3_eq(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length3_eq:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -185,7 +185,7 @@
   ret i1 %c
 }
 
-define i32 @length4(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length4(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length4:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -215,7 +215,7 @@
   ret i32 %m
 }
 
-define i1 @length4_eq(i8* %X, i8* %Y) nounwind !prof !14 {
+define i1 @length4_eq(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length4_eq:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -236,7 +236,7 @@
   ret i1 %c
 }
 
-define i1 @length4_eq_const(i8* %X) nounwind !prof !14 {
+define i1 @length4_eq_const(i8* %X) nounwind !prof !15 {
 ; X86-LABEL: length4_eq_const:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -254,7 +254,7 @@
   ret i1 %c
 }
 
-define i32 @length5(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length5(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length5:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl %esi
@@ -301,7 +301,7 @@
   ret i32 %m
 }
 
-define i1 @length5_eq(i8* %X, i8* %Y) nounwind !prof !14 {
+define i1 @length5_eq(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length5_eq:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -330,7 +330,7 @@
   ret i1 %c
 }
 
-define i32 @length8(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length8(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length8:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl %esi
@@ -374,7 +374,7 @@
   ret i32 %m
 }
 
-define i1 @length8_eq(i8* %X, i8* %Y) nounwind !prof !14 {
+define i1 @length8_eq(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length8_eq:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -398,7 +398,7 @@
   ret i1 %c
 }
 
-define i1 @length8_eq_const(i8* %X) nounwind !prof !14 {
+define i1 @length8_eq_const(i8* %X) nounwind !prof !15 {
 ; X86-LABEL: length8_eq_const:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -421,7 +421,7 @@
   ret i1 %c
 }
 
-define i1 @length12_eq(i8* %X, i8* %Y) nounwind !prof !14 {
+define i1 @length12_eq(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length12_eq:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -448,7 +448,7 @@
   ret i1 %c
 }
 
-define i32 @length12(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length12(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length12:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -488,7 +488,7 @@
 
 ; PR33329 - https://bugs.llvm.org/show_bug.cgi?id=33329
 
-define i32 @length16(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length16(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length16:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -526,7 +526,7 @@
   ret i32 %m
 }
 
-define i1 @length16_eq(i8* %x, i8* %y) nounwind !prof !14 {
+define i1 @length16_eq(i8* %x, i8* %y) nounwind !prof !15 {
 ; X86-NOSSE-LABEL: length16_eq:
 ; X86-NOSSE:       # %bb.0:
 ; X86-NOSSE-NEXT:    pushl $0
@@ -573,7 +573,7 @@
   ret i1 %cmp
 }
 
-define i1 @length16_eq_const(i8* %X) nounwind !prof !14 {
+define i1 @length16_eq_const(i8* %X) nounwind !prof !15 {
 ; X86-NOSSE-LABEL: length16_eq_const:
 ; X86-NOSSE:       # %bb.0:
 ; X86-NOSSE-NEXT:    pushl $0
@@ -619,7 +619,7 @@
 
 ; PR33914 - https://bugs.llvm.org/show_bug.cgi?id=33914
 
-define i32 @length24(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length24(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length24:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -638,7 +638,7 @@
   ret i32 %m
 }
 
-define i1 @length24_eq(i8* %x, i8* %y) nounwind !prof !14 {
+define i1 @length24_eq(i8* %x, i8* %y) nounwind !prof !15 {
 ; X86-NOSSE-LABEL: length24_eq:
 ; X86-NOSSE:       # %bb.0:
 ; X86-NOSSE-NEXT:    pushl $0
@@ -697,7 +697,7 @@
   ret i1 %cmp
 }
 
-define i1 @length24_eq_const(i8* %X) nounwind !prof !14 {
+define i1 @length24_eq_const(i8* %X) nounwind !prof !15 {
 ; X86-NOSSE-LABEL: length24_eq_const:
 ; X86-NOSSE:       # %bb.0:
 ; X86-NOSSE-NEXT:    pushl $0
@@ -750,7 +750,7 @@
   ret i1 %c
 }
 
-define i32 @length32(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length32(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length32:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -771,7 +771,7 @@
 
 ; PR33325 - https://bugs.llvm.org/show_bug.cgi?id=33325
 
-define i1 @length32_eq(i8* %x, i8* %y) nounwind !prof !14 {
+define i1 @length32_eq(i8* %x, i8* %y) nounwind !prof !15 {
 ; X86-NOSSE-LABEL: length32_eq:
 ; X86-NOSSE:       # %bb.0:
 ; X86-NOSSE-NEXT:    pushl $0
@@ -836,7 +836,7 @@
   ret i1 %cmp
 }
 
-define i1 @length32_eq_const(i8* %X) nounwind !prof !14 {
+define i1 @length32_eq_const(i8* %X) nounwind !prof !15 {
 ; X86-NOSSE-LABEL: length32_eq_const:
 ; X86-NOSSE:       # %bb.0:
 ; X86-NOSSE-NEXT:    pushl $0
@@ -896,7 +896,7 @@
   ret i1 %c
 }
 
-define i32 @length64(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @length64(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: length64:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -915,7 +915,7 @@
   ret i32 %m
 }
 
-define i1 @length64_eq(i8* %x, i8* %y) nounwind !prof !14 {
+define i1 @length64_eq(i8* %x, i8* %y) nounwind !prof !15 {
 ; X86-LABEL: length64_eq:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -966,7 +966,7 @@
   ret i1 %cmp
 }
 
-define i1 @length64_eq_const(i8* %X) nounwind !prof !14 {
+define i1 @length64_eq_const(i8* %X) nounwind !prof !15 {
 ; X86-LABEL: length64_eq_const:
 ; X86:       # %bb.0:
 ; X86-NEXT:    pushl $0
@@ -1018,7 +1018,7 @@
   ret i1 %c
 }
 
-define i32 @bcmp_length2(i8* %X, i8* %Y) nounwind !prof !14 {
+define i32 @bcmp_length2(i8* %X, i8* %Y) nounwind !prof !15 {
 ; X86-LABEL: bcmp_length2:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -1048,7 +1048,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -1056,9 +1056,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/memcpy.ll
===================================================================
--- llvm/test/CodeGen/X86/memcpy.ll
+++ llvm/test/CodeGen/X86/memcpy.ll
@@ -139,7 +139,7 @@
   ret void
 }
 
-define void @test3_pgso(i8* nocapture %A, i8* nocapture %B) nounwind noredzone !prof !14 {
+define void @test3_pgso(i8* nocapture %A, i8* nocapture %B) nounwind noredzone !prof !15 {
 ; LINUX-LABEL: test3_pgso:
 ; LINUX:       # %bb.0: # %entry
 ; LINUX-NEXT:    movl $64, %edx
@@ -539,7 +539,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -547,9 +547,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/powi.ll
===================================================================
--- llvm/test/CodeGen/X86/powi.ll
+++ llvm/test/CodeGen/X86/powi.ll
@@ -86,7 +86,7 @@
   ret double %ret
 }
 
-define double @pow_wrapper_pgso(double %a) !prof !14 {
+define double @pow_wrapper_pgso(double %a) !prof !15 {
 ; X86-X87-LABEL: pow_wrapper_pgso:
 ; X86-X87:       # %bb.0:
 ; X86-X87-NEXT:    subl $12, %esp
@@ -159,7 +159,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -167,9 +167,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/rounding-ops.ll
===================================================================
--- llvm/test/CodeGen/X86/rounding-ops.ll
+++ llvm/test/CodeGen/X86/rounding-ops.ll
@@ -253,7 +253,7 @@
   ret double %call
 }
 
-define float @test11_pgso(float* %xptr) nounwind !prof !14 {
+define float @test11_pgso(float* %xptr) nounwind !prof !15 {
 ; CHECK-SSE-LABEL: test11_pgso:
 ; CHECK-SSE:       ## %bb.0:
 ; CHECK-SSE-NEXT:    roundss $11, (%rdi), %xmm0
@@ -273,7 +273,7 @@
   ret float %call
 }
 
-define double @test12_pgso(double* %xptr) nounwind !prof !14 {
+define double @test12_pgso(double* %xptr) nounwind !prof !15 {
 ; CHECK-SSE-LABEL: test12_pgso:
 ; CHECK-SSE:       ## %bb.0:
 ; CHECK-SSE-NEXT:    roundsd $11, (%rdi), %xmm0
@@ -295,7 +295,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -303,9 +303,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/shrink-compare-pgso.ll
===================================================================
--- llvm/test/CodeGen/X86/shrink-compare-pgso.ll
+++ llvm/test/CodeGen/X86/shrink-compare-pgso.ll
@@ -3,7 +3,7 @@
 
 declare void @bar()
 
-define void @test1(i32* nocapture %X) nounwind !prof !14 {
+define void @test1(i32* nocapture %X) nounwind !prof !15 {
 ; CHECK-LABEL: test1:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $47, (%rdi)
@@ -24,7 +24,7 @@
   ret void
 }
 
-define void @test2(i32 %X) nounwind !prof !14 {
+define void @test2(i32 %X) nounwind !prof !15 {
 ; CHECK-LABEL: test2:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $47, %dil
@@ -44,7 +44,7 @@
   ret void
 }
 
-define void @test3(i32 %X) nounwind !prof !14 {
+define void @test3(i32 %X) nounwind !prof !15 {
 ; CHECK-LABEL: test3:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $-1, %dil
@@ -95,7 +95,7 @@
 @x = global { i8, i8, i8, i8, i8, i8, i8, i8 } { i8 1, i8 0, i8 0, i8 0, i8 1, i8 0, i8 0, i8 1 }, align 4
 
 ; PR16551
-define void @test5(i32 %X) nounwind !prof !14 {
+define void @test5(i32 %X) nounwind !prof !15 {
 ; CHECK-LABEL: test5:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    movzbl x+{{.*}}(%rip), %eax
@@ -121,7 +121,7 @@
   ret void
 }
 
-define void @test2_1(i32 %X) nounwind !prof !14 {
+define void @test2_1(i32 %X) nounwind !prof !15 {
 ; CHECK-LABEL: test2_1:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    movzbl %dil, %eax
@@ -142,7 +142,7 @@
   ret void
 }
 
-define void @test_sext_i8_icmp_1(i8 %x) nounwind !prof !14 {
+define void @test_sext_i8_icmp_1(i8 %x) nounwind !prof !15 {
 ; CHECK-LABEL: test_sext_i8_icmp_1:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $1, %dil
@@ -162,7 +162,7 @@
   ret void
 }
 
-define void @test_sext_i8_icmp_47(i8 %x) nounwind !prof !14 {
+define void @test_sext_i8_icmp_47(i8 %x) nounwind !prof !15 {
 ; CHECK-LABEL: test_sext_i8_icmp_47:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $47, %dil
@@ -182,7 +182,7 @@
   ret void
 }
 
-define void @test_sext_i8_icmp_127(i8 %x) nounwind !prof !14 {
+define void @test_sext_i8_icmp_127(i8 %x) nounwind !prof !15 {
 ; CHECK-LABEL: test_sext_i8_icmp_127:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $127, %dil
@@ -202,7 +202,7 @@
   ret void
 }
 
-define void @test_sext_i8_icmp_neg1(i8 %x) nounwind !prof !14 {
+define void @test_sext_i8_icmp_neg1(i8 %x) nounwind !prof !15 {
 ; CHECK-LABEL: test_sext_i8_icmp_neg1:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $-1, %dil
@@ -222,7 +222,7 @@
   ret void
 }
 
-define void @test_sext_i8_icmp_neg2(i8 %x) nounwind !prof !14 {
+define void @test_sext_i8_icmp_neg2(i8 %x) nounwind !prof !15 {
 ; CHECK-LABEL: test_sext_i8_icmp_neg2:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $-2, %dil
@@ -242,7 +242,7 @@
   ret void
 }
 
-define void @test_sext_i8_icmp_neg127(i8 %x) nounwind !prof !14 {
+define void @test_sext_i8_icmp_neg127(i8 %x) nounwind !prof !15 {
 ; CHECK-LABEL: test_sext_i8_icmp_neg127:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $-127, %dil
@@ -262,7 +262,7 @@
   ret void
 }
 
-define void @test_sext_i8_icmp_neg128(i8 %x) nounwind !prof !14 {
+define void @test_sext_i8_icmp_neg128(i8 %x) nounwind !prof !15 {
 ; CHECK-LABEL: test_sext_i8_icmp_neg128:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    cmpb $-128, %dil
@@ -282,7 +282,7 @@
   ret void
 }
 
-define void @test_sext_i8_icmp_255(i8 %x) nounwind !prof !14 {
+define void @test_sext_i8_icmp_255(i8 %x) nounwind !prof !15 {
 ; CHECK-LABEL: test_sext_i8_icmp_255:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    movb $1, %al
@@ -305,7 +305,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -313,9 +313,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/slow-incdec.ll
===================================================================
--- llvm/test/CodeGen/X86/slow-incdec.ll
+++ llvm/test/CodeGen/X86/slow-incdec.ll
@@ -54,7 +54,7 @@
   ret i32 %r
 }
 
-define i32 @inc_pgso(i32 %x) !prof !14 {
+define i32 @inc_pgso(i32 %x) !prof !15 {
 ; CHECK-LABEL: inc_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -64,7 +64,7 @@
   ret i32 %r
 }
 
-define i32 @dec_pgso(i32 %x) !prof !14 {
+define i32 @dec_pgso(i32 %x) !prof !15 {
 ; CHECK-LABEL: dec_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -174,7 +174,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -182,9 +182,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/splat-for-size.ll
===================================================================
--- llvm/test/CodeGen/X86/splat-for-size.ll
+++ llvm/test/CodeGen/X86/splat-for-size.ll
@@ -17,7 +17,7 @@
   ret <2 x double> %add
 }
 
-define <2 x double> @splat_v2f64_pgso(<2 x double> %x) !prof !14 {
+define <2 x double> @splat_v2f64_pgso(<2 x double> %x) !prof !15 {
 ; CHECK-LABEL: splat_v2f64_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    vmovddup {{.*#+}} xmm1 = [1.0E+0,1.0E+0]
@@ -38,7 +38,7 @@
   ret <4 x double> %add
 }
 
-define <4 x double> @splat_v4f64_pgso(<4 x double> %x) !prof !14 {
+define <4 x double> @splat_v4f64_pgso(<4 x double> %x) !prof !15 {
 ; CHECK-LABEL: splat_v4f64_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    vbroadcastsd {{.*#+}} ymm1 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0]
@@ -58,7 +58,7 @@
   ret <4 x float> %add
 }
 
-define <4 x float> @splat_v4f32_pgso(<4 x float> %x) !prof !14 {
+define <4 x float> @splat_v4f32_pgso(<4 x float> %x) !prof !15 {
 ; CHECK-LABEL: splat_v4f32_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    vbroadcastss {{.*#+}} xmm1 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0]
@@ -78,7 +78,7 @@
   ret <8 x float> %add
 }
 
-define <8 x float> @splat_v8f32_pgso(<8 x float> %x) !prof !14 {
+define <8 x float> @splat_v8f32_pgso(<8 x float> %x) !prof !15 {
 ; CHECK-LABEL: splat_v8f32_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    vbroadcastss {{.*#+}} ymm1 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0]
@@ -107,7 +107,7 @@
   ret <2 x i64> %add
 }
 
-define <2 x i64> @splat_v2i64_pgso(<2 x i64> %x) !prof !14 {
+define <2 x i64> @splat_v2i64_pgso(<2 x i64> %x) !prof !15 {
 ; AVX-LABEL: splat_v2i64_pgso:
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovddup {{.*#+}} xmm1 = [2,2]
@@ -146,7 +146,7 @@
   ret <4 x i64> %add
 }
 
-define <4 x i64> @splat_v4i64_pgso(<4 x i64> %x) !prof !14 {
+define <4 x i64> @splat_v4i64_pgso(<4 x i64> %x) !prof !15 {
 ; AVX-LABEL: splat_v4i64_pgso:
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm1
@@ -183,7 +183,7 @@
   ret <4 x i32> %add
 }
 
-define <4 x i32> @splat_v4i32_pgso(<4 x i32> %x) !prof !14 {
+define <4 x i32> @splat_v4i32_pgso(<4 x i32> %x) !prof !15 {
 ; AVX-LABEL: splat_v4i32_pgso:
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vbroadcastss {{.*#+}} xmm1 = [2,2,2,2]
@@ -219,7 +219,7 @@
   ret <8 x i32> %add
 }
 
-define <8 x i32> @splat_v8i32_pgso(<8 x i32> %x) !prof !14 {
+define <8 x i32> @splat_v8i32_pgso(<8 x i32> %x) !prof !15 {
 ; AVX-LABEL: splat_v8i32_pgso:
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm1
@@ -254,7 +254,7 @@
   ret <8 x i16> %add
 }
 
-define <8 x i16> @splat_v8i16_pgso(<8 x i16> %x) !prof !14 {
+define <8 x i16> @splat_v8i16_pgso(<8 x i16> %x) !prof !15 {
 ; AVX-LABEL: splat_v8i16_pgso:
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vpaddw {{.*}}(%rip), %xmm0, %xmm0
@@ -289,7 +289,7 @@
   ret <16 x i16> %add
 }
 
-define <16 x i16> @splat_v16i16_pgso(<16 x i16> %x) !prof !14 {
+define <16 x i16> @splat_v16i16_pgso(<16 x i16> %x) !prof !15 {
 ; AVX-LABEL: splat_v16i16_pgso:
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm1
@@ -324,7 +324,7 @@
   ret <16 x i8> %add
 }
 
-define <16 x i8> @splat_v16i8_pgso(<16 x i8> %x) !prof !14 {
+define <16 x i8> @splat_v16i8_pgso(<16 x i8> %x) !prof !15 {
 ; AVX-LABEL: splat_v16i8_pgso:
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vpaddb {{.*}}(%rip), %xmm0, %xmm0
@@ -359,7 +359,7 @@
   ret <32 x i8> %add
 }
 
-define <32 x i8> @splat_v32i8_pgso(<32 x i8> %x) !prof !14 {
+define <32 x i8> @splat_v32i8_pgso(<32 x i8> %x) !prof !15 {
 ; AVX-LABEL: splat_v32i8_pgso:
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm1
@@ -422,7 +422,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -430,9 +430,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/store-zero-and-minus-one.ll
===================================================================
--- llvm/test/CodeGen/X86/store-zero-and-minus-one.ll
+++ llvm/test/CodeGen/X86/store-zero-and-minus-one.ll
@@ -19,7 +19,7 @@
 
 }
 
-define void @zero_pgso(i32* %p) !prof !14 {
+define void @zero_pgso(i32* %p) !prof !15 {
 ; CHECK32-LABEL: zero_pgso:
 ; CHECK32:       # %bb.0: # %entry
 ; CHECK32-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -53,7 +53,7 @@
 
 }
 
-define void @minus_one_pgso(i32* %p) !prof !14 {
+define void @minus_one_pgso(i32* %p) !prof !15 {
 ; CHECK32-LABEL: minus_one_pgso:
 ; CHECK32:       # %bb.0: # %entry
 ; CHECK32-NEXT:    movl {{[0-9]+}}(%esp), %eax
@@ -280,7 +280,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -288,9 +288,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/switch-density.ll
===================================================================
--- llvm/test/CodeGen/X86/switch-density.ll
+++ llvm/test/CodeGen/X86/switch-density.ll
@@ -106,7 +106,7 @@
 ; CHECK: retq
 }
 
-define void @dense_pgso(i32 %x) !prof !14 {
+define void @dense_pgso(i32 %x) !prof !15 {
 entry:
   switch i32 %x, label %return [
     i32 12, label %bb0
@@ -134,7 +134,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -142,9 +142,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/tail-opts.ll
===================================================================
--- llvm/test/CodeGen/X86/tail-opts.ll
+++ llvm/test/CodeGen/X86/tail-opts.ll
@@ -473,7 +473,7 @@
   ret void
 }
 
-define void @one_pgso(i32 %v) nounwind !prof !14 {
+define void @one_pgso(i32 %v) nounwind !prof !15 {
 ; CHECK-LABEL: one_pgso:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    testl %edi, %edi
@@ -559,7 +559,7 @@
   ret void
 }
 
-define void @two_pgso() nounwind !prof !14 {
+define void @two_pgso() nounwind !prof !15 {
 ; CHECK-LABEL: two_pgso:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    xorl %eax, %eax
@@ -914,7 +914,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -922,9 +922,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/test-vs-bittest.ll
===================================================================
--- llvm/test/CodeGen/X86/test-vs-bittest.ll
+++ llvm/test/CodeGen/X86/test-vs-bittest.ll
@@ -49,7 +49,7 @@
   ret void
 }
 
-define void @test64_pgso(i64 inreg %x) !prof !14 {
+define void @test64_pgso(i64 inreg %x) !prof !15 {
 ; CHECK-LABEL: test64_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushq %rax
@@ -126,7 +126,7 @@
   ret void
 }
 
-define void @test64_pgso_2(i64 inreg %x) !prof !14 {
+define void @test64_pgso_2(i64 inreg %x) !prof !15 {
 ; CHECK-LABEL: test64_pgso_2:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushq %rax
@@ -198,7 +198,7 @@
   ret void
 }
 
-define void @test64_pgso_3(i64 inreg %x) !prof !14 {
+define void @test64_pgso_3(i64 inreg %x) !prof !15 {
 ; CHECK-LABEL: test64_pgso_3:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushq %rax
@@ -270,7 +270,7 @@
   ret void
 }
 
-define void @test64_pgso_4(i64 inreg %x) !prof !14 {
+define void @test64_pgso_4(i64 inreg %x) !prof !15 {
 ; CHECK-LABEL: test64_pgso_4:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushq %rax
@@ -390,7 +390,7 @@
   ret void
 }
 
-define void @test32_pgso_2(i32 inreg %x) !prof !14 {
+define void @test32_pgso_2(i32 inreg %x) !prof !15 {
 ; CHECK-LABEL: test32_pgso_2:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushq %rax
@@ -462,7 +462,7 @@
   ret void
 }
 
-define void @test16_pgso(i16 inreg %x) !prof !14 {
+define void @test16_pgso(i16 inreg %x) !prof !15 {
 ; CHECK-LABEL: test16_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushq %rax
@@ -534,7 +534,7 @@
   ret void
 }
 
-define void @test16_pgso_2(i16 inreg %x) !prof !14 {
+define void @test16_pgso_2(i16 inreg %x) !prof !15 {
 ; CHECK-LABEL: test16_pgso_2:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushq %rax
@@ -683,7 +683,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -691,9 +691,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/vector-shuffle-256-v4.ll
===================================================================
--- llvm/test/CodeGen/X86/vector-shuffle-256-v4.ll
+++ llvm/test/CodeGen/X86/vector-shuffle-256-v4.ll
@@ -1925,7 +1925,7 @@
   ret <8 x i32> %b
 }
 
-define <4 x double> @shuffle_v4f64_0zzz_pgso(<4 x double> %a) !prof !14 {
+define <4 x double> @shuffle_v4f64_0zzz_pgso(<4 x double> %a) !prof !15 {
 ; ALL-LABEL: shuffle_v4f64_0zzz_pgso:
 ; ALL:       # %bb.0:
 ; ALL-NEXT:    vmovq {{.*#+}} xmm0 = xmm0[0],zero
@@ -1934,7 +1934,7 @@
   ret <4 x double> %b
 }
 
-define <4 x i64> @shuffle_v4i64_0zzz_pgso(<4 x i64> %a) !prof !14 {
+define <4 x i64> @shuffle_v4i64_0zzz_pgso(<4 x i64> %a) !prof !15 {
 ; ALL-LABEL: shuffle_v4i64_0zzz_pgso:
 ; ALL:       # %bb.0:
 ; ALL-NEXT:    vmovq {{.*#+}} xmm0 = xmm0[0],zero
@@ -1943,7 +1943,7 @@
   ret <4 x i64> %b
 }
 
-define <8 x float> @shuffle_v8f32_0zzzzzzz_pgso(<8 x float> %a) !prof !14 {
+define <8 x float> @shuffle_v8f32_0zzzzzzz_pgso(<8 x float> %a) !prof !15 {
 ; AVX1OR2-LABEL: shuffle_v8f32_0zzzzzzz_pgso:
 ; AVX1OR2:       # %bb.0:
 ; AVX1OR2-NEXT:    vxorps %xmm1, %xmm1, %xmm1
@@ -1959,7 +1959,7 @@
   ret <8 x float> %b
 }
 
-define <8 x i32> @shuffle_v8i32_0zzzzzzz_pgso(<8 x i32> %a) !prof !14 {
+define <8 x i32> @shuffle_v8i32_0zzzzzzz_pgso(<8 x i32> %a) !prof !15 {
 ; AVX1OR2-LABEL: shuffle_v8i32_0zzzzzzz_pgso:
 ; AVX1OR2:       # %bb.0:
 ; AVX1OR2-NEXT:    vxorps %xmm1, %xmm1, %xmm1
@@ -1997,7 +1997,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -2005,9 +2005,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/x86-64-bittest-logic.ll
===================================================================
--- llvm/test/CodeGen/X86/x86-64-bittest-logic.ll
+++ llvm/test/CodeGen/X86/x86-64-bittest-logic.ll
@@ -241,7 +241,7 @@
   ret i64 %a
 }
 
-define i64 @and1_pgso(i64 %x) !prof !14 {
+define i64 @and1_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: and1_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -251,7 +251,7 @@
   ret i64 %a
 }
 
-define i64 @and2_pgso(i64 %x) !prof !14 {
+define i64 @and2_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: and2_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -261,7 +261,7 @@
   ret i64 %a
 }
 
-define i64 @and3_pgso(i64 %x) !prof !14 {
+define i64 @and3_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: and3_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -271,7 +271,7 @@
   ret i64 %a
 }
 
-define i64 @and4_pgso(i64 %x) !prof !14 {
+define i64 @and4_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: and4_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -281,7 +281,7 @@
   ret i64 %a
 }
 
-define i64 @or1_pgso(i64 %x) !prof !14 {
+define i64 @or1_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: or1_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -291,7 +291,7 @@
   ret i64 %a
 }
 
-define i64 @or2_pgso(i64 %x) !prof !14 {
+define i64 @or2_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: or2_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -301,7 +301,7 @@
   ret i64 %a
 }
 
-define i64 @or3_pgso(i64 %x) !prof !14 {
+define i64 @or3_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: or3_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -311,7 +311,7 @@
   ret i64 %a
 }
 
-define i64 @or4_pgso(i64 %x) !prof !14 {
+define i64 @or4_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: or4_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -321,7 +321,7 @@
   ret i64 %a
 }
 
-define i64 @xor1_pgso(i64 %x) !prof !14 {
+define i64 @xor1_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: xor1_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -331,7 +331,7 @@
   ret i64 %a
 }
 
-define i64 @xor2_pgso(i64 %x) !prof !14 {
+define i64 @xor2_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: xor2_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -341,7 +341,7 @@
   ret i64 %a
 }
 
-define i64 @xor3_pgso(i64 %x) !prof !14 {
+define i64 @xor3_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: xor3_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -351,7 +351,7 @@
   ret i64 %a
 }
 
-define i64 @xor4_pgso(i64 %x) !prof !14 {
+define i64 @xor4_pgso(i64 %x) !prof !15 {
 ; CHECK-LABEL: xor4_pgso:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -363,7 +363,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -371,9 +371,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll
===================================================================
--- llvm/test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll
+++ llvm/test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll
@@ -50,7 +50,7 @@
   ret i64 %or
 }
 
-define i64 @_Z8lshift11mm_pgso(i64 %a, i64 %b) !prof !14 {
+define i64 @_Z8lshift11mm_pgso(i64 %a, i64 %b) !prof !15 {
 ; CHECK-LABEL: _Z8lshift11mm_pgso:
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    movq %rdi, %rax
@@ -93,7 +93,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -101,9 +101,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/CodeGen/X86/x86-repmov-copy-eflags.ll
===================================================================
--- llvm/test/CodeGen/X86/x86-repmov-copy-eflags.ll
+++ llvm/test/CodeGen/X86/x86-repmov-copy-eflags.ll
@@ -25,7 +25,7 @@
   ret void
 }
 
-define void @f_pgso(i8* %p, i8* %q, i32* inalloca nocapture %unused) !prof !14 {
+define void @f_pgso(i8* %p, i8* %q, i32* inalloca nocapture %unused) !prof !15 {
 entry:
   %g = alloca %struct.T, align 8
   %r = alloca i32, align 8
@@ -87,7 +87,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -95,9 +95,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
===================================================================
--- llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
+++ llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
@@ -256,7 +256,7 @@
 !llvm.module.flags = !{!0}
 
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 0}
 !4 = !{!"MaxCount", i64 0}
@@ -264,21 +264,22 @@
 !6 = !{!"MaxFunctionCount", i64 0}
 !7 = !{!"NumCounts", i64 0}
 !8 = !{!"NumFunctions", i64 0}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26}
-!11 = !{i32 10000, i64 0, i32 0}
-!12 = !{i32 100000, i64 0, i32 0}
-!13 = !{i32 200000, i64 0, i32 0}
-!14 = !{i32 300000, i64 0, i32 0}
-!15 = !{i32 400000, i64 0, i32 0}
-!16 = !{i32 500000, i64 0, i32 0}
-!17 = !{i32 600000, i64 0, i32 0}
-!18 = !{i32 700000, i64 0, i32 0}
-!19 = !{i32 800000, i64 0, i32 0}
-!20 = !{i32 900000, i64 0, i32 0}
-!21 = !{i32 950000, i64 0, i32 0}
-!22 = !{i32 990000, i64 0, i32 0}
-!23 = !{i32 999000, i64 0, i32 0}
-!24 = !{i32 999900, i64 0, i32 0}
-!25 = !{i32 999990, i64 0, i32 0}
-!26 = !{i32 999999, i64 0, i32 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
+!12 = !{i32 10000, i64 0, i32 0}
+!13 = !{i32 100000, i64 0, i32 0}
+!14 = !{i32 200000, i64 0, i32 0}
+!15 = !{i32 300000, i64 0, i32 0}
+!16 = !{i32 400000, i64 0, i32 0}
+!17 = !{i32 500000, i64 0, i32 0}
+!18 = !{i32 600000, i64 0, i32 0}
+!19 = !{i32 700000, i64 0, i32 0}
+!20 = !{i32 800000, i64 0, i32 0}
+!21 = !{i32 900000, i64 0, i32 0}
+!22 = !{i32 950000, i64 0, i32 0}
+!23 = !{i32 990000, i64 0, i32 0}
+!24 = !{i32 999000, i64 0, i32 0}
+!25 = !{i32 999900, i64 0, i32 0}
+!26 = !{i32 999990, i64 0, i32 0}
+!27 = !{i32 999999, i64 0, i32 0}
Index: llvm/test/Transforms/CodeExtractor/PartialInlineORECrash.ll
===================================================================
--- llvm/test/Transforms/CodeExtractor/PartialInlineORECrash.ll
+++ llvm/test/Transforms/CodeExtractor/PartialInlineORECrash.ll
@@ -57,7 +57,7 @@
 ; Function Attrs: argmemonly nounwind
 declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1) #0
 
-define void @_ZN23btDiscreteDynamicsWorld28internalSingleStepSimulationEf(%6*, float) unnamed_addr align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !prof !27 {
+define void @_ZN23btDiscreteDynamicsWorld28internalSingleStepSimulationEf(%6*, float) unnamed_addr align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !prof !28 {
   invoke void null(%6* nonnull %0, float %1)
           to label %5 unwind label %3
 
@@ -105,12 +105,12 @@
   resume { i8*, i32 } zeroinitializer
 }
 
-define void @_ZN23btDiscreteDynamicsWorld21updateActivationStateEf(%6* nocapture readonly, float) local_unnamed_addr align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !prof !27 {
+define void @_ZN23btDiscreteDynamicsWorld21updateActivationStateEf(%6* nocapture readonly, float) local_unnamed_addr align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !prof !28 {
   %3 = icmp sgt i32 0, 0
-  br i1 %3, label %4, label %5, !prof !29
+  br i1 %3, label %4, label %5, !prof !30
 
 ; <label>:4:                                      ; preds = %2
-  br i1 false, label %5, label %6, !prof !30
+  br i1 false, label %5, label %6, !prof !31
 
 ; <label>:5:                                      ; preds = %7, %4, %2
   ret void
@@ -138,7 +138,7 @@
 !llvm.module.flags = !{!0}
 
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 6540578580}
 !4 = !{!"MaxCount", i64 629805108}
@@ -146,25 +146,26 @@
 !6 = !{!"MaxFunctionCount", i64 629805108}
 !7 = !{!"NumCounts", i64 8554}
 !8 = !{!"NumFunctions", i64 3836}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13, !14, !15, !16, !16, !17, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26}
-!11 = !{i32 10000, i64 629805108, i32 1}
-!12 = !{i32 100000, i64 366853677, i32 2}
-!13 = !{i32 200000, i64 196816893, i32 4}
-!14 = !{i32 300000, i64 192575561, i32 7}
-!15 = !{i32 400000, i64 130688163, i32 11}
-!16 = !{i32 500000, i64 74857169, i32 19}
-!17 = !{i32 600000, i64 48184151, i32 30}
-!18 = !{i32 700000, i64 21298588, i32 49}
-!19 = !{i32 800000, i64 10721033, i32 90}
-!20 = !{i32 900000, i64 3301634, i32 202}
-!21 = !{i32 950000, i64 1454952, i32 362}
-!22 = !{i32 990000, i64 343872, i32 675}
-!23 = !{i32 999000, i64 46009, i32 1112}
-!24 = !{i32 999900, i64 6067, i32 1435}
-!25 = !{i32 999990, i64 700, i32 1721}
-!26 = !{i32 999999, i64 72, i32 1955}
-!27 = !{!"function_entry_count", i64 700}
-!28 = !{!"branch_weights", i32 701, i32 1}
-!29 = !{!"branch_weights", i32 954001, i32 701}
-!30 = !{!"branch_weights", i32 1, i32 954001}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14, !15, !16, !17, !17, !18, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
+!12 = !{i32 10000, i64 629805108, i32 1}
+!13 = !{i32 100000, i64 366853677, i32 2}
+!14 = !{i32 200000, i64 196816893, i32 4}
+!15 = !{i32 300000, i64 192575561, i32 7}
+!16 = !{i32 400000, i64 130688163, i32 11}
+!17 = !{i32 500000, i64 74857169, i32 19}
+!18 = !{i32 600000, i64 48184151, i32 30}
+!19 = !{i32 700000, i64 21298588, i32 49}
+!20 = !{i32 800000, i64 10721033, i32 90}
+!21 = !{i32 900000, i64 3301634, i32 202}
+!22 = !{i32 950000, i64 1454952, i32 362}
+!23 = !{i32 990000, i64 343872, i32 675}
+!24 = !{i32 999000, i64 46009, i32 1112}
+!25 = !{i32 999900, i64 6067, i32 1435}
+!26 = !{i32 999990, i64 700, i32 1721}
+!27 = !{i32 999999, i64 72, i32 1955}
+!28 = !{!"function_entry_count", i64 700}
+!29 = !{!"branch_weights", i32 701, i32 1}
+!30 = !{!"branch_weights", i32 954001, i32 701}
+!31 = !{!"branch_weights", i32 1, i32 954001}
Index: llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll
===================================================================
--- llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll
+++ llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll
@@ -2,7 +2,7 @@
 ; RUN: opt -S -passes=partial-inliner -min-block-execution=1 -skip-partial-inlining-cost-analysis < %s | FileCheck %s
 ; Require a dummy block (if.then.b) as successor to if.then due to PI requirement
 ; of region containing more than one BB.
-define signext i32 @bar(i32 signext %value, i32 signext %ub) #0 !prof !30 {
+define signext i32 @bar(i32 signext %value, i32 signext %ub) #0 !prof !31 {
 entry:
   %value.addr = alloca i32, align 4
   %ub.addr = alloca i32, align 4
@@ -18,13 +18,13 @@
   %0 = load i32, i32* %i, align 4
   %1 = load i32, i32* %ub.addr, align 4
   %cmp = icmp slt i32 %0, %1
-  br i1 %cmp, label %for.body, label %for.cond2, !prof !31
+  br i1 %cmp, label %for.body, label %for.cond2, !prof !32
 
 for.body:                                         ; preds = %for.cond
   %2 = load i32, i32* %value.addr, align 4
   %rem = srem i32 %2, 20
   %cmp1 = icmp eq i32 %rem, 0
-  br i1 %cmp1, label %if.then, label %if.else, !prof !32
+  br i1 %cmp1, label %if.then, label %if.else, !prof !33
 
 if.then:                                          ; preds = %for.body
   %3 = load i32, i32* %value.addr, align 4
@@ -61,13 +61,13 @@
   %10 = load i32, i32* %i, align 4
   %11 = load i32, i32* %ub.addr, align 4
   %cmp2 = icmp slt i32 %10, %11
-  br i1 %cmp2, label %for.body2, label %for.end, !prof !31
+  br i1 %cmp2, label %for.body2, label %for.end, !prof !32
 
 for.body2:                                         ; preds = %for.cond2
   %12 = load i32, i32* %value.addr, align 4
   %rem2 = srem i32 %12, 20
   %cmp3 = icmp eq i32 %rem2, 0
-  br i1 %cmp3, label %if.then2, label %if.else2, !prof !32
+  br i1 %cmp3, label %if.then2, label %if.else2, !prof !33
 
 if.then2:                                          ; preds = %for.body2
   %13 = load i32, i32* %value.addr, align 4
@@ -105,7 +105,7 @@
   ret i32 %20
 }
 
-define signext i32 @foo(i32 signext %value, i32 signext %ub) #0 !prof !30 {
+define signext i32 @foo(i32 signext %value, i32 signext %ub) #0 !prof !31 {
 ; CHECK-LABEL: @foo
 ; CHECK-NOT: call signext i32 @bar
 ; CHECK: codeRepl1.i:
@@ -132,12 +132,12 @@
 ; CHECK: ret void
 
 !llvm.module.flags = !{!0, !1, !2}
-!llvm.ident = !{!29}
+!llvm.ident = !{!30}
 
 !0 = !{i32 1, !"wchar_size", i32 4}
 !1 = !{i32 7, !"PIC Level", i32 2}
 !2 = !{i32 1, !"ProfileSummary", !3}
-!3 = !{!4, !5, !6, !7, !8, !9, !10, !11}
+!3 = !{!4, !5, !6, !7, !8, !9, !10, !11, !12}
 !4 = !{!"ProfileFormat", !"InstrProf"}
 !5 = !{!"TotalCount", i64 103}
 !6 = !{!"MaxCount", i64 100}
@@ -145,25 +145,26 @@
 !8 = !{!"MaxFunctionCount", i64 100}
 !9 = !{!"NumCounts", i64 5}
 !10 = !{!"NumFunctions", i64 3}
-!11 = !{!"DetailedSummary", !12}
-!12 = !{!13, !14, !15, !16, !17, !18, !18, !19, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}
-!13 = !{i32 10000, i64 100, i32 1}
-!14 = !{i32 100000, i64 100, i32 1}
-!15 = !{i32 200000, i64 100, i32 1}
-!16 = !{i32 300000, i64 100, i32 1}
-!17 = !{i32 400000, i64 100, i32 1}
-!18 = !{i32 500000, i64 100, i32 1}
-!19 = !{i32 600000, i64 100, i32 1}
-!20 = !{i32 700000, i64 100, i32 1}
-!21 = !{i32 800000, i64 100, i32 1}
-!22 = !{i32 900000, i64 100, i32 1}
-!23 = !{i32 950000, i64 100, i32 1}
-!24 = !{i32 990000, i64 1, i32 4}
-!25 = !{i32 999000, i64 1, i32 4}
-!26 = !{i32 999900, i64 1, i32 4}
-!27 = !{i32 999990, i64 1, i32 4}
-!28 = !{i32 999999, i64 1, i32 4}
-!29 = !{!"clang version 6.0.0 (123456)"}
-!30 = !{!"function_entry_count", i64 2}
-!31 = !{!"branch_weights", i32 100, i32 1}
-!32 = !{!"branch_weights", i32 0, i32 100}
+!11 = !{!"IsPartialProfile", i64 0}
+!12 = !{!"DetailedSummary", !13}
+!13 = !{!14, !15, !16, !17, !18, !19, !19, !20, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29}
+!14 = !{i32 10000, i64 100, i32 1}
+!15 = !{i32 100000, i64 100, i32 1}
+!16 = !{i32 200000, i64 100, i32 1}
+!17 = !{i32 300000, i64 100, i32 1}
+!18 = !{i32 400000, i64 100, i32 1}
+!19 = !{i32 500000, i64 100, i32 1}
+!20 = !{i32 600000, i64 100, i32 1}
+!21 = !{i32 700000, i64 100, i32 1}
+!22 = !{i32 800000, i64 100, i32 1}
+!23 = !{i32 900000, i64 100, i32 1}
+!24 = !{i32 950000, i64 100, i32 1}
+!25 = !{i32 990000, i64 1, i32 4}
+!26 = !{i32 999000, i64 1, i32 4}
+!27 = !{i32 999900, i64 1, i32 4}
+!28 = !{i32 999990, i64 1, i32 4}
+!29 = !{i32 999999, i64 1, i32 4}
+!30 = !{!"clang version 6.0.0 (123456)"}
+!31 = !{!"function_entry_count", i64 2}
+!32 = !{!"branch_weights", i32 100, i32 1}
+!33 = !{!"branch_weights", i32 0, i32 100}
Index: llvm/test/Transforms/CodeExtractor/PartialInlinePGORegion.ll
===================================================================
--- llvm/test/Transforms/CodeExtractor/PartialInlinePGORegion.ll
+++ llvm/test/Transforms/CodeExtractor/PartialInlinePGORegion.ll
@@ -2,7 +2,7 @@
 ; RUN: opt -S -passes=partial-inliner -min-block-execution=1 -skip-partial-inlining-cost-analysis < %s | FileCheck %s
 ; Require a dummy block (if.then.b) as successor to if.then due to PI requirement
 ; of region containing more than one BB.
-define signext i32 @bar(i32 signext %value, i32 signext %ub) #0 !prof !30 {
+define signext i32 @bar(i32 signext %value, i32 signext %ub) #0 !prof !31 {
 entry:
   %value.addr = alloca i32, align 4
   %ub.addr = alloca i32, align 4
@@ -18,13 +18,13 @@
   %0 = load i32, i32* %i, align 4
   %1 = load i32, i32* %ub.addr, align 4
   %cmp = icmp slt i32 %0, %1
-  br i1 %cmp, label %for.body, label %for.end, !prof !31
+  br i1 %cmp, label %for.body, label %for.end, !prof !32
 
 for.body:                                         ; preds = %for.cond
   %2 = load i32, i32* %value.addr, align 4
   %rem = srem i32 %2, 20
   %cmp1 = icmp eq i32 %rem, 0
-  br i1 %cmp1, label %if.then, label %if.else, !prof !32
+  br i1 %cmp1, label %if.then, label %if.else, !prof !33
 
 if.then:                                          ; preds = %for.body
   %3 = load i32, i32* %value.addr, align 4
@@ -62,7 +62,7 @@
   ret i32 %10
 }
 
-define signext i32 @foo(i32 signext %value, i32 signext %ub) #0 !prof !30 {
+define signext i32 @foo(i32 signext %value, i32 signext %ub) #0 !prof !31 {
 ; CHECK-LABEL: @foo
 ; CHECK: codeRepl.i:
 ; CHECK-NOT: call signext i32 @bar
@@ -83,12 +83,12 @@
 ; CHECK: ret void
 
 !llvm.module.flags = !{!0, !1, !2}
-!llvm.ident = !{!29}
+!llvm.ident = !{!30}
 
 !0 = !{i32 1, !"wchar_size", i32 4}
 !1 = !{i32 7, !"PIC Level", i32 2}
 !2 = !{i32 1, !"ProfileSummary", !3}
-!3 = !{!4, !5, !6, !7, !8, !9, !10, !11}
+!3 = !{!4, !5, !6, !7, !8, !9, !10, !11, !12}
 !4 = !{!"ProfileFormat", !"InstrProf"}
 !5 = !{!"TotalCount", i64 103}
 !6 = !{!"MaxCount", i64 100}
@@ -96,25 +96,26 @@
 !8 = !{!"MaxFunctionCount", i64 100}
 !9 = !{!"NumCounts", i64 5}
 !10 = !{!"NumFunctions", i64 3}
-!11 = !{!"DetailedSummary", !12}
-!12 = !{!13, !14, !15, !16, !17, !18, !18, !19, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}
-!13 = !{i32 10000, i64 100, i32 1}
-!14 = !{i32 100000, i64 100, i32 1}
-!15 = !{i32 200000, i64 100, i32 1}
-!16 = !{i32 300000, i64 100, i32 1}
-!17 = !{i32 400000, i64 100, i32 1}
-!18 = !{i32 500000, i64 100, i32 1}
-!19 = !{i32 600000, i64 100, i32 1}
-!20 = !{i32 700000, i64 100, i32 1}
-!21 = !{i32 800000, i64 100, i32 1}
-!22 = !{i32 900000, i64 100, i32 1}
-!23 = !{i32 950000, i64 100, i32 1}
-!24 = !{i32 990000, i64 1, i32 4}
-!25 = !{i32 999000, i64 1, i32 4}
-!26 = !{i32 999900, i64 1, i32 4}
-!27 = !{i32 999990, i64 1, i32 4}
-!28 = !{i32 999999, i64 1, i32 4}
-!29 = !{!"clang version 6.0.0 (123456)"}
-!30 = !{!"function_entry_count", i64 2}
-!31 = !{!"branch_weights", i32 100, i32 1}
-!32 = !{!"branch_weights", i32 0, i32 100}
+!11 = !{!"IsPartialProfile", i64 0}
+!12 = !{!"DetailedSummary", !13}
+!13 = !{!14, !15, !16, !17, !18, !19, !19, !20, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29}
+!14 = !{i32 10000, i64 100, i32 1}
+!15 = !{i32 100000, i64 100, i32 1}
+!16 = !{i32 200000, i64 100, i32 1}
+!17 = !{i32 300000, i64 100, i32 1}
+!18 = !{i32 400000, i64 100, i32 1}
+!19 = !{i32 500000, i64 100, i32 1}
+!20 = !{i32 600000, i64 100, i32 1}
+!21 = !{i32 700000, i64 100, i32 1}
+!22 = !{i32 800000, i64 100, i32 1}
+!23 = !{i32 900000, i64 100, i32 1}
+!24 = !{i32 950000, i64 100, i32 1}
+!25 = !{i32 990000, i64 1, i32 4}
+!26 = !{i32 999000, i64 1, i32 4}
+!27 = !{i32 999900, i64 1, i32 4}
+!28 = !{i32 999990, i64 1, i32 4}
+!29 = !{i32 999999, i64 1, i32 4}
+!30 = !{!"clang version 6.0.0 (123456)"}
+!31 = !{!"function_entry_count", i64 2}
+!32 = !{!"branch_weights", i32 100, i32 1}
+!33 = !{!"branch_weights", i32 0, i32 100}
Index: llvm/test/Transforms/CodeGenPrepare/X86/section-samplepgo.ll
===================================================================
--- llvm/test/Transforms/CodeGenPrepare/X86/section-samplepgo.ll
+++ llvm/test/Transforms/CodeGenPrepare/X86/section-samplepgo.ll
@@ -6,31 +6,31 @@
 
 ; CHECK: hot_func{{.*}}!section_prefix ![[HOT_ID:[0-9]+]]
 ; The entry is hot
-define void @hot_func() !prof !15 {
+define void @hot_func() !prof !16 {
   ret void
 }
 
 ; CHECK: hot_call_func{{.*}}!section_prefix ![[HOT_ID]]
 ; The sum of 2 callsites are hot
-define void @hot_call_func() !prof !16 {
-  call void @hot_func(), !prof !17
-  call void @hot_func(), !prof !17
+define void @hot_call_func() !prof !17 {
+  call void @hot_func(), !prof !18
+  call void @hot_func(), !prof !18
   ret void
 }
 
 ; CHECK-NOT: normal_func{{.*}}!section_prefix
 ; The sum of all callsites are neither hot or cold
-define void @normal_func() !prof !16 {
-  call void @hot_func(), !prof !17
-  call void @hot_func(), !prof !18
+define void @normal_func() !prof !17 {
   call void @hot_func(), !prof !18
+  call void @hot_func(), !prof !19
+  call void @hot_func(), !prof !19
   ret void
 }
 
 ; CHECK: cold_func{{.*}}!section_prefix ![[COLD_ID:[0-9]+]]
 ; The entry and the callsite are both cold
-define void @cold_func() !prof !16 {
-  call void @hot_func(), !prof !18
+define void @cold_func() !prof !17 {
+  call void @hot_func(), !prof !19
   ret void
 }
 
@@ -38,7 +38,7 @@
 ; CHECK: ![[COLD_ID]] = !{!"function_section_prefix", !".unlikely"}
 !llvm.module.flags = !{!1}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"SampleProfile"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -46,12 +46,13 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
-!15 = !{!"function_entry_count", i64 1000}
-!16 = !{!"function_entry_count", i64 1}
-!17 = !{!"branch_weights", i32 80}
-!18 = !{!"branch_weights", i32 1}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
+!16 = !{!"function_entry_count", i64 1000}
+!17 = !{!"function_entry_count", i64 1}
+!18 = !{!"branch_weights", i32 80}
+!19 = !{!"branch_weights", i32 1}
Index: llvm/test/Transforms/CodeGenPrepare/X86/section.ll
===================================================================
--- llvm/test/Transforms/CodeGenPrepare/X86/section.ll
+++ llvm/test/Transforms/CodeGenPrepare/X86/section.ll
@@ -6,13 +6,13 @@
 
 ; CHECK: hot_func1{{.*}}!section_prefix ![[HOT_ID:[0-9]+]]
 ; The entry is hot
-define void @hot_func1() !prof !15 {
+define void @hot_func1() !prof !16 {
   ret void
 }
 
 ; CHECK: hot_func2{{.*}}!section_prefix ![[HOT_ID:[0-9]+]]
 ; Entry is cold but inner block is hot
-define void @hot_func2(i32 %n) !prof !16 {
+define void @hot_func2(i32 %n) !prof !17 {
 entry:
   %n.addr = alloca i32, align 4
   %i = alloca i32, align 4
@@ -24,7 +24,7 @@
   %0 = load i32, i32* %i, align 4
   %1 = load i32, i32* %n.addr, align 4
   %cmp = icmp slt i32 %0, %1
-  br i1 %cmp, label %for.body, label %for.end, !prof !19
+  br i1 %cmp, label %for.body, label %for.end, !prof !20
 
 for.body:
   %2 = load i32, i32* %i, align 4
@@ -40,23 +40,23 @@
 ; not call site VP metadata (which can exist on value profiled memcpy,
 ; or possibly left behind after static analysis based devirtualization).
 ; CHECK: cold_func1{{.*}}!section_prefix ![[COLD_ID:[0-9]+]]
-define void @cold_func1() !prof !16 {
-  call void @hot_func1(), !prof !17
-  call void @hot_func1(), !prof !17
+define void @cold_func1() !prof !17 {
+  call void @hot_func1(), !prof !18
+  call void @hot_func1(), !prof !18
   ret void
 }
 
 ; CHECK: cold_func2{{.*}}!section_prefix ![[COLD_ID]]
-define void @cold_func2() !prof !16 {
-  call void @hot_func1(), !prof !17
-  call void @hot_func1(), !prof !18
+define void @cold_func2() !prof !17 {
   call void @hot_func1(), !prof !18
+  call void @hot_func1(), !prof !19
+  call void @hot_func1(), !prof !19
   ret void
 }
 
 ; CHECK: cold_func3{{.*}}!section_prefix ![[COLD_ID]]
-define void @cold_func3() !prof !16 {
-  call void @hot_func1(), !prof !18
+define void @cold_func3() !prof !17 {
+  call void @hot_func1(), !prof !19
   ret void
 }
 
@@ -64,7 +64,7 @@
 ; CHECK: ![[COLD_ID]] = !{!"function_section_prefix", !".unlikely"}
 !llvm.module.flags = !{!1}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -72,13 +72,14 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
-!15 = !{!"function_entry_count", i64 1000}
-!16 = !{!"function_entry_count", i64 1}
-!17 = !{!"branch_weights", i32 80}
-!18 = !{!"branch_weights", i32 1}
-!19 = !{!"branch_weights", i32 1000, i32 1}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
+!16 = !{!"function_entry_count", i64 1000}
+!17 = !{!"function_entry_count", i64 1}
+!18 = !{!"branch_weights", i32 80}
+!19 = !{!"branch_weights", i32 1}
+!20 = !{!"branch_weights", i32 1000, i32 1}
Index: llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode.ll
===================================================================
--- llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode.ll
+++ llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode.ll
@@ -153,7 +153,7 @@
 }
 
 ; Negative test - opt for size
-define void @test6_pgso(i1 %cond, i64* %base) !prof !14 {
+define void @test6_pgso(i1 %cond, i64* %base) !prof !15 {
 ; CHECK-LABEL: @test6
 entry:
 ; CHECK: %addr = getelementptr
@@ -305,7 +305,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -313,9 +313,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/Transforms/ConstantHoisting/ARM/const-addr-no-neg-offset.ll
===================================================================
--- llvm/test/Transforms/ConstantHoisting/ARM/const-addr-no-neg-offset.ll
+++ llvm/test/Transforms/ConstantHoisting/ARM/const-addr-no-neg-offset.ll
@@ -44,7 +44,7 @@
 
 attributes #0 = { minsize norecurse nounwind optsize readnone uwtable }
 
-define void @foo_pgso() #1 !prof !14 {
+define void @foo_pgso() #1 !prof !15 {
 entry:
 ; PGSO-LABEL: @foo_pgso
 ; PGSO-NOT: [[CONST2:%const_mat[0-9]*]] = add i32 %const, -4
@@ -85,7 +85,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -93,9 +93,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/Transforms/FunctionImport/Inputs/hotness_based_import.ll
===================================================================
--- llvm/test/Transforms/FunctionImport/Inputs/hotness_based_import.ll
+++ llvm/test/Transforms/FunctionImport/Inputs/hotness_based_import.ll
@@ -6,12 +6,12 @@
 define void @hot1() #1 {
   ret void
 }
-define void @hot2() #1 !prof !20  {
+define void @hot2() #1 !prof !21  {
   call void @calledFromHot()
   call void @calledFromHot()
   ret void
 }
-define void @hot3() #1 !prof !20 {
+define void @hot3() #1 !prof !21 {
   call void @calledFromHot()
   call void @calledFromHot()
   call void @calledFromHot()
@@ -44,12 +44,12 @@
   ret void
 }
 
-define void @calledFromHot() !prof !20 {
+define void @calledFromHot() !prof !21 {
   call void @calledFromHot2()
   ret void
 }
 
-define void @calledFromHot2() !prof !20 {
+define void @calledFromHot2() !prof !21 {
   call void @calledFromHot3()
   ret void
 }
@@ -61,12 +61,12 @@
 declare void @calledFromHot3()
 
 !0 = !{!"function_entry_count", i64 1}
-!20 = !{!"function_entry_count", i64 110}
+!21 = !{!"function_entry_count", i64 110}
 
 !llvm.module.flags = !{!1}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 10}
@@ -74,8 +74,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
\ No newline at end of file
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
\ No newline at end of file
Index: llvm/test/Transforms/FunctionImport/hotness_based_import.ll
===================================================================
--- llvm/test/Transforms/FunctionImport/hotness_based_import.ll
+++ llvm/test/Transforms/FunctionImport/hotness_based_import.ll
@@ -78,10 +78,10 @@
 target triple = "x86_64-unknown-linux-gnu"
 
 ; This function have high profile count, so entry block is hot.
-define void @hot_function(i1 %a, i1 %a2) !prof !20 {
+define void @hot_function(i1 %a, i1 %a2) !prof !21 {
 entry:
     call void @hot1()
-    br i1 %a, label %Cold, label %Hot, !prof !41
+    br i1 %a, label %Cold, label %Hot, !prof !42
 Cold:           ; 1/1000 goes here
   call void @cold()
   call void @cold2()
@@ -91,7 +91,7 @@
 Hot:            ; 999/1000 goes here
   call void @hot2()
   call void @hot3()
-  br i1 %a2, label %None1, label %None2, !prof !42
+  br i1 %a2, label %None1, label %None2, !prof !43
 None1:          ; half goes here
   call void @none1()
   call void @none2()
@@ -113,16 +113,16 @@
 declare void @none3() #1
 
 
-!41 = !{!"branch_weights", i32 1, i32 1000}
-!42 = !{!"branch_weights", i32 1, i32 1}
+!42 = !{!"branch_weights", i32 1, i32 1000}
+!43 = !{!"branch_weights", i32 1, i32 1}
 
 
 
 !llvm.module.flags = !{!1}
-!20 = !{!"function_entry_count", i64 110}
+!21 = !{!"function_entry_count", i64 110}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 10}
@@ -130,8 +130,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
Index: llvm/test/Transforms/FunctionImport/import_stats.ll
===================================================================
--- llvm/test/Transforms/FunctionImport/import_stats.ll
+++ llvm/test/Transforms/FunctionImport/import_stats.ll
@@ -32,11 +32,11 @@
 target triple = "x86_64-unknown-linux-gnu"
 
 ; This function has a high profile count, so entry block is hot.
-define void @hot_function(i1 %a) !prof !20 {
+define void @hot_function(i1 %a) !prof !21 {
 entry:
   call void @hot()
   call void @critical()
-  br i1 %a, label %None1, label %None2, !prof !42
+  br i1 %a, label %None1, label %None2, !prof !43
 None1:          ; half goes here
   call void @none()
   br label %exit
@@ -50,13 +50,13 @@
 declare void @none()
 declare void @critical()
 
-!42 = !{!"branch_weights", i32 1, i32 1}
+!43 = !{!"branch_weights", i32 1, i32 1}
 
 !llvm.module.flags = !{!1}
-!20 = !{!"function_entry_count", i64 100, i64 696010031887058302}
+!21 = !{!"function_entry_count", i64 100, i64 696010031887058302}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 300}
 !5 = !{!"MaxCount", i64 100}
@@ -64,8 +64,9 @@
 !7 = !{!"MaxFunctionCount", i64 100}
 !8 = !{!"NumCounts", i64 4}
 !9 = !{!"NumFunctions", i64 1}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 4}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 4}
Index: llvm/test/Transforms/HotColdSplit/coldentrycount.ll
===================================================================
--- llvm/test/Transforms/HotColdSplit/coldentrycount.ll
+++ llvm/test/Transforms/HotColdSplit/coldentrycount.ll
@@ -8,7 +8,7 @@
 
 ; CHECK-LABEL: @fun
 ; CHECK: call void @fun.cold.1
-define void @fun() !prof !14 {
+define void @fun() !prof !15 {
 entry:
   br i1 undef, label %if.then, label %if.else
 
@@ -27,7 +27,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -35,9 +35,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 100}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 100}
Index: llvm/test/Transforms/Inline/bfi-update.ll
===================================================================
--- llvm/test/Transforms/Inline/bfi-update.ll
+++ llvm/test/Transforms/Inline/bfi-update.ll
@@ -13,7 +13,7 @@
 
 @data = external global i32
 ; CHECK-LABEL: define i32 @a(
-define i32 @a(i32 %a1) !prof !21 {
+define i32 @a(i32 %a1) !prof !22 {
 ; CHECK-NOT: call i32 @c
 ; CHECK-NOT: call i32 @e
 ; CHECK: ret
@@ -28,10 +28,10 @@
 declare void @ext();
 
 ; CHECK: @c(i32 %c1) !prof [[COUNT1:![0-9]+]]
-define i32 @c(i32 %c1) !prof !23 {
+define i32 @c(i32 %c1) !prof !24 {
   call void @ext()
   %cond = icmp sle i32 %c1, 1
-  br i1 %cond, label %cond_true, label %cond_false, !prof !25
+  br i1 %cond, label %cond_true, label %cond_false, !prof !26
 
 cond_false:
   br label %exit
@@ -46,7 +46,7 @@
 
 
 ; CHECK: @e(i32 %c1) !prof [[COUNT2:![0-9]+]]
-define i32 @e(i32 %c1) !prof !24 {
+define i32 @e(i32 %c1) !prof !25 {
   call void @ext()
   call void @ext()
   %cond = icmp sle i32 %c1, 1
@@ -71,14 +71,14 @@
 
 ; CHECK: [[COUNT1]] = !{!"function_entry_count", i64 480}
 ; CHECK: [[COUNT2]] = !{!"function_entry_count", i64 80}
-!21 = !{!"function_entry_count", i64 20}
-!23 = !{!"function_entry_count", i64 500}
-!24 = !{!"function_entry_count", i64 100}
-!25 = !{!"branch_weights", i32 1, i32 9}
+!22 = !{!"function_entry_count", i64 20}
+!24 = !{!"function_entry_count", i64 500}
+!25 = !{!"function_entry_count", i64 100}
+!26 = !{!"branch_weights", i32 1, i32 9}
 
 !llvm.module.flags = !{!1}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -86,8 +86,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 1000, i32 1}
-!13 = !{i32 999000, i64 1000, i32 1}
-!14 = !{i32 999999, i64 5, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 1000, i32 1}
+!14 = !{i32 999000, i64 1000, i32 1}
+!15 = !{i32 999999, i64 5, i32 2}
Index: llvm/test/Transforms/Inline/inline-cold-callee.ll
===================================================================
--- llvm/test/Transforms/Inline/inline-cold-callee.ll
+++ llvm/test/Transforms/Inline/inline-cold-callee.ll
@@ -5,7 +5,7 @@
 ; A callee with identical body does gets inlined because cost fits within the
 ; inline-threshold
 
-define i32 @callee1(i32 %x) !prof !21 {
+define i32 @callee1(i32 %x) !prof !22 {
   %x1 = add i32 %x, 1
   %x2 = add i32 %x1, 1
   %x3 = add i32 %x2, 1
@@ -13,7 +13,7 @@
   ret i32 %x3
 }
 
-define i32 @callee2(i32 %x) !prof !22 {
+define i32 @callee2(i32 %x) !prof !23 {
 ; CHECK-LABEL: @callee2(
   %x1 = add i32 %x, 1
   %x2 = add i32 %x1, 1
@@ -22,7 +22,7 @@
   ret i32 %x3
 }
 
-define i32 @caller2(i32 %y1) !prof !22 {
+define i32 @caller2(i32 %y1) !prof !23 {
 ; CHECK-LABEL: @caller2(
 ; CHECK: call i32 @callee2
 ; CHECK-NOT: call i32 @callee1
@@ -35,11 +35,11 @@
 declare void @extern()
 
 !llvm.module.flags = !{!1}
-!21 = !{!"function_entry_count", i64 100}
-!22 = !{!"function_entry_count", i64 1}
+!22 = !{!"function_entry_count", i64 100}
+!23 = !{!"function_entry_count", i64 1}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -47,8 +47,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
Index: llvm/test/Transforms/Inline/inline-cold-callsite-pgo.ll
===================================================================
--- llvm/test/Transforms/Inline/inline-cold-callsite-pgo.ll
+++ llvm/test/Transforms/Inline/inline-cold-callsite-pgo.ll
@@ -4,7 +4,7 @@
 ; and does not get inlined. Another callsite to an identical callee that
 ; is not cold gets inlined because cost is below the inline-threshold.
 
-define i32 @callee1(i32 %x) !prof !21 {
+define i32 @callee1(i32 %x) !prof !22 {
   %x1 = add i32 %x, 1
   %x2 = add i32 %x1, 1
   %x3 = add i32 %x2, 1
@@ -12,7 +12,7 @@
   ret i32 %x3
 }
 
-define i32 @caller(i32 %n) !prof !22 {
+define i32 @caller(i32 %n) !prof !23 {
 ; CHECK-LABEL: @caller(
   %cond = icmp sle i32 %n, 100
   br i1 %cond, label %cond_true, label %cond_false, !prof !0
@@ -35,11 +35,11 @@
 !0 = !{!"branch_weights", i32 200, i32 1}
 
 !llvm.module.flags = !{!1}
-!21 = !{!"function_entry_count", i64 200}
 !22 = !{!"function_entry_count", i64 200}
+!23 = !{!"function_entry_count", i64 200}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -47,8 +47,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 1000, i32 1}
-!13 = !{i32 999000, i64 1000, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 1000, i32 1}
+!14 = !{i32 999000, i64 1000, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
Index: llvm/test/Transforms/Inline/inline-hot-callee.ll
===================================================================
--- llvm/test/Transforms/Inline/inline-hot-callee.ll
+++ llvm/test/Transforms/Inline/inline-hot-callee.ll
@@ -6,7 +6,7 @@
 ; because cost exceeds the inline-threshold. This test is relevant only when the
 ; old pass manager is used.
 
-define i32 @callee1(i32 %x) !prof !21 {
+define i32 @callee1(i32 %x) !prof !22 {
   %x1 = add i32 %x, 1
   %x2 = add i32 %x1, 1
   %x3 = add i32 %x2, 1
@@ -14,7 +14,7 @@
   ret i32 %x3
 }
 
-define i32 @callee2(i32 %x) !prof !22 {
+define i32 @callee2(i32 %x) !prof !23 {
 ; CHECK-LABEL: @callee2(
   %x1 = add i32 %x, 1
   %x2 = add i32 %x1, 1
@@ -23,7 +23,7 @@
   ret i32 %x3
 }
 
-define i32 @caller2(i32 %y1) !prof !22 {
+define i32 @caller2(i32 %y1) !prof !23 {
 ; CHECK-LABEL: @caller2(
 ; CHECK: call i32 @callee2
 ; CHECK-NOT: call i32 @callee1
@@ -36,11 +36,11 @@
 declare void @extern()
 
 !llvm.module.flags = !{!1}
-!21 = !{!"function_entry_count", i64 300}
-!22 = !{!"function_entry_count", i64 1}
+!22 = !{!"function_entry_count", i64 300}
+!23 = !{!"function_entry_count", i64 1}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -48,8 +48,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
Index: llvm/test/Transforms/Inline/inline-hot-callsite-2.ll
===================================================================
--- llvm/test/Transforms/Inline/inline-hot-callsite-2.ll
+++ llvm/test/Transforms/Inline/inline-hot-callsite-2.ll
@@ -6,7 +6,7 @@
 ; because cost exceeds the inline-threshold. inlinthint-threshold is set to 0
 ; to ensure callee's hotness is not used to boost the threshold.
 
-define i32 @callee1(i32 %x) !prof !21 {
+define i32 @callee1(i32 %x) !prof !22 {
   %x1 = add i32 %x, 1
   %x2 = add i32 %x1, 1
   %x3 = add i32 %x2, 1
@@ -14,7 +14,7 @@
   ret i32 %x3
 }
 
-define i32 @caller(i32 %n) !prof !22 {
+define i32 @caller(i32 %n) !prof !23 {
 ; CHECK-LABEL: @caller(
   %cond = icmp sle i32 %n, 100
   br i1 %cond, label %cond_true, label %cond_false, !prof !0
@@ -37,11 +37,11 @@
 !0 = !{!"branch_weights", i32 64, i32 4}
 
 !llvm.module.flags = !{!1}
-!21 = !{!"function_entry_count", i64 200}
 !22 = !{!"function_entry_count", i64 200}
+!23 = !{!"function_entry_count", i64 200}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -49,8 +49,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
Index: llvm/test/Transforms/Inline/inline-hot-callsite.ll
===================================================================
--- llvm/test/Transforms/Inline/inline-hot-callsite.ll
+++ llvm/test/Transforms/Inline/inline-hot-callsite.ll
@@ -34,19 +34,19 @@
 ; CHECK: call i32 @callee2
 ; CHECK-NOT: call i32 @callee1
 ; CHECK: ret i32 %x3.i
-  %y2 = call i32 @callee2(i32 %y1), !prof !22
-  %y3 = call i32 @callee1(i32 %y2), !prof !21
+  %y2 = call i32 @callee2(i32 %y1), !prof !23
+  %y3 = call i32 @callee1(i32 %y2), !prof !22
   ret i32 %y3
 }
 
 declare void @extern()
 
 !llvm.module.flags = !{!1}
-!21 = !{!"branch_weights", i64 300}
-!22 = !{!"branch_weights", i64 1}
+!22 = !{!"branch_weights", i64 300}
+!23 = !{!"branch_weights", i64 1}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"SampleProfile"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -54,8 +54,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
Index: llvm/test/Transforms/Inline/prof-update-instr.ll
===================================================================
--- llvm/test/Transforms/Inline/prof-update-instr.ll
+++ llvm/test/Transforms/Inline/prof-update-instr.ll
@@ -6,24 +6,24 @@
 @func2 = global void ()* null
 
 ; CHECK: define void @callee(i32 %n) !prof ![[ENTRY_COUNT:[0-9]*]]
-define void  @callee(i32 %n) !prof !15 {
+define void  @callee(i32 %n) !prof !16 {
   %cond = icmp sle i32 %n, 10
-  br i1 %cond, label %cond_true, label %cond_false, !prof !20
+  br i1 %cond, label %cond_true, label %cond_false, !prof !21
 cond_true:
 ; f2 is optimized away, thus not updated.
   %f2 = load void ()*, void ()** @func2
 ; CHECK: call void %f2(), !prof ![[COUNT_IND_CALLEE1:[0-9]*]]
-  call void %f2(), !prof !19
+  call void %f2(), !prof !20
   ret void
 cond_false:
   %f = load void ()*, void ()** @func
 ; CHECK: call void %f(), !prof ![[COUNT_IND_CALLEE:[0-9]*]]
-  call void %f(), !prof !18
+  call void %f(), !prof !19
   ret void
 }
 
 ; CHECK: define void @caller()
-define void @caller() !prof !21 {
+define void @caller() !prof !22 {
 ; CHECK: call void %f.i(), !prof ![[COUNT_IND_CALLER:[0-9]*]]
   call void @callee(i32 15)
   ret void
@@ -31,7 +31,7 @@
 
 !llvm.module.flags = !{!1}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 10}
@@ -39,17 +39,18 @@
 !7 = !{!"MaxFunctionCount", i64 2000}
 !8 = !{!"NumCounts", i64 2}
 !9 = !{!"NumFunctions", i64 2}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
-!15 = !{!"function_entry_count", i64 1000}
-!16 = !{!"branch_weights", i64 2000}
-!18 = !{!"VP", i32 0, i64 140, i64 111, i64 80, i64 222, i64 40, i64 333, i64 20}
-!19 = !{!"VP", i32 0, i64 200, i64 111, i64 100, i64 222, i64 60, i64 333, i64 40}
-!20 = !{!"branch_weights", i32 1000, i32 1000}
-!21 = !{!"function_entry_count", i64 400}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
+!16 = !{!"function_entry_count", i64 1000}
+!17 = !{!"branch_weights", i64 2000}
+!19 = !{!"VP", i32 0, i64 140, i64 111, i64 80, i64 222, i64 40, i64 333, i64 20}
+!20 = !{!"VP", i32 0, i64 200, i64 111, i64 100, i64 222, i64 60, i64 333, i64 40}
+!21 = !{!"branch_weights", i32 1000, i32 1000}
+!22 = !{!"function_entry_count", i64 400}
 attributes #0 = { alwaysinline }
 ; CHECK: ![[ENTRY_COUNT]] = !{!"function_entry_count", i64 600}
 ; CHECK: ![[COUNT_IND_CALLEE1]] = !{!"VP", i32 0, i64 200, i64 111, i64 100, i64 222, i64 60, i64 333, i64 40}
Index: llvm/test/Transforms/Inline/prof-update-sample.ll
===================================================================
--- llvm/test/Transforms/Inline/prof-update-sample.ll
+++ llvm/test/Transforms/Inline/prof-update-sample.ll
@@ -6,21 +6,21 @@
 @func = global void ()* null
 
 ; CHECK: define void @callee(i32 %n) !prof ![[ENTRY_COUNT:[0-9]*]]
-define void  @callee(i32 %n) !prof !15 {
+define void  @callee(i32 %n) !prof !16 {
   %cond = icmp sle i32 %n, 10
   br i1 %cond, label %cond_true, label %cond_false
 cond_true:
 ; ext1 is optimized away, thus not updated.
 ; CHECK: call void @ext1(), !prof ![[COUNT_CALLEE1:[0-9]*]]
-  call void @ext1(), !prof !16
+  call void @ext1(), !prof !17
   ret void
 cond_false:
 ; ext is cloned and updated.
 ; CHECK: call void @ext(), !prof ![[COUNT_CALLEE:[0-9]*]]
-  call void @ext(), !prof !16
+  call void @ext(), !prof !17
   %f = load void ()*, void ()** @func
 ; CHECK: call void %f(), !prof ![[COUNT_IND_CALLEE:[0-9]*]] 
-  call void %f(), !prof !18
+  call void %f(), !prof !19
   ret void
 }
 
@@ -28,13 +28,13 @@
 define void @caller() {
 ; CHECK: call void @ext(), !prof ![[COUNT_CALLER:[0-9]*]]
 ; CHECK: call void %f.i(), !prof ![[COUNT_IND_CALLER:[0-9]*]]
-  call void @callee(i32 15), !prof !17
+  call void @callee(i32 15), !prof !18
   ret void
 }
 
 !llvm.module.flags = !{!1}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"SampleProfile"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 10}
@@ -42,15 +42,16 @@
 !7 = !{!"MaxFunctionCount", i64 2000}
 !8 = !{!"NumCounts", i64 2}
 !9 = !{!"NumFunctions", i64 2}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
-!15 = !{!"function_entry_count", i64 1000}
-!16 = !{!"branch_weights", i64 2000}
-!17 = !{!"branch_weights", i64 400}
-!18 = !{!"VP", i32 0, i64 140, i64 111, i64 80, i64 222, i64 40, i64 333, i64 20}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
+!16 = !{!"function_entry_count", i64 1000}
+!17 = !{!"branch_weights", i64 2000}
+!18 = !{!"branch_weights", i64 400}
+!19 = !{!"VP", i32 0, i64 140, i64 111, i64 80, i64 222, i64 40, i64 333, i64 20}
 attributes #0 = { alwaysinline }
 ; CHECK: ![[ENTRY_COUNT]] = !{!"function_entry_count", i64 600}
 ; CHECK: ![[COUNT_CALLEE1]] = !{!"branch_weights", i64 2000}
Index: llvm/test/Transforms/InstCombine/fputs-opt-size.ll
===================================================================
--- llvm/test/Transforms/InstCombine/fputs-opt-size.ll
+++ llvm/test/Transforms/InstCombine/fputs-opt-size.ll
@@ -29,7 +29,7 @@
 attributes #0 = { nounwind optsize }
 attributes #1 = { nounwind optsize  }
 
-define i32 @main_pgso() local_unnamed_addr !prof !14 {
+define i32 @main_pgso() local_unnamed_addr !prof !15 {
 entry:
 ; PGSO-LABEL: @main_pgso(
 ; PGSO-NOT: call i64 @fwrite
@@ -45,7 +45,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -53,9 +53,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/Transforms/LoopLoadElim/opt-size.ll
===================================================================
--- llvm/test/Transforms/LoopLoadElim/opt-size.ll
+++ llvm/test/Transforms/LoopLoadElim/opt-size.ll
@@ -80,7 +80,7 @@
 
 ; PGSO-LABEL: @f_pgso(
 ; NPGSO-LABEL: @f_pgso(
-define void @f_pgso(i32* %A, i32* %B, i32* %C, i64 %N) !prof !14 {
+define void @f_pgso(i32* %A, i32* %B, i32* %C, i64 %N) !prof !15 {
 
 entry:
   br label %for.body
@@ -113,7 +113,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -121,9 +121,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/Transforms/LoopUnroll/peel-loop-pgo-deopt.ll
===================================================================
--- llvm/test/Transforms/LoopUnroll/peel-loop-pgo-deopt.ll
+++ llvm/test/Transforms/LoopUnroll/peel-loop-pgo-deopt.ll
@@ -11,19 +11,19 @@
 ; CHECK: PEELING loop %for.body with iteration count 4!
 ; CHECK-NO-PEEL-NOT: PEELING loop %for.body
 ; CHECK-LABEL: @basic
-; CHECK: br i1 %c, label %{{.*}}, label %side_exit, !prof !15
-; CHECK: br i1 %{{.*}}, label %[[NEXT0:.*]], label %for.cond.for.end_crit_edge, !prof !16
+; CHECK: br i1 %c, label %{{.*}}, label %side_exit, !prof !16
+; CHECK: br i1 %{{.*}}, label %[[NEXT0:.*]], label %for.cond.for.end_crit_edge, !prof !17
 ; CHECK: [[NEXT0]]:
-; CHECK: br i1 %c, label %{{.*}}, label %side_exit, !prof !15
-; CHECK: br i1 %{{.*}}, label %[[NEXT1:.*]], label %for.cond.for.end_crit_edge, !prof !17
+; CHECK: br i1 %c, label %{{.*}}, label %side_exit, !prof !16
+; CHECK: br i1 %{{.*}}, label %[[NEXT1:.*]], label %for.cond.for.end_crit_edge, !prof !18
 ; CHECK: [[NEXT1]]:
-; CHECK: br i1 %c, label %{{.*}}, label %side_exit, !prof !15
-; CHECK: br i1 %{{.*}}, label %[[NEXT2:.*]], label %for.cond.for.end_crit_edge, !prof !18
+; CHECK: br i1 %c, label %{{.*}}, label %side_exit, !prof !16
+; CHECK: br i1 %{{.*}}, label %[[NEXT2:.*]], label %for.cond.for.end_crit_edge, !prof !19
 ; CHECK: [[NEXT2]]:
-; CHECK: br i1 %c, label %{{.*}}, label %side_exit.loopexit, !prof !15
-; CHECK: br i1 %{{.*}}, label %for.body, label %{{.*}}, !prof !19
+; CHECK: br i1 %c, label %{{.*}}, label %side_exit.loopexit, !prof !16
+; CHECK: br i1 %{{.*}}, label %for.body, label %{{.*}}, !prof !20
 
-define i32 @basic(i32* %p, i32 %k, i1 %c) #0 !prof !15 {
+define i32 @basic(i32* %p, i32 %k, i1 %c) #0 !prof !16 {
 entry:
   %cmp3 = icmp slt i32 0, %k
   br i1 %cmp3, label %for.body.lr.ph, label %for.end
@@ -38,10 +38,10 @@
   store i32 %i.05, i32* %p.addr.04, align 4
   %inc = add nsw i32 %i.05, 1
   %cmp = icmp slt i32 %inc, %k
-  br i1 %c, label %continue, label %side_exit, !prof !17
+  br i1 %c, label %continue, label %side_exit, !prof !18
 
 continue:
-  br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !prof !16
+  br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !prof !17
 
 for.cond.for.end_crit_edge:                       ; preds = %for.body
   br label %for.end
@@ -63,7 +63,7 @@
 !llvm.module.flags = !{!1}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10}
 !5 = !{!"MaxCount", i64 3}
@@ -71,20 +71,21 @@
 !7 = !{!"MaxFunctionCount", i64 3}
 !8 = !{!"NumCounts", i64 2}
 !9 = !{!"NumFunctions", i64 2}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 3, i32 2}
-!13 = !{i32 999000, i64 1, i32 10}
-!14 = !{i32 999999, i64 1, i32 10}
-!15 = !{!"function_entry_count", i64 1}
-!16 = !{!"branch_weights", i32 3001, i32 1001}
-!17 = !{!"branch_weights", i32 1, i32 0}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 3, i32 2}
+!14 = !{i32 999000, i64 1, i32 10}
+!15 = !{i32 999999, i64 1, i32 10}
+!16 = !{!"function_entry_count", i64 1}
+!17 = !{!"branch_weights", i32 3001, i32 1001}
+!18 = !{!"branch_weights", i32 1, i32 0}
 
 ; This is a weights of deopt side-exit.
-;CHECK: !15 = !{!"branch_weights", i32 1, i32 0}
+;CHECK: !16 = !{!"branch_weights", i32 1, i32 0}
 ; This is a weights of latch and its copies.
-;CHECK: !16 = !{!"branch_weights", i32 3001, i32 1001}
-;CHECK: !17 = !{!"branch_weights", i32 2000, i32 1001}
-;CHECK: !18 = !{!"branch_weights", i32 999, i32 1001}
-;CHECK: !19 = !{!"branch_weights", i32 1, i32 1001}
+;CHECK: !17 = !{!"branch_weights", i32 3001, i32 1001}
+;CHECK: !18 = !{!"branch_weights", i32 2000, i32 1001}
+;CHECK: !19 = !{!"branch_weights", i32 999, i32 1001}
+;CHECK: !20 = !{!"branch_weights", i32 1, i32 1001}
 
Index: llvm/test/Transforms/LoopUnroll/peel-loop-pgo.ll
===================================================================
--- llvm/test/Transforms/LoopUnroll/peel-loop-pgo.ll
+++ llvm/test/Transforms/LoopUnroll/peel-loop-pgo.ll
@@ -18,15 +18,15 @@
 ; NOPEEL-NOT: PEELING
 
 ; CHECK-LABEL: @basic
-; CHECK: br i1 %{{.*}}, label %[[NEXT0:.*]], label %for.cond.for.end_crit_edge, !prof !15
+; CHECK: br i1 %{{.*}}, label %[[NEXT0:.*]], label %for.cond.for.end_crit_edge, !prof !16
 ; CHECK: [[NEXT0]]:
-; CHECK: br i1 %{{.*}}, label %[[NEXT1:.*]], label %for.cond.for.end_crit_edge, !prof !16
+; CHECK: br i1 %{{.*}}, label %[[NEXT1:.*]], label %for.cond.for.end_crit_edge, !prof !17
 ; CHECK: [[NEXT1]]:
-; CHECK: br i1 %{{.*}}, label %[[NEXT2:.*]], label %for.cond.for.end_crit_edge, !prof !17
+; CHECK: br i1 %{{.*}}, label %[[NEXT2:.*]], label %for.cond.for.end_crit_edge, !prof !18
 ; CHECK: [[NEXT2]]:
-; CHECK: br i1 %{{.*}}, label %for.body, label %{{.*}}, !prof !18
+; CHECK: br i1 %{{.*}}, label %for.body, label %{{.*}}, !prof !19
 
-define void @basic(i32* %p, i32 %k) #0 !prof !15 {
+define void @basic(i32* %p, i32 %k) #0 !prof !16 {
 entry:
   %cmp3 = icmp slt i32 0, %k
   br i1 %cmp3, label %for.body.lr.ph, label %for.end
@@ -41,7 +41,7 @@
   store i32 %i.05, i32* %p.addr.04, align 4
   %inc = add nsw i32 %i.05, 1
   %cmp = icmp slt i32 %inc, %k
-  br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !prof !16
+  br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !prof !17
 
 for.cond.for.end_crit_edge:                       ; preds = %for.body
   br label %for.end
@@ -57,7 +57,7 @@
 ; CHECK: for.body:
 ; CHECK-NOT: br
 ; CHECK: br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge
-define void @optsize(i32* %p, i32 %k) #1 !prof !15 {
+define void @optsize(i32* %p, i32 %k) #1 !prof !16 {
 entry:
   %cmp3 = icmp slt i32 0, %k
   br i1 %cmp3, label %for.body.lr.ph, label %for.end
@@ -72,7 +72,7 @@
   store i32 %i.05, i32* %p.addr.04, align 4
   %inc = add nsw i32 %i.05, 1
   %cmp = icmp slt i32 %inc, %k
-  br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !prof !16
+  br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !prof !17
 
 for.cond.for.end_crit_edge:                       ; preds = %for.body
   br label %for.end
@@ -87,7 +87,7 @@
 !llvm.module.flags = !{!1}
 
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 10}
 !5 = !{!"MaxCount", i64 3}
@@ -95,16 +95,17 @@
 !7 = !{!"MaxFunctionCount", i64 3}
 !8 = !{!"NumCounts", i64 2}
 !9 = !{!"NumFunctions", i64 2}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 3, i32 2}
-!13 = !{i32 999000, i64 1, i32 10}
-!14 = !{i32 999999, i64 1, i32 10}
-!15 = !{!"function_entry_count", i64 1}
-!16 = !{!"branch_weights", i32 3001, i32 1001}
-
-;CHECK: !15 = !{!"branch_weights", i32 3001, i32 1001}
-;CHECK: !16 = !{!"branch_weights", i32 2000, i32 1001}
-;CHECK: !17 = !{!"branch_weights", i32 999, i32 1001}
-;CHECK: !18 = !{!"branch_weights", i32 1, i32 1001}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 3, i32 2}
+!14 = !{i32 999000, i64 1, i32 10}
+!15 = !{i32 999999, i64 1, i32 10}
+!16 = !{!"function_entry_count", i64 1}
+!17 = !{!"branch_weights", i32 3001, i32 1001}
+
+;CHECK: !16 = !{!"branch_weights", i32 3001, i32 1001}
+;CHECK: !17 = !{!"branch_weights", i32 2000, i32 1001}
+;CHECK: !18 = !{!"branch_weights", i32 999, i32 1001}
+;CHECK: !19 = !{!"branch_weights", i32 1, i32 1001}
 
Index: llvm/test/Transforms/LoopUnroll/unroll-opt-attribute.ll
===================================================================
--- llvm/test/Transforms/LoopUnroll/unroll-opt-attribute.ll
+++ llvm/test/Transforms/LoopUnroll/unroll-opt-attribute.ll
@@ -135,7 +135,7 @@
 
 ; This test shows that with PGO, this loop is cold and not unrolled.
 
-define i32 @Test5() !prof !14 {
+define i32 @Test5() !prof !15 {
 entry:
   br label %for.body
 
@@ -160,7 +160,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -168,9 +168,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/Transforms/LoopVectorize/optsize.ll
===================================================================
--- llvm/test/Transforms/LoopVectorize/optsize.ll
+++ llvm/test/Transforms/LoopVectorize/optsize.ll
@@ -60,7 +60,7 @@
 
 attributes #1 = { minsize }
 
-define i32 @foo_pgso() !prof !14 {
+define i32 @foo_pgso() !prof !15 {
 ; PGSO-LABEL: @foo_pgso(
 ; PGSO-NOT: <{{[0-9]+}} x i8>
 ; NPGSO-LABEL: @foo_pgso(
@@ -123,7 +123,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -131,9 +131,10 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-!14 = !{!"function_entry_count", i64 0}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+!15 = !{!"function_entry_count", i64 0}
Index: llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll
+++ llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll
@@ -9,11 +9,11 @@
 @__llvm_profile_filename = constant [25 x i8] c"pass2/default_%m.profraw\00", comdat
 @__llvm_profile_raw_version = constant i64 216172782113783812, comdat
 
-define dso_local void @bar(i32 %n) !prof !29 {
+define dso_local void @bar(i32 %n) !prof !30 {
 entry:
   %call = tail call fastcc i32 @cond(i32 %n)
   %tobool = icmp eq i32 %call, 0
-  br i1 %tobool, label %if.else, label %if.then, !prof !30
+  br i1 %tobool, label %if.else, label %if.then, !prof !31
 
 if.then:
   %0 = load i32, i32* @odd, align 4
@@ -31,7 +31,7 @@
   ret void
 }
 
-define internal fastcc i32 @cond(i32 %i) #1 !prof !29 !PGOFuncName !35 {
+define internal fastcc i32 @cond(i32 %i) #1 !prof !30 !PGOFuncName !36 {
 entry:
   %rem = srem i32 %i, 2
   ret i32 %rem
@@ -43,7 +43,7 @@
 
 !0 = !{i32 1, !"wchar_size", i32 4}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 500002}
 !5 = !{!"MaxCount", i64 200000}
@@ -51,24 +51,25 @@
 !7 = !{!"MaxFunctionCount", i64 200000}
 !8 = !{!"NumCounts", i64 6}
 !9 = !{!"NumFunctions", i64 4}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
-!12 = !{i32 10000, i64 200000, i32 1}
-!13 = !{i32 100000, i64 200000, i32 1}
-!14 = !{i32 200000, i64 200000, i32 1}
-!15 = !{i32 300000, i64 200000, i32 1}
-!16 = !{i32 400000, i64 200000, i32 1}
-!17 = !{i32 500000, i64 100000, i32 4}
-!18 = !{i32 600000, i64 100000, i32 4}
-!19 = !{i32 700000, i64 100000, i32 4}
-!20 = !{i32 800000, i64 100000, i32 4}
-!21 = !{i32 900000, i64 100000, i32 4}
-!22 = !{i32 950000, i64 100000, i32 4}
-!23 = !{i32 990000, i64 100000, i32 4}
-!24 = !{i32 999000, i64 100000, i32 4}
-!25 = !{i32 999900, i64 100000, i32 4}
-!26 = !{i32 999990, i64 100000, i32 4}
-!27 = !{i32 999999, i64 1, i32 6}
-!29 = !{!"function_entry_count", i64 200000}
-!30 = !{!"branch_weights", i32 100000, i32 100000}
-!35 = !{!"cspgo_bar.c:cond"}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}
+!13 = !{i32 10000, i64 200000, i32 1}
+!14 = !{i32 100000, i64 200000, i32 1}
+!15 = !{i32 200000, i64 200000, i32 1}
+!16 = !{i32 300000, i64 200000, i32 1}
+!17 = !{i32 400000, i64 200000, i32 1}
+!18 = !{i32 500000, i64 100000, i32 4}
+!19 = !{i32 600000, i64 100000, i32 4}
+!20 = !{i32 700000, i64 100000, i32 4}
+!21 = !{i32 800000, i64 100000, i32 4}
+!22 = !{i32 900000, i64 100000, i32 4}
+!23 = !{i32 950000, i64 100000, i32 4}
+!24 = !{i32 990000, i64 100000, i32 4}
+!25 = !{i32 999000, i64 100000, i32 4}
+!26 = !{i32 999900, i64 100000, i32 4}
+!27 = !{i32 999990, i64 100000, i32 4}
+!28 = !{i32 999999, i64 1, i32 6}
+!30 = !{!"function_entry_count", i64 200000}
+!31 = !{!"branch_weights", i32 100000, i32 100000}
+!36 = !{!"cspgo_bar.c:cond"}
Index: llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll
+++ llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll
@@ -4,11 +4,11 @@
 @odd = common dso_local global i32 0, align 4
 @even = common dso_local global i32 0, align 4
 
-define dso_local void @bar(i32 %n) #0 !prof !29 {
+define dso_local void @bar(i32 %n) #0 !prof !30 {
 entry:
   %call = tail call fastcc i32 @cond(i32 %n)
   %tobool = icmp eq i32 %call, 0
-  br i1 %tobool, label %if.else, label %if.then, !prof !30
+  br i1 %tobool, label %if.else, label %if.then, !prof !31
 
 if.then:
   %0 = load i32, i32* @odd, align 4
@@ -26,7 +26,7 @@
   ret void
 }
 
-define internal fastcc i32 @cond(i32 %i) #1 !prof !29 !PGOFuncName !35 {
+define internal fastcc i32 @cond(i32 %i) #1 !prof !30 !PGOFuncName !36 {
 entry:
   %rem = srem i32 %i, 2
   ret i32 %rem
@@ -39,7 +39,7 @@
 
 !0 = !{i32 1, !"wchar_size", i32 4}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 500002}
 !5 = !{!"MaxCount", i64 200000}
@@ -47,24 +47,25 @@
 !7 = !{!"MaxFunctionCount", i64 200000}
 !8 = !{!"NumCounts", i64 6}
 !9 = !{!"NumFunctions", i64 4}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
-!12 = !{i32 10000, i64 200000, i32 1}
-!13 = !{i32 100000, i64 200000, i32 1}
-!14 = !{i32 200000, i64 200000, i32 1}
-!15 = !{i32 300000, i64 200000, i32 1}
-!16 = !{i32 400000, i64 200000, i32 1}
-!17 = !{i32 500000, i64 100000, i32 4}
-!18 = !{i32 600000, i64 100000, i32 4}
-!19 = !{i32 700000, i64 100000, i32 4}
-!20 = !{i32 800000, i64 100000, i32 4}
-!21 = !{i32 900000, i64 100000, i32 4}
-!22 = !{i32 950000, i64 100000, i32 4}
-!23 = !{i32 990000, i64 100000, i32 4}
-!24 = !{i32 999000, i64 100000, i32 4}
-!25 = !{i32 999900, i64 100000, i32 4}
-!26 = !{i32 999990, i64 100000, i32 4}
-!27 = !{i32 999999, i64 1, i32 6}
-!29 = !{!"function_entry_count", i64 200000}
-!30 = !{!"branch_weights", i32 100000, i32 100000}
-!35 = !{!"cspgo_bar.c:cond"}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}
+!13 = !{i32 10000, i64 200000, i32 1}
+!14 = !{i32 100000, i64 200000, i32 1}
+!15 = !{i32 200000, i64 200000, i32 1}
+!16 = !{i32 300000, i64 200000, i32 1}
+!17 = !{i32 400000, i64 200000, i32 1}
+!18 = !{i32 500000, i64 100000, i32 4}
+!19 = !{i32 600000, i64 100000, i32 4}
+!20 = !{i32 700000, i64 100000, i32 4}
+!21 = !{i32 800000, i64 100000, i32 4}
+!22 = !{i32 900000, i64 100000, i32 4}
+!23 = !{i32 950000, i64 100000, i32 4}
+!24 = !{i32 990000, i64 100000, i32 4}
+!25 = !{i32 999000, i64 100000, i32 4}
+!26 = !{i32 999900, i64 100000, i32 4}
+!27 = !{i32 999990, i64 100000, i32 4}
+!28 = !{i32 999999, i64 1, i32 6}
+!30 = !{!"function_entry_count", i64 200000}
+!31 = !{!"branch_weights", i32 100000, i32 100000}
+!36 = !{!"cspgo_bar.c:cond"}
Index: llvm/test/Transforms/PGOProfile/chr.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/chr.ll
+++ llvm/test/Transforms/PGOProfile/chr.ll
@@ -23,13 +23,13 @@
 ;   if ((t0 & 2) != 0)
 ;     foo()
 ; }
-define void @test_chr_1(i32* %i) !prof !14 {
+define void @test_chr_1(i32* %i) !prof !15 {
 ; CHECK-LABEL: @test_chr_1(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 3
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    call void @foo()
@@ -37,14 +37,14 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 0
-; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1_NONCHR]]
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
-; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB3]]
@@ -55,7 +55,7 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !15
+  br i1 %2, label %bb1, label %bb0, !prof !16
 
 bb0:
   call void @foo()
@@ -64,7 +64,7 @@
 bb1:
   %3 = and i32 %0, 2
   %4 = icmp eq i32 %3, 0
-  br i1 %4, label %bb3, label %bb2, !prof !15
+  br i1 %4, label %bb3, label %bb2, !prof !16
 
 bb2:
   call void @foo()
@@ -96,13 +96,13 @@
 ;   if ((t0 & 4) != 0)
 ;     foo()
 ; }
-define void @test_chr_1_1(i32* %i) !prof !14 {
+define void @test_chr_1_1(i32* %i) !prof !15 {
 ; CHECK-LABEL: @test_chr_1_1(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 7
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 7
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    call void @foo()
@@ -110,21 +110,21 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 0
-; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1_NONCHR]]
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
-; CHECK-NEXT:    br i1 [[TMP6]], label [[BB2_NONCHR:%.*]], label [[BB3_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP6]], label [[BB2_NONCHR:%.*]], label [[BB3_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    call void @bar()
 ; CHECK-NEXT:    br label [[BB3_NONCHR]]
 ; CHECK:       bb3.nonchr:
 ; CHECK-NEXT:    [[TMP7:%.*]] = and i32 [[TMP0]], 4
 ; CHECK-NEXT:    [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 0
-; CHECK-NEXT:    br i1 [[TMP8]], label [[BB5]], label [[BB4_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP8]], label [[BB5]], label [[BB4_NONCHR:%.*]], !prof !17
 ; CHECK:       bb4.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB5]]
@@ -135,7 +135,7 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !15
+  br i1 %2, label %bb1, label %bb0, !prof !16
 
 bb0:
   call void @foo()
@@ -144,7 +144,7 @@
 bb1:
   %3 = and i32 %0, 2
   %4 = icmp eq i32 %3, 0
-  br i1 %4, label %bb2, label %bb3, !prof !15
+  br i1 %4, label %bb2, label %bb3, !prof !16
 
 bb2:
   call void @bar()
@@ -153,7 +153,7 @@
 bb3:
   %5 = and i32 %0, 4
   %6 = icmp eq i32 %5, 0
-  br i1 %6, label %bb5, label %bb4, !prof !15
+  br i1 %6, label %bb5, label %bb4, !prof !16
 
 bb4:
   call void @foo()
@@ -182,13 +182,13 @@
 ;   if ((t0 & 2) != 0)
 ;     foo()
 ; }
-define void @test_chr_2(i32* %i) !prof !14 {
+define void @test_chr_2(i32* %i) !prof !15 {
 ; CHECK-LABEL: @test_chr_2(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 3
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB1:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB1:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb1:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    call void @foo()
@@ -196,15 +196,15 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i32 [[TMP0]], 255
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 0
-; CHECK-NEXT:    br i1 [[TMP4]], label [[BB4]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP4]], label [[BB4]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
-; CHECK-NEXT:    br i1 [[TMP6]], label [[BB2_NONCHR:%.*]], label [[BB1_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP6]], label [[BB2_NONCHR:%.*]], label [[BB1_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    [[TMP7:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 0
-; CHECK-NEXT:    br i1 [[TMP8]], label [[BB4]], label [[BB3_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP8]], label [[BB4]], label [[BB3_NONCHR:%.*]], !prof !17
 ; CHECK:       bb3.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB4]]
@@ -218,12 +218,12 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 255
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb4, label %bb0, !prof !15
+  br i1 %2, label %bb4, label %bb0, !prof !16
 
 bb0:
   %3 = and i32 %0, 1
   %4 = icmp eq i32 %3, 0
-  br i1 %4, label %bb2, label %bb1, !prof !15
+  br i1 %4, label %bb2, label %bb1, !prof !16
 
 bb1:
   call void @foo()
@@ -232,7 +232,7 @@
 bb2:
   %5 = and i32 %0, 2
   %6 = icmp eq i32 %5, 0
-  br i1 %6, label %bb4, label %bb3, !prof !15
+  br i1 %6, label %bb4, label %bb3, !prof !16
 
 bb3:
   call void @foo()
@@ -275,13 +275,13 @@
 ;   if ((t2 & 8) != 0)
 ;     foo()
 ; }
-define void @test_chr_3(i32* %i) !prof !14 {
+define void @test_chr_3(i32* %i) !prof !15 {
 ; CHECK-LABEL: @test_chr_3(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 3
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    call void @foo()
@@ -289,14 +289,14 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 0
-; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1_NONCHR]]
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
-; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB3]]
@@ -304,7 +304,7 @@
 ; CHECK-NEXT:    [[TMP7:%.*]] = load i32, i32* [[I]], align 4
 ; CHECK-NEXT:    [[TMP8:%.*]] = and i32 [[TMP7]], 12
 ; CHECK-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 12
-; CHECK-NEXT:    br i1 [[TMP9]], label [[BB4:%.*]], label [[BB3_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP9]], label [[BB4:%.*]], label [[BB3_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb4:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    call void @foo()
@@ -312,14 +312,14 @@
 ; CHECK:       bb3.split.nonchr:
 ; CHECK-NEXT:    [[TMP10:%.*]] = and i32 [[TMP7]], 4
 ; CHECK-NEXT:    [[TMP11:%.*]] = icmp eq i32 [[TMP10]], 0
-; CHECK-NEXT:    br i1 [[TMP11]], label [[BB5_NONCHR:%.*]], label [[BB4_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP11]], label [[BB5_NONCHR:%.*]], label [[BB4_NONCHR:%.*]], !prof !17
 ; CHECK:       bb4.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB5_NONCHR]]
 ; CHECK:       bb5.nonchr:
 ; CHECK-NEXT:    [[TMP12:%.*]] = and i32 [[TMP7]], 8
 ; CHECK-NEXT:    [[TMP13:%.*]] = icmp eq i32 [[TMP12]], 0
-; CHECK-NEXT:    br i1 [[TMP13]], label [[BB7]], label [[BB6_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP13]], label [[BB7]], label [[BB6_NONCHR:%.*]], !prof !17
 ; CHECK:       bb6.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB7]]
@@ -330,7 +330,7 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !15
+  br i1 %2, label %bb1, label %bb0, !prof !16
 
 bb0:
   call void @foo()
@@ -339,7 +339,7 @@
 bb1:
   %3 = and i32 %0, 2
   %4 = icmp eq i32 %3, 0
-  br i1 %4, label %bb3, label %bb2, !prof !15
+  br i1 %4, label %bb3, label %bb2, !prof !16
 
 bb2:
   call void @foo()
@@ -349,7 +349,7 @@
   %5 = load i32, i32* %i
   %6 = and i32 %5, 4
   %7 = icmp eq i32 %6, 0
-  br i1 %7, label %bb5, label %bb4, !prof !15
+  br i1 %7, label %bb5, label %bb4, !prof !16
 
 bb4:
   call void @foo()
@@ -358,7 +358,7 @@
 bb5:
   %8 = and i32 %5, 8
   %9 = icmp eq i32 %8, 0
-  br i1 %9, label %bb7, label %bb6, !prof !15
+  br i1 %9, label %bb7, label %bb6, !prof !16
 
 bb6:
   call void @foo()
@@ -383,13 +383,13 @@
 ;   sum2 = (t0 & 2) ? sum1 : (sum1 + 43)
 ;   return sum2
 ; }
-define i32 @test_chr_4(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_4(i32* %i, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_4(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 3
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
-; CHECK-NEXT:    br i1 [[TMP2]], label [[ENTRY_SPLIT:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[ENTRY_SPLIT:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       entry.split:
 ; CHECK-NEXT:    [[TMP3:%.*]] = add i32 [[SUM0:%.*]], 85
 ; CHECK-NEXT:    ret i32 [[TMP3]]
@@ -397,11 +397,11 @@
 ; CHECK-NEXT:    [[TMP4:%.*]] = add i32 [[SUM0]], 42
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
-; CHECK-NEXT:    [[SUM1_NONCHR:%.*]] = select i1 [[TMP6]], i32 [[SUM0]], i32 [[TMP4]], !prof !16
+; CHECK-NEXT:    [[SUM1_NONCHR:%.*]] = select i1 [[TMP6]], i32 [[SUM0]], i32 [[TMP4]], !prof !17
 ; CHECK-NEXT:    [[TMP7:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 0
 ; CHECK-NEXT:    [[TMP9:%.*]] = add i32 [[SUM1_NONCHR]], 43
-; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[TMP8]], i32 [[SUM1_NONCHR]], i32 [[TMP9]], !prof !16
+; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[TMP8]], i32 [[SUM1_NONCHR]], i32 [[TMP9]], !prof !17
 ; CHECK-NEXT:    ret i32 [[SUM2_NONCHR]]
 ;
 entry:
@@ -409,11 +409,11 @@
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
   %3 = add i32 %sum0, 42
-  %sum1 = select i1 %2, i32 %sum0, i32 %3, !prof !15
+  %sum1 = select i1 %2, i32 %sum0, i32 %3, !prof !16
   %4 = and i32 %0, 2
   %5 = icmp eq i32 %4, 0
   %6 = add i32 %sum1, 43
-  %sum2 = select i1 %5, i32 %sum1, i32 %6, !prof !15
+  %sum2 = select i1 %5, i32 %sum1, i32 %6, !prof !16
   ret i32 %sum2
 }
 
@@ -442,13 +442,13 @@
 ;   }
 ; }
 ; return sum
-define i32 @test_chr_5(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_5(i32* %i, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_5(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 15
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 15
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    [[TMP3:%.*]] = add i32 [[SUM0:%.*]], 85
 ; CHECK-NEXT:    [[TMP4:%.*]] = add i32 [[SUM0]], 173
@@ -456,23 +456,23 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i32 [[TMP0]], 255
 ; CHECK-NEXT:    [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
-; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    [[TMP7:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 0
 ; CHECK-NEXT:    [[TMP9:%.*]] = add i32 [[SUM0]], 42
-; CHECK-NEXT:    [[SUM1_NONCHR:%.*]] = select i1 [[TMP8]], i32 [[SUM0]], i32 [[TMP9]], !prof !16
+; CHECK-NEXT:    [[SUM1_NONCHR:%.*]] = select i1 [[TMP8]], i32 [[SUM0]], i32 [[TMP9]], !prof !17
 ; CHECK-NEXT:    [[TMP10:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP11:%.*]] = icmp eq i32 [[TMP10]], 0
 ; CHECK-NEXT:    [[TMP12:%.*]] = add i32 [[SUM1_NONCHR]], 43
-; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[TMP11]], i32 [[SUM1_NONCHR]], i32 [[TMP12]], !prof !16
+; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[TMP11]], i32 [[SUM1_NONCHR]], i32 [[TMP12]], !prof !17
 ; CHECK-NEXT:    [[TMP13:%.*]] = and i32 [[TMP0]], 4
 ; CHECK-NEXT:    [[TMP14:%.*]] = icmp eq i32 [[TMP13]], 0
 ; CHECK-NEXT:    [[TMP15:%.*]] = and i32 [[TMP0]], 8
 ; CHECK-NEXT:    [[TMP16:%.*]] = icmp eq i32 [[TMP15]], 0
 ; CHECK-NEXT:    [[SUM4_NONCHR_V:%.*]] = select i1 [[TMP16]], i32 44, i32 88
 ; CHECK-NEXT:    [[SUM4_NONCHR:%.*]] = add i32 [[SUM2_NONCHR]], [[SUM4_NONCHR_V]]
-; CHECK-NEXT:    [[SUM5_NONCHR:%.*]] = select i1 [[TMP14]], i32 [[SUM2_NONCHR]], i32 [[SUM4_NONCHR]], !prof !16
+; CHECK-NEXT:    [[SUM5_NONCHR:%.*]] = select i1 [[TMP14]], i32 [[SUM2_NONCHR]], i32 [[SUM4_NONCHR]], !prof !17
 ; CHECK-NEXT:    br label [[BB3]]
 ; CHECK:       bb3:
 ; CHECK-NEXT:    [[SUM6:%.*]] = phi i32 [ [[TMP4]], [[BB0]] ], [ [[SUM0]], [[ENTRY_SPLIT_NONCHR]] ], [ [[SUM5_NONCHR]], [[BB0_NONCHR]] ]
@@ -482,27 +482,27 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 255
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb3, label %bb0, !prof !15
+  br i1 %2, label %bb3, label %bb0, !prof !16
 
 bb0:
   %3 = and i32 %0, 1
   %4 = icmp eq i32 %3, 0
   %5 = add i32 %sum0, 42
-  %sum1 = select i1 %4, i32 %sum0, i32 %5, !prof !15
+  %sum1 = select i1 %4, i32 %sum0, i32 %5, !prof !16
   %6 = and i32 %0, 2
   %7 = icmp eq i32 %6, 0
   %8 = add i32 %sum1, 43
-  %sum2 = select i1 %7, i32 %sum1, i32 %8, !prof !15
+  %sum2 = select i1 %7, i32 %sum1, i32 %8, !prof !16
   %9 = and i32 %0, 4
   %10 = icmp eq i32 %9, 0
-  br i1 %10, label %bb2, label %bb1, !prof !15
+  br i1 %10, label %bb2, label %bb1, !prof !16
 
 bb1:
   %sum3 = add i32 %sum2, 44
   %11 = and i32 %0, 8
   %12 = icmp eq i32 %11, 0
   %13 = add i32 %sum3, 44
-  %sum4 = select i1 %12, i32 %sum3, i32 %13, !prof !15
+  %sum4 = select i1 %12, i32 %sum3, i32 %13, !prof !16
   br label %bb2
 
 bb2:
@@ -539,7 +539,7 @@
 ;   }
 ; }
 ; return sum
-define i32 @test_chr_5_1(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_5_1(i32* %i, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_5_1(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
@@ -548,7 +548,7 @@
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i32 [[TMP0]], 11
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 11
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i1 [[TMP4]], [[TMP2]]
-; CHECK-NEXT:    br i1 [[TMP5]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP5]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    [[TMP6:%.*]] = add i32 [[SUM0]], 85
 ; CHECK-NEXT:    [[TMP7:%.*]] = add i32 [[SUM0]], 173
@@ -556,23 +556,23 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP8:%.*]] = and i32 [[TMP0]], 255
 ; CHECK-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 0
-; CHECK-NEXT:    br i1 [[TMP9]], label [[BB3]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP9]], label [[BB3]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    [[TMP10:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP11:%.*]] = icmp eq i32 [[TMP10]], 0
 ; CHECK-NEXT:    [[TMP12:%.*]] = add i32 [[SUM0]], 42
-; CHECK-NEXT:    [[SUM1_NONCHR:%.*]] = select i1 [[TMP11]], i32 [[SUM0]], i32 [[TMP12]], !prof !16
+; CHECK-NEXT:    [[SUM1_NONCHR:%.*]] = select i1 [[TMP11]], i32 [[SUM0]], i32 [[TMP12]], !prof !17
 ; CHECK-NEXT:    [[TMP13:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP14:%.*]] = icmp eq i32 [[TMP13]], 0
 ; CHECK-NEXT:    [[TMP15:%.*]] = add i32 [[SUM1_NONCHR]], 43
-; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[TMP14]], i32 [[SUM1_NONCHR]], i32 [[TMP15]], !prof !16
+; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[TMP14]], i32 [[SUM1_NONCHR]], i32 [[TMP15]], !prof !17
 ; CHECK-NEXT:    [[TMP16:%.*]] = and i32 [[SUM0]], 4
 ; CHECK-NEXT:    [[TMP17:%.*]] = icmp eq i32 [[TMP16]], 0
 ; CHECK-NEXT:    [[TMP18:%.*]] = and i32 [[TMP0]], 8
 ; CHECK-NEXT:    [[TMP19:%.*]] = icmp eq i32 [[TMP18]], 0
 ; CHECK-NEXT:    [[SUM4_NONCHR_V:%.*]] = select i1 [[TMP19]], i32 44, i32 88
 ; CHECK-NEXT:    [[SUM4_NONCHR:%.*]] = add i32 [[SUM2_NONCHR]], [[SUM4_NONCHR_V]]
-; CHECK-NEXT:    [[SUM5_NONCHR:%.*]] = select i1 [[TMP17]], i32 [[SUM2_NONCHR]], i32 [[SUM4_NONCHR]], !prof !16
+; CHECK-NEXT:    [[SUM5_NONCHR:%.*]] = select i1 [[TMP17]], i32 [[SUM2_NONCHR]], i32 [[SUM4_NONCHR]], !prof !17
 ; CHECK-NEXT:    br label [[BB3]]
 ; CHECK:       bb3:
 ; CHECK-NEXT:    [[SUM6:%.*]] = phi i32 [ [[TMP7]], [[BB0]] ], [ [[SUM0]], [[ENTRY_SPLIT_NONCHR]] ], [ [[SUM5_NONCHR]], [[BB0_NONCHR]] ]
@@ -582,27 +582,27 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 255
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb3, label %bb0, !prof !15
+  br i1 %2, label %bb3, label %bb0, !prof !16
 
 bb0:
   %3 = and i32 %0, 1
   %4 = icmp eq i32 %3, 0
   %5 = add i32 %sum0, 42
-  %sum1 = select i1 %4, i32 %sum0, i32 %5, !prof !15
+  %sum1 = select i1 %4, i32 %sum0, i32 %5, !prof !16
   %6 = and i32 %0, 2
   %7 = icmp eq i32 %6, 0
   %8 = add i32 %sum1, 43
-  %sum2 = select i1 %7, i32 %sum1, i32 %8, !prof !15
+  %sum2 = select i1 %7, i32 %sum1, i32 %8, !prof !16
   %9 = and i32 %sum0, 4                              ; Split
   %10 = icmp eq i32 %9, 0
-  br i1 %10, label %bb2, label %bb1, !prof !15
+  br i1 %10, label %bb2, label %bb1, !prof !16
 
 bb1:
   %sum3 = add i32 %sum2, 44
   %11 = and i32 %0, 8
   %12 = icmp eq i32 %11, 0
   %13 = add i32 %sum3, 44
-  %sum4 = select i1 %12, i32 %sum3, i32 %13, !prof !15
+  %sum4 = select i1 %12, i32 %sum3, i32 %13, !prof !16
   br label %bb2
 
 bb2:
@@ -639,7 +639,7 @@
 ;   }
 ; }
 ; return sum
-define i32 @test_chr_6(i32* %i, i32* %j, i32 %sum0) !prof !14 {
+define i32 @test_chr_6(i32* %i, i32* %j, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_6(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
@@ -649,7 +649,7 @@
 ; CHECK-NEXT:    [[TMP0:%.*]] = and i32 [[I0]], 10
 ; CHECK-NEXT:    [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 10
 ; CHECK-NEXT:    [[TMP2:%.*]] = and i1 [[TMP1]], [[V10]]
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    [[V8:%.*]] = add i32 [[SUM0:%.*]], 43
 ; CHECK-NEXT:    [[V13:%.*]] = add i32 [[SUM0]], 131
@@ -657,19 +657,19 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[V1:%.*]] = and i32 [[I0]], 255
 ; CHECK-NEXT:    [[V2:%.*]] = icmp eq i32 [[V1]], 0
-; CHECK-NEXT:    br i1 [[V2]], label [[BB3]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[V2]], label [[BB3]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    [[V3_NONCHR:%.*]] = and i32 [[I0]], 2
 ; CHECK-NEXT:    [[V4_NONCHR:%.*]] = icmp eq i32 [[V3_NONCHR]], 0
 ; CHECK-NEXT:    [[V8_NONCHR:%.*]] = add i32 [[SUM0]], 43
-; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[V4_NONCHR]], i32 [[SUM0]], i32 [[V8_NONCHR]], !prof !16
+; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[V4_NONCHR]], i32 [[SUM0]], i32 [[V8_NONCHR]], !prof !17
 ; CHECK-NEXT:    [[V9_NONCHR:%.*]] = and i32 [[J0]], 4
 ; CHECK-NEXT:    [[V10_NONCHR:%.*]] = icmp eq i32 [[V9_NONCHR]], 0
 ; CHECK-NEXT:    [[V11_NONCHR:%.*]] = and i32 [[I0]], 8
 ; CHECK-NEXT:    [[V12_NONCHR:%.*]] = icmp eq i32 [[V11_NONCHR]], 0
 ; CHECK-NEXT:    [[SUM4_NONCHR_V:%.*]] = select i1 [[V12_NONCHR]], i32 44, i32 88
 ; CHECK-NEXT:    [[SUM4_NONCHR:%.*]] = add i32 [[SUM2_NONCHR]], [[SUM4_NONCHR_V]]
-; CHECK-NEXT:    [[SUM5_NONCHR:%.*]] = select i1 [[V10_NONCHR]], i32 [[SUM2_NONCHR]], i32 [[SUM4_NONCHR]], !prof !16
+; CHECK-NEXT:    [[SUM5_NONCHR:%.*]] = select i1 [[V10_NONCHR]], i32 [[SUM2_NONCHR]], i32 [[SUM4_NONCHR]], !prof !17
 ; CHECK-NEXT:    br label [[BB3]]
 ; CHECK:       bb3:
 ; CHECK-NEXT:    [[SUM6:%.*]] = phi i32 [ [[V13]], [[BB0]] ], [ [[SUM0]], [[ENTRY_SPLIT_NONCHR]] ], [ [[SUM5_NONCHR]], [[BB0_NONCHR]] ]
@@ -680,23 +680,23 @@
   %j0 = load i32, i32* %j
   %v1 = and i32 %i0, 255
   %v2 = icmp eq i32 %v1, 0
-  br i1 %v2, label %bb3, label %bb0, !prof !15
+  br i1 %v2, label %bb3, label %bb0, !prof !16
 
 bb0:
   %v3 = and i32 %i0, 2
   %v4 = icmp eq i32 %v3, 0
   %v8 = add i32 %sum0, 43
-  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !15
+  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !16
   %v9 = and i32 %j0, 4
   %v10 = icmp eq i32 %v9, 0
-  br i1 %v10, label %bb2, label %bb1, !prof !15
+  br i1 %v10, label %bb2, label %bb1, !prof !16
 
 bb1:
   %sum3 = add i32 %sum2, 44
   %v11 = and i32 %i0, 8
   %v12 = icmp eq i32 %v11, 0
   %v13 = add i32 %sum3, 44
-  %sum4 = select i1 %v12, i32 %sum3, i32 %v13, !prof !15
+  %sum4 = select i1 %v12, i32 %sum3, i32 %v13, !prof !16
   br label %bb2
 
 bb2:
@@ -722,19 +722,19 @@
 ; return sum
 ; ->
 ; (no change)
-define i32 @test_chr_7(i32* %i, i32* %j, i32 %sum0) !prof !14 {
+define i32 @test_chr_7(i32* %i, i32* %j, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_7(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[V3:%.*]] = and i32 [[I0]], 2
 ; CHECK-NEXT:    [[V4:%.*]] = icmp eq i32 [[V3]], 0
 ; CHECK-NEXT:    [[V8:%.*]] = add i32 [[SUM0:%.*]], 43
-; CHECK-NEXT:    [[SUM2:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof !16
+; CHECK-NEXT:    [[SUM2:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof !17
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[J0:%.*]] = load i32, i32* [[J:%.*]], align 4
 ; CHECK-NEXT:    [[V9:%.*]] = and i32 [[J0]], 4
 ; CHECK-NEXT:    [[V10:%.*]] = icmp eq i32 [[V9]], 0
-; CHECK-NEXT:    br i1 [[V10]], label [[BB2:%.*]], label [[BB1:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[V10]], label [[BB2:%.*]], label [[BB1:%.*]], !prof !17
 ; CHECK:       bb1:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[SUM4:%.*]] = add i32 [[SUM2]], 44
@@ -748,12 +748,12 @@
   %v3 = and i32 %i0, 2
   %v4 = icmp eq i32 %v3, 0
   %v8 = add i32 %sum0, 43
-  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !15
+  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !16
   call void @foo()
   %j0 = load i32, i32* %j
   %v9 = and i32 %j0, 4
   %v10 = icmp eq i32 %v9, 0
-  br i1 %v10, label %bb2, label %bb1, !prof !15    ; %v10 can't be hoisted above the above select
+  br i1 %v10, label %bb2, label %bb1, !prof !16    ; %v10 can't be hoisted above the above select
 
 bb1:
   call void @foo()
@@ -792,19 +792,19 @@
 ;     foo()
 ; }
 ; return sum
-define i32 @test_chr_7_1(i32* %i, i32* %j, i32 %sum0) !prof !14 {
+define i32 @test_chr_7_1(i32* %i, i32* %j, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_7_1(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[V3:%.*]] = and i32 [[I0]], 2
 ; CHECK-NEXT:    [[V4:%.*]] = icmp eq i32 [[V3]], 0
 ; CHECK-NEXT:    [[V8:%.*]] = add i32 [[SUM0:%.*]], 43
-; CHECK-NEXT:    [[SUM2:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof !16
+; CHECK-NEXT:    [[SUM2:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof !17
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[J0:%.*]] = load i32, i32* [[J:%.*]], align 4
 ; CHECK-NEXT:    [[TMP0:%.*]] = and i32 [[J0]], 12
 ; CHECK-NEXT:    [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 12
-; CHECK-NEXT:    br i1 [[TMP1]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP1]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    call void @foo()
@@ -812,14 +812,14 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[V9:%.*]] = and i32 [[J0]], 4
 ; CHECK-NEXT:    [[V10:%.*]] = icmp eq i32 [[V9]], 0
-; CHECK-NEXT:    br i1 [[V10]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[V10]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1_NONCHR]]
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    [[V11_NONCHR:%.*]] = and i32 [[J0]], 8
 ; CHECK-NEXT:    [[V12_NONCHR:%.*]] = icmp eq i32 [[V11_NONCHR]], 0
-; CHECK-NEXT:    br i1 [[V12_NONCHR]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[V12_NONCHR]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB3]]
@@ -831,12 +831,12 @@
   %v3 = and i32 %i0, 2
   %v4 = icmp eq i32 %v3, 0
   %v8 = add i32 %sum0, 43
-  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !15
+  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !16
   call void @foo()
   %j0 = load i32, i32* %j
   %v9 = and i32 %j0, 4
   %v10 = icmp eq i32 %v9, 0
-  br i1 %v10, label %bb1, label %bb0, !prof !15    ; %v10 can't be hoisted above the above select
+  br i1 %v10, label %bb1, label %bb0, !prof !16    ; %v10 can't be hoisted above the above select
 
 bb0:
   call void @foo()
@@ -845,7 +845,7 @@
 bb1:
   %v11 = and i32 %j0, 8
   %v12 = icmp eq i32 %v11, 0
-  br i1 %v12, label %bb3, label %bb2, !prof !15
+  br i1 %v12, label %bb3, label %bb2, !prof !16
 
 bb2:
   call void @foo()
@@ -864,20 +864,20 @@
 ;   foo()
 ; ->
 ; (no change)
-define void @test_chr_8(i32* %i) !prof !14 {
+define void @test_chr_8(i32* %i) !prof !15 {
 ; CHECK-LABEL: @test_chr_8(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB1:%.*]], label [[BB0:%.*]], !prof !17
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB1:%.*]], label [[BB0:%.*]], !prof !18
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1]]
 ; CHECK:       bb1:
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 0
-; CHECK-NEXT:    br i1 [[TMP4]], label [[BB3:%.*]], label [[BB2:%.*]], !prof !17
+; CHECK-NEXT:    br i1 [[TMP4]], label [[BB3:%.*]], label [[BB2:%.*]], !prof !18
 ; CHECK:       bb2:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB3]]
@@ -888,7 +888,7 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !16
+  br i1 %2, label %bb1, label %bb0, !prof !17
 
 bb0:
   call void @foo()
@@ -897,7 +897,7 @@
 bb1:
   %3 = and i32 %0, 2
   %4 = icmp eq i32 %3, 0
-  br i1 %4, label %bb3, label %bb2, !prof !16
+  br i1 %4, label %bb3, label %bb2, !prof !17
 
 bb2:
   call void @foo()
@@ -934,13 +934,13 @@
 ; }
 ; // There's a phi for t here.
 ; return t
-define i32 @test_chr_9(i32* %i, i32* %j) !prof !14 {
+define i32 @test_chr_9(i32* %i, i32* %j) !prof !15 {
 ; CHECK-LABEL: @test_chr_9(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 3
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[TMP3:%.*]] = load i32, i32* [[J:%.*]], align 4
@@ -949,14 +949,14 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP4:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP5:%.*]] = icmp eq i32 [[TMP4]], 0
-; CHECK-NEXT:    br i1 [[TMP5]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP5]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1_NONCHR]]
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    [[TMP6:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0
-; CHECK-NEXT:    br i1 [[TMP7]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP7]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    [[TMP8:%.*]] = load i32, i32* [[J]], align 4
 ; CHECK-NEXT:    call void @foo()
@@ -969,7 +969,7 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !15
+  br i1 %2, label %bb1, label %bb0, !prof !16
 
 bb0:
   call void @foo()
@@ -978,7 +978,7 @@
 bb1:
   %3 = and i32 %0, 2
   %4 = icmp eq i32 %3, 0
-  br i1 %4, label %bb3, label %bb2, !prof !15
+  br i1 %4, label %bb3, label %bb2, !prof !16
 
 bb2:
   %5 = load i32, i32* %j
@@ -1015,13 +1015,13 @@
 ; }
 ; // A new phi for t1 is inserted here.
 ; return (t1 * 42) - (t1 - 99)
-define i32 @test_chr_10(i32* %i, i32* %j) !prof !14 {
+define i32 @test_chr_10(i32* %i, i32* %j) !prof !15 {
 ; CHECK-LABEL: @test_chr_10(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 3
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[TMP3:%.*]] = load i32, i32* [[J:%.*]], align 4
@@ -1030,7 +1030,7 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP4:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP5:%.*]] = icmp eq i32 [[TMP4]], 0
-; CHECK-NEXT:    br i1 [[TMP5]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP5]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1_NONCHR]]
@@ -1038,7 +1038,7 @@
 ; CHECK-NEXT:    [[TMP6:%.*]] = load i32, i32* [[J]], align 4
 ; CHECK-NEXT:    [[TMP7:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 0
-; CHECK-NEXT:    br i1 [[TMP8]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP8]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB3]]
@@ -1053,7 +1053,7 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !15
+  br i1 %2, label %bb1, label %bb0, !prof !16
 
 bb0:
   call void @foo()
@@ -1063,7 +1063,7 @@
   %3 = load i32, i32* %j
   %4 = and i32 %0, 2
   %5 = icmp eq i32 %4, 0
-  br i1 %5, label %bb3, label %bb2, !prof !15
+  br i1 %5, label %bb3, label %bb2, !prof !16
 
 bb2:
   call void @foo()
@@ -1105,7 +1105,7 @@
 ;   if ((1.0 / t0) * t0 < 1) // Likely true
 ;     foo()
 ; }
-define void @test_chr_11(i32* %i, i32 %x) !prof !14 {
+define void @test_chr_11(i32* %i, i32 %x) !prof !15 {
 ; CHECK-LABEL: @test_chr_11(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
@@ -1117,13 +1117,13 @@
 ; CHECK-NEXT:    [[CONV717:%.*]] = fptosi double [[MUL16]] to i32
 ; CHECK-NEXT:    [[CMP18:%.*]] = icmp sgt i32 [[CONV717]], 0
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i1 [[TMP2]], [[CMP18]]
-; CHECK-NEXT:    br i1 [[TMP3]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP3]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB3:%.*]]
 ; CHECK:       entry.split.nonchr:
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0_NONCHR:%.*]], label [[BB1_NONCHR:%.*]], !prof !18
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0_NONCHR:%.*]], label [[BB1_NONCHR:%.*]], !prof !19
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1_NONCHR]]
@@ -1133,7 +1133,7 @@
 ; CHECK-NEXT:    [[MUL16_NONCHR:%.*]] = fmul double [[DIV_NONCHR]], [[CONV_NONCHR]]
 ; CHECK-NEXT:    [[CONV717_NONCHR:%.*]] = fptosi double [[MUL16_NONCHR]] to i32
 ; CHECK-NEXT:    [[CMP18_NONCHR:%.*]] = icmp slt i32 [[CONV717_NONCHR]], 1
-; CHECK-NEXT:    br i1 [[CMP18_NONCHR]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[CMP18_NONCHR]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB3]]
@@ -1144,7 +1144,7 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !15
+  br i1 %2, label %bb1, label %bb0, !prof !16
 
 bb0:
   call void @foo()
@@ -1156,7 +1156,7 @@
   %mul16 = fmul double %div, %conv
   %conv717 = fptosi double %mul16 to i32
   %cmp18 = icmp slt i32 %conv717, 1
-  br i1 %cmp18, label %bb3, label %bb2, !prof !15
+  br i1 %cmp18, label %bb3, label %bb2, !prof !16
 
 bb2:
   call void @foo()
@@ -1167,37 +1167,37 @@
 }
 
 ; Selects + unrelated br only
-define i32 @test_chr_12(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_12(i32* %i, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_12(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 255
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB3:%.*]], label [[BB0:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB3:%.*]], label [[BB0:%.*]], !prof !17
 ; CHECK:       bb0:
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 0
 ; CHECK-NEXT:    [[TMP5:%.*]] = add i32 [[SUM0:%.*]], 42
-; CHECK-NEXT:    [[SUM1:%.*]] = select i1 [[TMP4]], i32 [[SUM0]], i32 [[TMP5]], !prof !16
+; CHECK-NEXT:    [[SUM1:%.*]] = select i1 [[TMP4]], i32 [[SUM0]], i32 [[TMP5]], !prof !17
 ; CHECK-NEXT:    [[TMP6:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0
 ; CHECK-NEXT:    [[TMP8:%.*]] = add i32 [[SUM1]], 43
-; CHECK-NEXT:    [[SUM2:%.*]] = select i1 [[TMP7]], i32 [[SUM1]], i32 [[TMP8]], !prof !16
+; CHECK-NEXT:    [[SUM2:%.*]] = select i1 [[TMP7]], i32 [[SUM1]], i32 [[TMP8]], !prof !17
 ; CHECK-NEXT:    [[TMP9:%.*]] = load i32, i32* [[I]], align 4
 ; CHECK-NEXT:    [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
 ; CHECK-NEXT:    [[TMP11:%.*]] = and i32 [[TMP0]], 8
 ; CHECK-NEXT:    [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
 ; CHECK-NEXT:    [[TMP13:%.*]] = and i1 [[TMP10]], [[TMP12]]
-; CHECK-NEXT:    br i1 [[TMP13]], label [[BB1:%.*]], label [[BB0_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP13]], label [[BB1:%.*]], label [[BB0_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb1:
 ; CHECK-NEXT:    [[TMP14:%.*]] = add i32 [[SUM2]], 88
 ; CHECK-NEXT:    br label [[BB3]]
 ; CHECK:       bb0.split.nonchr:
-; CHECK-NEXT:    br i1 [[TMP10]], label [[BB1_NONCHR:%.*]], label [[BB3]], !prof !18
+; CHECK-NEXT:    br i1 [[TMP10]], label [[BB1_NONCHR:%.*]], label [[BB3]], !prof !19
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    [[TMP15:%.*]] = and i32 [[TMP0]], 8
 ; CHECK-NEXT:    [[TMP16:%.*]] = icmp eq i32 [[TMP15]], 0
-; CHECK-NEXT:    [[SUM4_NONCHR_V:%.*]] = select i1 [[TMP16]], i32 44, i32 88, !prof !16
+; CHECK-NEXT:    [[SUM4_NONCHR_V:%.*]] = select i1 [[TMP16]], i32 44, i32 88, !prof !17
 ; CHECK-NEXT:    [[SUM4_NONCHR:%.*]] = add i32 [[SUM2]], [[SUM4_NONCHR_V]]
 ; CHECK-NEXT:    br label [[BB3]]
 ; CHECK:       bb3:
@@ -1208,27 +1208,27 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 255
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb3, label %bb0, !prof !15
+  br i1 %2, label %bb3, label %bb0, !prof !16
 
 bb0:
   %3 = and i32 %0, 1
   %4 = icmp eq i32 %3, 0
   %5 = add i32 %sum0, 42
-  %sum1 = select i1 %4, i32 %sum0, i32 %5, !prof !15
+  %sum1 = select i1 %4, i32 %sum0, i32 %5, !prof !16
   %6 = and i32 %0, 2
   %7 = icmp eq i32 %6, 0
   %8 = add i32 %sum1, 43
-  %sum2 = select i1 %7, i32 %sum1, i32 %8, !prof !15
+  %sum2 = select i1 %7, i32 %sum1, i32 %8, !prof !16
   %9 = load i32, i32* %i
   %10 = icmp eq i32 %9, 0
-  br i1 %10, label %bb2, label %bb1, !prof !15
+  br i1 %10, label %bb2, label %bb1, !prof !16
 
 bb1:
   %sum3 = add i32 %sum2, 44
   %11 = and i32 %0, 8
   %12 = icmp eq i32 %11, 0
   %13 = add i32 %sum3, 44
-  %sum4 = select i1 %12, i32 %sum3, i32 %13, !prof !15
+  %sum4 = select i1 %12, i32 %sum3, i32 %13, !prof !16
   br label %bb2
 
 bb2:
@@ -1273,7 +1273,7 @@
 ;     foo()
 ; }
 ; return i0 + sum3
-define i32 @test_chr_14(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !14 {
+define i32 @test_chr_14(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !15 {
 ; CHECK-LABEL: @test_chr_14(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
@@ -1281,7 +1281,7 @@
 ; CHECK-NEXT:    [[V0:%.*]] = icmp eq i32 [[Z]], 0
 ; CHECK-NEXT:    [[V3_NONCHR:%.*]] = and i1 [[V0]], [[PRED:%.*]]
 ; CHECK-NEXT:    [[OR_COND:%.*]] = and i1 [[V1]], [[V3_NONCHR]]
-; CHECK-NEXT:    br i1 [[OR_COND]], label [[BB0_NONCHR:%.*]], label [[BB1:%.*]], !prof !19
+; CHECK-NEXT:    br i1 [[OR_COND]], label [[BB0_NONCHR:%.*]], label [[BB1:%.*]], !prof !20
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1]]
@@ -1292,7 +1292,7 @@
 ; CHECK-NEXT:    [[V8:%.*]] = add i32 [[SUM0:%.*]], 43
 ; CHECK-NEXT:    [[V5:%.*]] = icmp ne i32 [[I0]], [[J0]]
 ; CHECK-NEXT:    [[TMP0:%.*]] = and i1 [[V4]], [[V5]]
-; CHECK-NEXT:    br i1 [[TMP0]], label [[BB1_SPLIT:%.*]], label [[BB1_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP0]], label [[BB1_SPLIT:%.*]], label [[BB1_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb1.split:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[V9:%.*]] = and i32 [[I0]], 4
@@ -1303,7 +1303,7 @@
 ; CHECK-NEXT:    br label [[BB3]]
 ; CHECK:       bb1.split.nonchr:
 ; CHECK-NEXT:    [[V5_NONCHR:%.*]] = icmp eq i32 [[I0]], [[J0]]
-; CHECK-NEXT:    [[SUM3_NONCHR:%.*]] = select i1 [[V5_NONCHR]], i32 [[SUM0]], i32 [[V8]], !prof !16
+; CHECK-NEXT:    [[SUM3_NONCHR:%.*]] = select i1 [[V5_NONCHR]], i32 [[SUM0]], i32 [[V8]], !prof !17
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[V9_NONCHR:%.*]] = and i32 [[I0]], 4
 ; CHECK-NEXT:    [[V10_NONCHR:%.*]] = icmp eq i32 [[V9_NONCHR]], 0
@@ -1320,9 +1320,9 @@
   %i0 = load i32, i32* %i
   %v0 = icmp eq i32 %z, 0
   %v1 = icmp ne i32 %z, 1
-  %v2 = select i1 %v1, i1 %pred, i1 true, !prof !15
+  %v2 = select i1 %v1, i1 %pred, i1 true, !prof !16
   %v3 = and i1 %v0, %pred
-  br i1 %v3, label %bb0, label %bb1, !prof !15
+  br i1 %v3, label %bb0, label %bb1, !prof !16
 
 bb0:
   call void @foo()
@@ -1333,9 +1333,9 @@
   %v6 = and i32 %i0, 2
   %v4 = icmp eq i32 %v6, %j0
   %v8 = add i32 %sum0, 43
-  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !15
+  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !16
   %v5 = icmp eq i32 %i0, %j0
-  %sum3 = select i1 %v5, i32 %sum0, i32 %v8, !prof !15
+  %sum3 = select i1 %v5, i32 %sum0, i32 %v8, !prof !16
   call void @foo()
   %v9 = and i32 %i0, 4
   %v10 = icmp eq i32 %v9, 0
@@ -1365,13 +1365,13 @@
 ; return i0 + sum3
 ; ->
 ; (no change)
-define i32 @test_chr_15(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !14 {
+define i32 @test_chr_15(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !15 {
 ; CHECK-LABEL: @test_chr_15(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[V0:%.*]] = icmp eq i32 [[Z:%.*]], 0
 ; CHECK-NEXT:    [[V3:%.*]] = and i1 [[V0]], [[PRED:%.*]]
-; CHECK-NEXT:    br i1 [[V3]], label [[BB0:%.*]], label [[BB1:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[V3]], label [[BB0:%.*]], label [[BB1:%.*]], !prof !17
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1]]
@@ -1380,9 +1380,9 @@
 ; CHECK-NEXT:    [[V6:%.*]] = and i32 [[I0]], 2
 ; CHECK-NEXT:    [[V4:%.*]] = icmp eq i32 [[V6]], [[J0]]
 ; CHECK-NEXT:    [[V8:%.*]] = add i32 [[SUM0:%.*]], 43
-; CHECK-NEXT:    [[SUM2:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof !16
+; CHECK-NEXT:    [[SUM2:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof !17
 ; CHECK-NEXT:    [[V5:%.*]] = icmp eq i32 [[I0]], [[SUM2]]
-; CHECK-NEXT:    [[SUM3:%.*]] = select i1 [[V5]], i32 [[SUM2]], i32 [[V8]], !prof !16
+; CHECK-NEXT:    [[SUM3:%.*]] = select i1 [[V5]], i32 [[SUM2]], i32 [[V8]], !prof !17
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[V9:%.*]] = and i32 [[I0]], 4
 ; CHECK-NEXT:    [[V10:%.*]] = icmp eq i32 [[V9]], 0
@@ -1398,9 +1398,9 @@
   %i0 = load i32, i32* %i
   %v0 = icmp eq i32 %z, 0
   %v1 = icmp ne i32 %z, 1
-  %v2 = select i1 %v1, i1 %pred, i1 true, !prof !15
+  %v2 = select i1 %v1, i1 %pred, i1 true, !prof !16
   %v3 = and i1 %v0, %v2
-  br i1 %v3, label %bb0, label %bb1, !prof !15
+  br i1 %v3, label %bb0, label %bb1, !prof !16
 
 bb0:
   call void @foo()
@@ -1411,9 +1411,9 @@
   %v6 = and i32 %i0, 2
   %v4 = icmp eq i32 %v6, %j0
   %v8 = add i32 %sum0, 43
-  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !15
+  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !16
   %v5 = icmp eq i32 %i0, %sum2
-  %sum3 = select i1 %v5, i32 %sum2, i32 %v8, !prof !15
+  %sum3 = select i1 %v5, i32 %sum2, i32 %v8, !prof !16
   call void @foo()
   %v9 = and i32 %i0, 4
   %v10 = icmp eq i32 %v9, 0
@@ -1461,13 +1461,13 @@
 ; v42 = phi v41, v41_nc
 ; v43 = v42 + t7
 ; return v43
-define i32 @test_chr_16(i32* %i) !prof !14 {
+define i32 @test_chr_16(i32* %i) !prof !15 {
 ; CHECK-LABEL: @test_chr_16(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 3
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[V40:%.*]] = add i32 [[TMP0]], 44
@@ -1477,7 +1477,7 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP3:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 0
-; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1_NONCHR:%.*]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB1_NONCHR]]
@@ -1485,7 +1485,7 @@
 ; CHECK-NEXT:    [[V40_NONCHR:%.*]] = add i32 [[TMP0]], 44
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i32 [[TMP0]], 2
 ; CHECK-NEXT:    [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
-; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof !17
 ; CHECK:       bb2.nonchr:
 ; CHECK-NEXT:    [[V41_NONCHR:%.*]] = add i32 [[TMP0]], 99
 ; CHECK-NEXT:    call void @foo()
@@ -1500,7 +1500,7 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !15
+  br i1 %2, label %bb1, label %bb0, !prof !16
 
 bb0:
   call void @foo()
@@ -1510,7 +1510,7 @@
   %v40 = add i32 %0, 44
   %3 = and i32 %0, 2
   %4 = icmp eq i32 %3, 0
-  br i1 %4, label %bb3, label %bb2, !prof !15
+  br i1 %4, label %bb3, label %bb2, !prof !16
 
 bb2:
   %v41 = add i32 %0, 99
@@ -1544,7 +1544,7 @@
 ; return r
 ; ->
 ; (no change)
-define i32 @test_chr_17(i32 %i, i1 %j) !prof !14 {
+define i32 @test_chr_17(i32 %i, i1 %j) !prof !15 {
 ; CHECK-LABEL: @test_chr_17(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[V0:%.*]] = and i32 [[I:%.*]], 4
@@ -1555,7 +1555,7 @@
 ; CHECK:       bbe:
 ; CHECK-NEXT:    [[TMP0:%.*]] = and i32 [[I]], 1
 ; CHECK-NEXT:    [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 0
-; CHECK-NEXT:    br i1 [[TMP1]], label [[BB1]], label [[BB0:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP1]], label [[BB1]], label [[BB0:%.*]], !prof !17
 ; CHECK:       bb0:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[S:%.*]] = add i32 [[TMP0]], [[I]]
@@ -1564,7 +1564,7 @@
 ; CHECK-NEXT:    [[P:%.*]] = phi i32 [ [[I]], [[BBQ]] ], [ [[TMP0]], [[BBE]] ], [ [[S]], [[BB0]] ]
 ; CHECK-NEXT:    [[TMP2:%.*]] = and i32 [[I]], 2
 ; CHECK-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0
-; CHECK-NEXT:    br i1 [[TMP3]], label [[BB3]], label [[BB2:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP3]], label [[BB3]], label [[BB2:%.*]], !prof !17
 ; CHECK:       bb2:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    [[Q:%.*]] = add i32 [[P]], [[TMP2]]
@@ -1584,7 +1584,7 @@
 bbe:
   %0 = and i32 %i, 1
   %1 = icmp eq i32 %0, 0
-  br i1 %1, label %bb1, label %bb0, !prof !15
+  br i1 %1, label %bb1, label %bb0, !prof !16
 
 bb0:
   call void @foo()
@@ -1595,7 +1595,7 @@
   %p = phi i32 [ %i, %bbq ], [ %0, %bbe ], [ %s, %bb0 ]
   %2 = and i32 %i, 2
   %3 = icmp eq i32 %2, 0
-  br i1 %3, label %bb3, label %bb2, !prof !15
+  br i1 %3, label %bb3, label %bb2, !prof !16
 
 bb2:
   call void @foo()
@@ -1639,7 +1639,7 @@
 ;   sum4 = phi sum3, sum3_nc, sum1
 ; } while (tmp2 != 100)
 ; return sum4
-define i32 @test_chr_18(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_18(i32* %i, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_18(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[BB0:%.*]]
@@ -1649,7 +1649,7 @@
 ; CHECK-NEXT:    [[SUM1:%.*]] = add i32 [[SUM0:%.*]], 42
 ; CHECK-NEXT:    [[TMP0:%.*]] = and i32 [[LI]], 5
 ; CHECK-NEXT:    [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 5
-; CHECK-NEXT:    br i1 [[TMP1]], label [[BB0_SPLIT:%.*]], label [[BB0_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP1]], label [[BB0_SPLIT:%.*]], label [[BB0_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0.split:
 ; CHECK-NEXT:    [[INC2:%.*]] = add i32 [[INC1]], 1
 ; CHECK-NEXT:    [[SUM3:%.*]] = add i32 [[SUM0]], 86
@@ -1658,18 +1658,18 @@
 ; CHECK-NEXT:    [[A4_NONCHR:%.*]] = and i32 [[LI]], 4
 ; CHECK-NEXT:    [[CMP4_NONCHR:%.*]] = icmp eq i32 [[A4_NONCHR]], 0
 ; CHECK-NEXT:    [[INC2_NONCHR:%.*]] = add i32 [[INC1]], 1
-; CHECK-NEXT:    br i1 [[CMP4_NONCHR]], label [[BB2]], label [[BB1_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[CMP4_NONCHR]], label [[BB2]], label [[BB1_NONCHR:%.*]], !prof !17
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    [[A1:%.*]] = and i32 [[LI]], 1
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp eq i32 [[A1]], 0
-; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[CMP1]], i32 [[SUM0]], i32 [[SUM1]], !prof !16
+; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[CMP1]], i32 [[SUM0]], i32 [[SUM1]], !prof !17
 ; CHECK-NEXT:    [[SUM3_NONCHR:%.*]] = add i32 [[SUM2_NONCHR]], 44
 ; CHECK-NEXT:    br label [[BB2]]
 ; CHECK:       bb2:
 ; CHECK-NEXT:    [[TMP2]] = phi i32 [ [[INC2]], [[BB0_SPLIT]] ], [ [[INC2_NONCHR]], [[BB1_NONCHR]] ], [ [[INC2_NONCHR]], [[BB0_SPLIT_NONCHR]] ]
 ; CHECK-NEXT:    [[SUM4:%.*]] = phi i32 [ [[SUM3]], [[BB0_SPLIT]] ], [ [[SUM3_NONCHR]], [[BB1_NONCHR]] ], [ [[SUM1]], [[BB0_SPLIT_NONCHR]] ]
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i32 [[TMP2]], 100
-; CHECK-NEXT:    br i1 [[CMP]], label [[BB3:%.*]], label [[BB0]], !prof !16
+; CHECK-NEXT:    br i1 [[CMP]], label [[BB3:%.*]], label [[BB0]], !prof !17
 ; CHECK:       bb3:
 ; CHECK-NEXT:    ret i32 [[SUM4]]
 ;
@@ -1682,11 +1682,11 @@
   %a1 = and i32 %li, 1
   %cmp1 = icmp eq i32 %a1, 0
   %sum1 = add i32 %sum0, 42
-  %sum2 = select i1 %cmp1, i32 %sum0, i32 %sum1, !prof !15
+  %sum2 = select i1 %cmp1, i32 %sum0, i32 %sum1, !prof !16
   %a4 = and i32 %li, 4
   %cmp4 = icmp eq i32 %a4, 0
   %inc2 = add i32 %inc1, 1
-  br i1 %cmp4, label %bb2, label %bb1, !prof !15
+  br i1 %cmp4, label %bb2, label %bb1, !prof !16
 
 bb1:
   %sum3 = add i32 %sum2, 44
@@ -1695,7 +1695,7 @@
 bb2:
   %sum4 = phi i32 [ %sum1, %bb0 ], [ %sum3, %bb1 ]
   %cmp = icmp eq i32 %inc2, 100
-  br i1 %cmp, label %bb3, label %bb0, !prof !15
+  br i1 %cmp, label %bb3, label %bb0, !prof !16
 
 bb3:
   ret i32 %sum4
@@ -1731,13 +1731,13 @@
 ; }
 ; sum6 = phi tmp4, sum0, sum2_nc, sum4_nc
 ; return sum6
-define i32 @test_chr_19(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_19(i32* %i, i32 %sum0) !prof !15 {
 ; CHECK-LABEL: @test_chr_19(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TMP0]], 9
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 9
-; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb0:
 ; CHECK-NEXT:    [[TMP3:%.*]] = add i32 [[SUM0:%.*]], 85
 ; CHECK-NEXT:    [[TMP4:%.*]] = add i32 [[SUM0]], 173
@@ -1745,17 +1745,17 @@
 ; CHECK:       entry.split.nonchr:
 ; CHECK-NEXT:    [[TMP5:%.*]] = and i32 [[TMP0]], 255
 ; CHECK-NEXT:    [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
-; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB0_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[TMP6]], label [[BB3]], label [[BB0_NONCHR:%.*]], !prof !17
 ; CHECK:       bb0.nonchr:
 ; CHECK-NEXT:    [[TMP7:%.*]] = and i32 [[TMP0]], 1
 ; CHECK-NEXT:    [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 0
 ; CHECK-NEXT:    [[TMP9:%.*]] = add i32 [[SUM0]], 85
-; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[TMP8]], i32 [[SUM0]], i32 [[TMP9]], !prof !16
+; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[TMP8]], i32 [[SUM0]], i32 [[TMP9]], !prof !17
 ; CHECK-NEXT:    [[TMP10:%.*]] = and i32 [[TMP0]], 8
 ; CHECK-NEXT:    [[TMP11:%.*]] = icmp eq i32 [[TMP10]], 0
 ; CHECK-NEXT:    [[SUM4_NONCHR_V:%.*]] = select i1 [[TMP11]], i32 44, i32 88
 ; CHECK-NEXT:    [[SUM4_NONCHR:%.*]] = add i32 [[SUM2_NONCHR]], [[SUM4_NONCHR_V]]
-; CHECK-NEXT:    [[SUM5_NONCHR:%.*]] = select i1 [[TMP8]], i32 [[SUM2_NONCHR]], i32 [[SUM4_NONCHR]], !prof !16
+; CHECK-NEXT:    [[SUM5_NONCHR:%.*]] = select i1 [[TMP8]], i32 [[SUM2_NONCHR]], i32 [[SUM4_NONCHR]], !prof !17
 ; CHECK-NEXT:    br label [[BB3]]
 ; CHECK:       bb3:
 ; CHECK-NEXT:    [[SUM6:%.*]] = phi i32 [ [[TMP4]], [[BB0]] ], [ [[SUM0]], [[ENTRY_SPLIT_NONCHR]] ], [ [[SUM5_NONCHR]], [[BB0_NONCHR]] ]
@@ -1765,23 +1765,23 @@
   %0 = load i32, i32* %i
   %1 = and i32 %0, 255
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb3, label %bb0, !prof !15
+  br i1 %2, label %bb3, label %bb0, !prof !16
 
 bb0:
   %3 = and i32 %0, 1
   %4 = icmp eq i32 %3, 0
   %5 = add i32 %sum0, 42
-  %sum1 = select i1 %4, i32 %sum0, i32 %5, !prof !15
+  %sum1 = select i1 %4, i32 %sum0, i32 %5, !prof !16
   %6 = add i32 %sum1, 43
-  %sum2 = select i1 %4, i32 %sum1, i32 %6, !prof !15
-  br i1 %4, label %bb2, label %bb1, !prof !15
+  %sum2 = select i1 %4, i32 %sum1, i32 %6, !prof !16
+  br i1 %4, label %bb2, label %bb1, !prof !16
 
 bb1:
   %sum3 = add i32 %sum2, 44
   %7 = and i32 %0, 8
   %8 = icmp eq i32 %7, 0
   %9 = add i32 %sum3, 44
-  %sum4 = select i1 %8, i32 %sum3, i32 %9, !prof !15
+  %sum4 = select i1 %8, i32 %sum3, i32 %9, !prof !16
   br label %bb2
 
 bb2:
@@ -1826,13 +1826,13 @@
 ; i5 = *i
 ; v13 = (i5 == 44) ? 44 : t2
 ; return v13
-define i32 @test_chr_20(i32* %i, i32 %sum0, i1 %j) !prof !14 {
+define i32 @test_chr_20(i32* %i, i32 %sum0, i1 %j) !prof !15 {
 ; CHECK-LABEL: @test_chr_20(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
 ; CHECK-NEXT:    [[TMP0:%.*]] = and i32 [[I0]], 6
 ; CHECK-NEXT:    [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 6
-; CHECK-NEXT:    br i1 [[TMP1]], label [[ENTRY_SPLIT:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP1]], label [[ENTRY_SPLIT:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       entry.split:
 ; CHECK-NEXT:    [[V9:%.*]] = add i32 [[SUM0:%.*]], 87
 ; CHECK-NEXT:    br i1 [[J:%.*]], label [[BB1:%.*]], label [[BB4:%.*]]
@@ -1843,11 +1843,11 @@
 ; CHECK-NEXT:    [[V8:%.*]] = add i32 [[SUM0]], 43
 ; CHECK-NEXT:    [[V3:%.*]] = and i32 [[I0]], 2
 ; CHECK-NEXT:    [[V4:%.*]] = icmp eq i32 [[V3]], 0
-; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof !16
+; CHECK-NEXT:    [[SUM2_NONCHR:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof !17
 ; CHECK-NEXT:    [[V6_NONCHR:%.*]] = and i32 [[I0]], 4
 ; CHECK-NEXT:    [[V5_NONCHR:%.*]] = icmp eq i32 [[V6_NONCHR]], 0
 ; CHECK-NEXT:    [[V9_NONCHR:%.*]] = add i32 [[SUM2_NONCHR]], 44
-; CHECK-NEXT:    [[SUM3_NONCHR:%.*]] = select i1 [[V5_NONCHR]], i32 [[SUM2_NONCHR]], i32 [[V9_NONCHR]], !prof !16
+; CHECK-NEXT:    [[SUM3_NONCHR:%.*]] = select i1 [[V5_NONCHR]], i32 [[SUM2_NONCHR]], i32 [[V9_NONCHR]], !prof !17
 ; CHECK-NEXT:    br i1 [[J]], label [[BB1_NONCHR:%.*]], label [[BB4]]
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    call void @foo()
@@ -1856,7 +1856,7 @@
 ; CHECK-NEXT:    [[TMP2:%.*]] = phi i32 [ [[V9]], [[BB1]] ], [ [[V9]], [[ENTRY_SPLIT]] ], [ [[SUM3_NONCHR]], [[BB1_NONCHR]] ], [ [[SUM3_NONCHR]], [[ENTRY_SPLIT_NONCHR]] ]
 ; CHECK-NEXT:    [[I5:%.*]] = load i32, i32* [[I]], align 4
 ; CHECK-NEXT:    [[V12:%.*]] = icmp eq i32 [[I5]], 44
-; CHECK-NEXT:    [[V13:%.*]] = select i1 [[V12]], i32 44, i32 [[TMP2]], !prof !16
+; CHECK-NEXT:    [[V13:%.*]] = select i1 [[V12]], i32 44, i32 [[TMP2]], !prof !17
 ; CHECK-NEXT:    ret i32 [[V13]]
 ;
 entry:
@@ -1864,11 +1864,11 @@
   %v3 = and i32 %i0, 2
   %v4 = icmp eq i32 %v3, 0
   %v8 = add i32 %sum0, 43
-  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !15
+  %sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !16
   %v6 = and i32 %i0, 4
   %v5 = icmp eq i32 %v6, 0
   %v9 = add i32 %sum2, 44
-  %sum3 = select i1 %v5, i32 %sum2, i32 %v9, !prof !15
+  %sum3 = select i1 %v5, i32 %sum2, i32 %v9, !prof !16
   br i1 %j, label %bb1, label %bb4
 
 bb1:
@@ -1878,7 +1878,7 @@
 bb4:
   %i5 = load i32, i32* %i
   %v12 = icmp eq i32 %i5, 44
-  %v13 = select i1 %v12, i32 %i5, i32 %sum3, !prof !15
+  %v13 = select i1 %v12, i32 %i5, i32 %sum3, !prof !16
   ret i32 %v13
 }
 
@@ -1900,7 +1900,7 @@
 ;     foo();
 ;  }
 ;  return 45;
-define i32 @test_chr_21(i64 %i, i64 %k, i64 %j) !prof !14 {
+define i32 @test_chr_21(i64 %i, i64 %k, i64 %j) !prof !15 {
 ; CHECK-LABEL: @test_chr_21(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[CMP0:%.*]] = icmp ne i64 [[J:%.*]], [[K:%.*]]
@@ -1908,13 +1908,13 @@
 ; CHECK-NEXT:    [[CMP_I:%.*]] = icmp ne i64 [[I]], 86
 ; CHECK-NEXT:    [[TMP0:%.*]] = and i1 [[CMP0]], [[CMP3]]
 ; CHECK-NEXT:    [[TMP1:%.*]] = and i1 [[TMP0]], [[CMP_I]]
-; CHECK-NEXT:    br i1 [[TMP1]], label [[BB1:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !15
+; CHECK-NEXT:    br i1 [[TMP1]], label [[BB1:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof !16
 ; CHECK:       bb1:
 ; CHECK-NEXT:    [[CMP2:%.*]] = icmp ne i64 [[I]], 2
 ; CHECK-NEXT:    switch i64 [[I]], label [[BB2:%.*]] [
 ; CHECK-NEXT:    i64 2, label [[BB3_NONCHR2:%.*]]
 ; CHECK-NEXT:    i64 86, label [[BB2_NONCHR1:%.*]]
-; CHECK-NEXT:    ], !prof !20
+; CHECK-NEXT:    ], !prof !21
 ; CHECK:       bb2:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    call void @foo()
@@ -1923,7 +1923,7 @@
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB3_NONCHR2]]
 ; CHECK:       bb3.nonchr2:
-; CHECK-NEXT:    br i1 [[CMP_I]], label [[BB4_NONCHR3:%.*]], label [[BB7]], !prof !18
+; CHECK-NEXT:    br i1 [[CMP_I]], label [[BB4_NONCHR3:%.*]], label [[BB7]], !prof !19
 ; CHECK:       bb4.nonchr3:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB7]]
@@ -1932,18 +1932,18 @@
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB10:%.*]]
 ; CHECK:       entry.split.nonchr:
-; CHECK-NEXT:    br i1 [[CMP0]], label [[BB1_NONCHR:%.*]], label [[BB10]], !prof !18
+; CHECK-NEXT:    br i1 [[CMP0]], label [[BB1_NONCHR:%.*]], label [[BB10]], !prof !19
 ; CHECK:       bb1.nonchr:
 ; CHECK-NEXT:    [[CMP2_NONCHR:%.*]] = icmp eq i64 [[I]], 2
-; CHECK-NEXT:    br i1 [[CMP2_NONCHR]], label [[BB3_NONCHR:%.*]], label [[BB2_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[CMP2_NONCHR]], label [[BB3_NONCHR:%.*]], label [[BB2_NONCHR:%.*]], !prof !17
 ; CHECK:       bb3.nonchr:
 ; CHECK-NEXT:    [[CMP_I_NONCHR:%.*]] = icmp eq i64 [[I]], 86
-; CHECK-NEXT:    br i1 [[CMP_I_NONCHR]], label [[BB6_NONCHR:%.*]], label [[BB4_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[CMP_I_NONCHR]], label [[BB6_NONCHR:%.*]], label [[BB4_NONCHR:%.*]], !prof !17
 ; CHECK:       bb6.nonchr:
 ; CHECK-NEXT:    [[CMP3_NONCHR:%.*]] = icmp eq i64 [[J]], [[I]]
-; CHECK-NEXT:    br i1 [[CMP3_NONCHR]], label [[BB8_NONCHR:%.*]], label [[BB7_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[CMP3_NONCHR]], label [[BB8_NONCHR:%.*]], label [[BB7_NONCHR:%.*]], !prof !17
 ; CHECK:       bb8.nonchr:
-; CHECK-NEXT:    br i1 [[CMP_I_NONCHR]], label [[BB10]], label [[BB9_NONCHR:%.*]], !prof !16
+; CHECK-NEXT:    br i1 [[CMP_I_NONCHR]], label [[BB10]], label [[BB9_NONCHR:%.*]], !prof !17
 ; CHECK:       bb9.nonchr:
 ; CHECK-NEXT:    call void @foo()
 ; CHECK-NEXT:    br label [[BB10]]
@@ -1961,11 +1961,11 @@
 ;
 entry:
   %cmp0 = icmp eq i64 %j, %k
-  br i1 %cmp0, label %bb10, label %bb1, !prof !15
+  br i1 %cmp0, label %bb10, label %bb1, !prof !16
 
 bb1:
   %cmp2 = icmp eq i64 %i, 2
-  br i1 %cmp2, label %bb3, label %bb2, !prof !15
+  br i1 %cmp2, label %bb3, label %bb2, !prof !16
 
 bb2:
   call void @foo()
@@ -1973,7 +1973,7 @@
 
 bb3:
   %cmp.i = icmp eq i64 %i, 86
-  br i1 %cmp.i, label %bb5, label %bb4, !prof !15
+  br i1 %cmp.i, label %bb5, label %bb4, !prof !16
 
 bb4:
   call void @foo()
@@ -1984,14 +1984,14 @@
 
 bb6:
   %cmp3 = icmp eq i64 %j, %i
-  br i1 %cmp3, label %bb8, label %bb7, !prof !15
+  br i1 %cmp3, label %bb8, label %bb7, !prof !16
 
 bb7:
   call void @foo()
   br label %bb8
 
 bb8:
-  br i1 %cmp.i, label %bb10, label %bb9, !prof !15
+  br i1 %cmp.i, label %bb10, label %bb9, !prof !16
 
 bb9:
   call void @foo()
@@ -2003,12 +2003,12 @@
 
 ; Test a case with a really long use-def chains. This test checks that it's not
 ; really slow and doesn't appear to be hanging.
-define i64 @test_chr_22(i1 %i, i64* %j, i64 %v0) !prof !14 {
+define i64 @test_chr_22(i1 %i, i64* %j, i64 %v0) !prof !15 {
 bb0:
   %v1 = add i64 %v0, 3
   %v2 = add i64 %v1, %v0
   %c1 = icmp sgt i64 %v2, 99
-  %v3 = select i1 %c1, i64 %v1, i64 %v2, !prof !15
+  %v3 = select i1 %c1, i64 %v1, i64 %v2, !prof !16
   %v4 = add i64 %v2, %v2
   %v5 = add i64 %v4, %v2
   %v6 = add i64 %v5, %v4
@@ -2307,7 +2307,7 @@
   %v299 = add i64 %v298, %v297
   %v300 = add i64 %v299, %v298
   %v301 = icmp eq i64 %v300, 100
-  %v302 = select i1 %v301, i64 %v298, i64 %v299, !prof !15
+  %v302 = select i1 %v301, i64 %v298, i64 %v299, !prof !16
   store i64 %v302, i64* %j
   ret i64 99
 }
@@ -2316,7 +2316,7 @@
 ; really slow and doesn't appear to be hanging. This is different from
 ; test_chr_22 in that it has nested control structures (multiple scopes) and
 ; covers additional code.
-define i64 @test_chr_23(i64 %v0) !prof !14 {
+define i64 @test_chr_23(i64 %v0) !prof !15 {
 entry:
   %v1 = add i64 %v0, 3
   %v2 = add i64 %v1, %v1
@@ -2328,7 +2328,7 @@
   %v8 = add i64 %v7, %v6
   %v9 = add i64 %v8, %v7
   %v10 = icmp eq i64 %v9, 100
-  br i1 %v10, label %body, label %end, !prof !15
+  br i1 %v10, label %body, label %end, !prof !16
 
 body:
   %v1_0 = add i64 %v9, 3
@@ -2341,7 +2341,7 @@
   %v8_0 = add i64 %v7_0, %v6_0
   %v9_0 = add i64 %v8_0, %v7_0
   %v10_0 = icmp eq i64 %v9_0, 100
-  br i1 %v10_0, label %body.1, label %end, !prof !15
+  br i1 %v10_0, label %body.1, label %end, !prof !16
 
 body.1:
   %v1_1 = add i64 %v9_0, 3
@@ -2354,7 +2354,7 @@
   %v8_1 = add i64 %v7_1, %v6_1
   %v9_1 = add i64 %v8_1, %v7_1
   %v10_1 = icmp eq i64 %v9_1, 100
-  br i1 %v10_1, label %body.2, label %end, !prof !15
+  br i1 %v10_1, label %body.2, label %end, !prof !16
 
 body.2:
   %v1_2 = add i64 %v9_1, 3
@@ -2367,7 +2367,7 @@
   %v8_2 = add i64 %v7_2, %v6_2
   %v9_2 = add i64 %v8_2, %v7_2
   %v10_2 = icmp eq i64 %v9_2, 100
-  br i1 %v10_2, label %body.3, label %end, !prof !15
+  br i1 %v10_2, label %body.3, label %end, !prof !16
 
 body.3:
   %v1_3 = add i64 %v9_2, 3
@@ -2380,7 +2380,7 @@
   %v8_3 = add i64 %v7_3, %v6_3
   %v9_3 = add i64 %v8_3, %v7_3
   %v10_3 = icmp eq i64 %v9_3, 100
-  br i1 %v10_3, label %body.4, label %end, !prof !15
+  br i1 %v10_3, label %body.4, label %end, !prof !16
 
 body.4:
   %v1_4 = add i64 %v9_3, 3
@@ -2393,7 +2393,7 @@
   %v8_4 = add i64 %v7_4, %v6_4
   %v9_4 = add i64 %v8_4, %v7_4
   %v10_4 = icmp eq i64 %v9_4, 100
-  br i1 %v10_4, label %body.5, label %end, !prof !15
+  br i1 %v10_4, label %body.5, label %end, !prof !16
 
 body.5:
   %v1_5 = add i64 %v9_4, 3
@@ -2406,7 +2406,7 @@
   %v8_5 = add i64 %v7_5, %v6_5
   %v9_5 = add i64 %v8_5, %v7_5
   %v10_5 = icmp eq i64 %v9_5, 100
-  br i1 %v10_5, label %body.6, label %end, !prof !15
+  br i1 %v10_5, label %body.6, label %end, !prof !16
 
 body.6:
   %v1_6 = add i64 %v9_5, 3
@@ -2419,7 +2419,7 @@
   %v8_6 = add i64 %v7_6, %v6_6
   %v9_6 = add i64 %v8_6, %v7_6
   %v10_6 = icmp eq i64 %v9_6, 100
-  br i1 %v10_6, label %body.7, label %end, !prof !15
+  br i1 %v10_6, label %body.7, label %end, !prof !16
 
 body.7:
   %v1_7 = add i64 %v9_6, 3
@@ -2432,7 +2432,7 @@
   %v8_7 = add i64 %v7_7, %v6_7
   %v9_7 = add i64 %v8_7, %v7_7
   %v10_7 = icmp eq i64 %v9_7, 100
-  br i1 %v10_7, label %body.8, label %end, !prof !15
+  br i1 %v10_7, label %body.8, label %end, !prof !16
 
 body.8:
   %v1_8 = add i64 %v9_7, 3
@@ -2445,7 +2445,7 @@
   %v8_8 = add i64 %v7_8, %v6_8
   %v9_8 = add i64 %v8_8, %v7_8
   %v10_8 = icmp eq i64 %v9_8, 100
-  br i1 %v10_8, label %body.9, label %end, !prof !15
+  br i1 %v10_8, label %body.9, label %end, !prof !16
 
 body.9:
   %v1_9 = add i64 %v9_8, 3
@@ -2464,12 +2464,12 @@
 }
 
 ; Test to not crash upon a 0:0 branch_weight metadata.
-define void @test_chr_24(i32* %i) !prof !14 {
+define void @test_chr_24(i32* %i) !prof !15 {
 entry:
   %0 = load i32, i32* %i
   %1 = and i32 %0, 1
   %2 = icmp eq i32 %1, 0
-  br i1 %2, label %bb1, label %bb0, !prof !17
+  br i1 %2, label %bb1, label %bb0, !prof !18
 
 bb0:
   call void @foo()
@@ -2478,7 +2478,7 @@
 bb1:
   %3 = and i32 %0, 2
   %4 = icmp eq i32 %3, 0
-  br i1 %4, label %bb3, label %bb2, !prof !17
+  br i1 %4, label %bb3, label %bb2, !prof !18
 
 bb2:
   call void @foo()
@@ -2490,7 +2490,7 @@
 
 !llvm.module.flags = !{!0}
 !0 = !{i32 1, !"ProfileSummary", !1}
-!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 !2 = !{!"ProfileFormat", !"InstrProf"}
 !3 = !{!"TotalCount", i64 10000}
 !4 = !{!"MaxCount", i64 10}
@@ -2498,18 +2498,19 @@
 !6 = !{!"MaxFunctionCount", i64 1000}
 !7 = !{!"NumCounts", i64 3}
 !8 = !{!"NumFunctions", i64 3}
-!9 = !{!"DetailedSummary", !10}
-!10 = !{!11, !12, !13}
-!11 = !{i32 10000, i64 100, i32 1}
-!12 = !{i32 999000, i64 100, i32 1}
-!13 = !{i32 999999, i64 1, i32 2}
-
-!14 = !{!"function_entry_count", i64 100}
-!15 = !{!"branch_weights", i32 0, i32 1}
-!16 = !{!"branch_weights", i32 1, i32 1}
-!17 = !{!"branch_weights", i32 0, i32 0}
-; CHECK: !15 = !{!"branch_weights", i32 1000, i32 0}
-; CHECK: !16 = !{!"branch_weights", i32 0, i32 1}
-; CHECK: !17 = !{!"branch_weights", i32 1, i32 1}
-; CHECK: !18 = !{!"branch_weights", i32 1, i32 0}
-; CHECK: !19 = !{!"branch_weights", i32 0, i32 1000}
+!9 = !{!"IsPartialProfile", i64 0}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}
+
+!15 = !{!"function_entry_count", i64 100}
+!16 = !{!"branch_weights", i32 0, i32 1}
+!17 = !{!"branch_weights", i32 1, i32 1}
+!18 = !{!"branch_weights", i32 0, i32 0}
+; CHECK: !16 = !{!"branch_weights", i32 1000, i32 0}
+; CHECK: !17 = !{!"branch_weights", i32 0, i32 1}
+; CHECK: !18 = !{!"branch_weights", i32 1, i32 1}
+; CHECK: !19 = !{!"branch_weights", i32 1, i32 0}
+; CHECK: !20 = !{!"branch_weights", i32 0, i32 1000}
Index: llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll
+++ llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll
@@ -142,7 +142,8 @@
 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"MaxFunctionCount", i64 800000}
 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"NumCounts", i64 14}
 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"NumFunctions", i64 8}
-; CSPGOSUMMARY: {{![0-9]+}} = !{!"DetailedSummary", !10}
+; CSPGOSUMMARY: {{![0-9]+}} = !{!"IsPartialProfile", i64 0}
+; CSPGOSUMMARY: {{![0-9]+}} = !{!"DetailedSummary", !{{[0-9]+}}}
 ; CSPGOSUMMARY: {{![0-9]+}} = !{i32 1, !"CSProfileSummary", !{{[0-9]+}}}
 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"ProfileFormat", !"CSInstrProf"}
 ; CSPGOSUMMARY: {{![0-9]+}} = !{!"TotalCount", i64 1299950}
Index: llvm/test/Transforms/PGOProfile/icp_sample.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/icp_sample.ll
+++ llvm/test/Transforms/PGOProfile/icp_sample.ll
@@ -8,14 +8,14 @@
 ; CHECK: if.true.direct_targ
 ; CHECK:   call i32* @_Z3fooPi
 define i32* @_Z3barPFPiS_E(i32* (i32*)* nocapture) {
-  %2 = tail call i32* %0(i32* null), !prof !33
+  %2 = tail call i32* %0(i32* null), !prof !34
   ret i32* %2
 }
 
 !llvm.module.flags = !{!3}
 
 !3 = !{i32 1, !"ProfileSummary", !4}
-!4 = !{!5, !6, !7, !8, !9, !10, !11, !12}
+!4 = !{!5, !6, !7, !8, !9, !10, !11, !12, !13}
 !5 = !{!"ProfileFormat", !"SampleProfile"}
 !6 = !{!"TotalCount", i64 0}
 !7 = !{!"MaxCount", i64 0}
@@ -23,22 +23,23 @@
 !9 = !{!"MaxFunctionCount", i64 0}
 !10 = !{!"NumCounts", i64 1}
 !11 = !{!"NumFunctions", i64 1}
-!12 = !{!"DetailedSummary", !13}
-!13 = !{!14, !15, !16, !17, !18, !19, !19, !20, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29}
-!14 = !{i32 10000, i64 0, i32 0}
-!15 = !{i32 100000, i64 0, i32 0}
-!16 = !{i32 200000, i64 0, i32 0}
-!17 = !{i32 300000, i64 0, i32 0}
-!18 = !{i32 400000, i64 0, i32 0}
-!19 = !{i32 500000, i64 0, i32 0}
-!20 = !{i32 600000, i64 0, i32 0}
-!21 = !{i32 700000, i64 0, i32 0}
-!22 = !{i32 800000, i64 0, i32 0}
-!23 = !{i32 900000, i64 0, i32 0}
-!24 = !{i32 950000, i64 0, i32 0}
-!25 = !{i32 990000, i64 0, i32 0}
-!26 = !{i32 999000, i64 0, i32 0}
-!27 = !{i32 999900, i64 0, i32 0}
-!28 = !{i32 999990, i64 0, i32 0}
-!29 = !{i32 999999, i64 0, i32 0}
-!33 = !{!"VP", i32 0, i64 100, i64 8400159624858369790, i64 100}
+!12 = !{!"IsPartialProfile", i64 0}
+!13 = !{!"DetailedSummary", !14}
+!14 = !{!15, !16, !17, !18, !19, !20, !20, !21, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30}
+!15 = !{i32 10000, i64 0, i32 0}
+!16 = !{i32 100000, i64 0, i32 0}
+!17 = !{i32 200000, i64 0, i32 0}
+!18 = !{i32 300000, i64 0, i32 0}
+!19 = !{i32 400000, i64 0, i32 0}
+!20 = !{i32 500000, i64 0, i32 0}
+!21 = !{i32 600000, i64 0, i32 0}
+!22 = !{i32 700000, i64 0, i32 0}
+!23 = !{i32 800000, i64 0, i32 0}
+!24 = !{i32 900000, i64 0, i32 0}
+!25 = !{i32 950000, i64 0, i32 0}
+!26 = !{i32 990000, i64 0, i32 0}
+!27 = !{i32 999000, i64 0, i32 0}
+!28 = !{i32 999900, i64 0, i32 0}
+!29 = !{i32 999990, i64 0, i32 0}
+!30 = !{i32 999999, i64 0, i32 0}
+!34 = !{!"VP", i32 0, i64 100, i64 8400159624858369790, i64 100}
Index: llvm/test/Transforms/PGOProfile/thinlto_cspgo_gen.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/thinlto_cspgo_gen.ll
+++ llvm/test/Transforms/PGOProfile/thinlto_cspgo_gen.ll
@@ -27,7 +27,7 @@
 @__llvm_profile_filename = constant [25 x i8] c"pass2/default_%m.profraw\00", comdat
 @__llvm_profile_raw_version = constant i64 216172782113783812, comdat
 
-define dso_local void @foo() #0 !prof !29 {
+define dso_local void @foo() #0 !prof !30 {
 entry:
   br label %for.body
 
@@ -38,7 +38,7 @@
   tail call void @bar(i32 %add)
   %add1 = add nuw nsw i32 %i.06, 2
   %cmp = icmp ult i32 %add1, 200000
-  br i1 %cmp, label %for.body, label %for.end, !prof !30
+  br i1 %cmp, label %for.body, label %for.end, !prof !31
 
 for.end:
   ret void
@@ -46,7 +46,7 @@
 
 declare dso_local void @bar(i32)
 
-define dso_local i32 @main() !prof !29 {
+define dso_local i32 @main() !prof !30 {
 entry:
   tail call void @foo()
   ret i32 0
@@ -58,7 +58,7 @@
 
 !0 = !{i32 1, !"wchar_size", i32 4}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 500002}
 !5 = !{!"MaxCount", i64 200000}
@@ -66,23 +66,24 @@
 !7 = !{!"MaxFunctionCount", i64 200000}
 !8 = !{!"NumCounts", i64 6}
 !9 = !{!"NumFunctions", i64 4}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
-!12 = !{i32 10000, i64 200000, i32 1}
-!13 = !{i32 100000, i64 200000, i32 1}
-!14 = !{i32 200000, i64 200000, i32 1}
-!15 = !{i32 300000, i64 200000, i32 1}
-!16 = !{i32 400000, i64 200000, i32 1}
-!17 = !{i32 500000, i64 100000, i32 4}
-!18 = !{i32 600000, i64 100000, i32 4}
-!19 = !{i32 700000, i64 100000, i32 4}
-!20 = !{i32 800000, i64 100000, i32 4}
-!21 = !{i32 900000, i64 100000, i32 4}
-!22 = !{i32 950000, i64 100000, i32 4}
-!23 = !{i32 990000, i64 100000, i32 4}
-!24 = !{i32 999000, i64 100000, i32 4}
-!25 = !{i32 999900, i64 100000, i32 4}
-!26 = !{i32 999990, i64 100000, i32 4}
-!27 = !{i32 999999, i64 1, i32 6}
-!29 = !{!"function_entry_count", i64 1}
-!30 = !{!"branch_weights", i32 100000, i32 1}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}
+!13 = !{i32 10000, i64 200000, i32 1}
+!14 = !{i32 100000, i64 200000, i32 1}
+!15 = !{i32 200000, i64 200000, i32 1}
+!16 = !{i32 300000, i64 200000, i32 1}
+!17 = !{i32 400000, i64 200000, i32 1}
+!18 = !{i32 500000, i64 100000, i32 4}
+!19 = !{i32 600000, i64 100000, i32 4}
+!20 = !{i32 700000, i64 100000, i32 4}
+!21 = !{i32 800000, i64 100000, i32 4}
+!22 = !{i32 900000, i64 100000, i32 4}
+!23 = !{i32 950000, i64 100000, i32 4}
+!24 = !{i32 990000, i64 100000, i32 4}
+!25 = !{i32 999000, i64 100000, i32 4}
+!26 = !{i32 999900, i64 100000, i32 4}
+!27 = !{i32 999990, i64 100000, i32 4}
+!28 = !{i32 999999, i64 1, i32 6}
+!30 = !{!"function_entry_count", i64 1}
+!31 = !{!"branch_weights", i32 100000, i32 1}
Index: llvm/test/Transforms/PGOProfile/thinlto_cspgo_use.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/thinlto_cspgo_use.ll
+++ llvm/test/Transforms/PGOProfile/thinlto_cspgo_use.ll
@@ -21,7 +21,7 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define dso_local void @foo() #0 !prof !29 {
+define dso_local void @foo() #0 !prof !30 {
 entry:
   br label %for.body
 
@@ -32,7 +32,7 @@
   tail call void @bar(i32 %add)
   %add1 = add nuw nsw i32 %i.06, 2
   %cmp = icmp ult i32 %add1, 200000
-  br i1 %cmp, label %for.body, label %for.end, !prof !30
+  br i1 %cmp, label %for.body, label %for.end, !prof !31
 
 for.end:
   ret void
@@ -40,7 +40,7 @@
 
 declare dso_local void @bar(i32)
 
-define dso_local i32 @main() !prof !29 {
+define dso_local i32 @main() !prof !30 {
 entry:
   tail call void @foo()
   ret i32 0
@@ -52,7 +52,7 @@
 
 !0 = !{i32 1, !"wchar_size", i32 4}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"InstrProf"}
 !4 = !{!"TotalCount", i64 500002}
 !5 = !{!"MaxCount", i64 200000}
@@ -60,23 +60,24 @@
 !7 = !{!"MaxFunctionCount", i64 200000}
 !8 = !{!"NumCounts", i64 6}
 !9 = !{!"NumFunctions", i64 4}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}
-!12 = !{i32 10000, i64 200000, i32 1}
-!13 = !{i32 100000, i64 200000, i32 1}
-!14 = !{i32 200000, i64 200000, i32 1}
-!15 = !{i32 300000, i64 200000, i32 1}
-!16 = !{i32 400000, i64 200000, i32 1}
-!17 = !{i32 500000, i64 100000, i32 4}
-!18 = !{i32 600000, i64 100000, i32 4}
-!19 = !{i32 700000, i64 100000, i32 4}
-!20 = !{i32 800000, i64 100000, i32 4}
-!21 = !{i32 900000, i64 100000, i32 4}
-!22 = !{i32 950000, i64 100000, i32 4}
-!23 = !{i32 990000, i64 100000, i32 4}
-!24 = !{i32 999000, i64 100000, i32 4}
-!25 = !{i32 999900, i64 100000, i32 4}
-!26 = !{i32 999990, i64 100000, i32 4}
-!27 = !{i32 999999, i64 1, i32 6}
-!29 = !{!"function_entry_count", i64 1}
-!30 = !{!"branch_weights", i32 100000, i32 1}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}
+!13 = !{i32 10000, i64 200000, i32 1}
+!14 = !{i32 100000, i64 200000, i32 1}
+!15 = !{i32 200000, i64 200000, i32 1}
+!16 = !{i32 300000, i64 200000, i32 1}
+!17 = !{i32 400000, i64 200000, i32 1}
+!18 = !{i32 500000, i64 100000, i32 4}
+!19 = !{i32 600000, i64 100000, i32 4}
+!20 = !{i32 700000, i64 100000, i32 4}
+!21 = !{i32 800000, i64 100000, i32 4}
+!22 = !{i32 900000, i64 100000, i32 4}
+!23 = !{i32 950000, i64 100000, i32 4}
+!24 = !{i32 990000, i64 100000, i32 4}
+!25 = !{i32 999000, i64 100000, i32 4}
+!26 = !{i32 999900, i64 100000, i32 4}
+!27 = !{i32 999990, i64 100000, i32 4}
+!28 = !{i32 999999, i64 1, i32 6}
+!30 = !{!"function_entry_count", i64 1}
+!31 = !{!"branch_weights", i32 100000, i32 1}
Index: llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp.ll
+++ llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp.ll
@@ -15,24 +15,24 @@
 @fptr = local_unnamed_addr global void ()* null, align 8
 
 ; Function Attrs: norecurse uwtable
-define i32 @main() local_unnamed_addr #0 !prof !34 {
+define i32 @main() local_unnamed_addr #0 !prof !35 {
 entry:
   %0 = load void ()*, void ()** @fptr, align 8
 ; ICALL-PROM:   br i1 %{{[0-9]+}}, label %if.true.direct_targ, label %if.false.orig_indirect
-  tail call void %0(), !prof !40
+  tail call void %0(), !prof !41
   ret i32 0
 }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3,!4}
-!llvm.ident = !{!31}
+!llvm.ident = !{!32}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)
 !1 = !DIFile(filename: "main.cc", directory: ".")
 !2 = !{}
 !3 = !{i32 2, !"Debug Info Version", i32 3}
 !4 = !{i32 1, !"ProfileSummary", !5}
-!5 = !{!6, !7, !8, !9, !10, !11, !12, !13}
+!5 = !{!6, !7, !8, !9, !10, !11, !12, !13, !14}
 !6 = !{!"ProfileFormat", !"SampleProfile"}
 !7 = !{!"TotalCount", i64 3003}
 !8 = !{!"MaxCount", i64 3000}
@@ -40,24 +40,25 @@
 !10 = !{!"MaxFunctionCount", i64 0}
 !11 = !{!"NumCounts", i64 3}
 !12 = !{!"NumFunctions", i64 1}
-!13 = !{!"DetailedSummary", !14}
-!14 = !{!15, !16, !17, !18, !19, !20, !20, !21, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30}
-!15 = !{i32 10000, i64 3000, i32 1}
-!16 = !{i32 100000, i64 3000, i32 1}
-!17 = !{i32 200000, i64 3000, i32 1}
-!18 = !{i32 300000, i64 3000, i32 1}
-!19 = !{i32 400000, i64 3000, i32 1}
-!20 = !{i32 500000, i64 3000, i32 1}
-!21 = !{i32 600000, i64 3000, i32 1}
-!22 = !{i32 700000, i64 3000, i32 1}
-!23 = !{i32 800000, i64 3000, i32 1}
-!24 = !{i32 900000, i64 3000, i32 1}
-!25 = !{i32 950000, i64 3000, i32 1}
-!26 = !{i32 990000, i64 3000, i32 1}
-!27 = !{i32 999000, i64 3000, i32 1}
-!28 = !{i32 999900, i64 2, i32 2}
-!29 = !{i32 999990, i64 2, i32 2}
-!30 = !{i32 999999, i64 2, i32 2}
-!31 = !{!"clang version 5.0.0 (trunk 297016)"}
-!34 = !{!"function_entry_count", i64 1}
-!40 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000}
+!13 = !{!"IsPartialProfile", i64 0}
+!14 = !{!"DetailedSummary", !15}
+!15 = !{!16, !17, !18, !19, !20, !21, !21, !22, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31}
+!16 = !{i32 10000, i64 3000, i32 1}
+!17 = !{i32 100000, i64 3000, i32 1}
+!18 = !{i32 200000, i64 3000, i32 1}
+!19 = !{i32 300000, i64 3000, i32 1}
+!20 = !{i32 400000, i64 3000, i32 1}
+!21 = !{i32 500000, i64 3000, i32 1}
+!22 = !{i32 600000, i64 3000, i32 1}
+!23 = !{i32 700000, i64 3000, i32 1}
+!24 = !{i32 800000, i64 3000, i32 1}
+!25 = !{i32 900000, i64 3000, i32 1}
+!26 = !{i32 950000, i64 3000, i32 1}
+!27 = !{i32 990000, i64 3000, i32 1}
+!28 = !{i32 999000, i64 3000, i32 1}
+!29 = !{i32 999900, i64 2, i32 2}
+!30 = !{i32 999990, i64 2, i32 2}
+!31 = !{i32 999999, i64 2, i32 2}
+!32 = !{!"clang version 5.0.0 (trunk 297016)"}
+!35 = !{!"function_entry_count", i64 1}
+!41 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000}
Index: llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll
+++ llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll
@@ -30,24 +30,24 @@
 @fptr = local_unnamed_addr global void ()* null, align 8
 
 ; Function Attrs: norecurse uwtable
-define i32 @main() local_unnamed_addr #0 !prof !34 {
+define i32 @main() local_unnamed_addr #0 !prof !35 {
 entry:
   %0 = load void ()*, void ()** @fptr, align 8
 ; ICALL-PROM:   br i1 %{{[0-9]+}}, label %if.true.direct_targ, label %if.false.orig_indirect
-  tail call void %0(), !prof !40
+  tail call void %0(), !prof !41
   ret i32 0
 }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3,!4}
-!llvm.ident = !{!31}
+!llvm.ident = !{!32}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)
 !1 = !DIFile(filename: "main.cc", directory: ".")
 !2 = !{}
 !3 = !{i32 2, !"Debug Info Version", i32 3}
 !4 = !{i32 1, !"ProfileSummary", !5}
-!5 = !{!6, !7, !8, !9, !10, !11, !12, !13}
+!5 = !{!6, !7, !8, !9, !10, !11, !12, !13, !14}
 !6 = !{!"ProfileFormat", !"SampleProfile"}
 !7 = !{!"TotalCount", i64 3003}
 !8 = !{!"MaxCount", i64 3000}
@@ -55,24 +55,25 @@
 !10 = !{!"MaxFunctionCount", i64 0}
 !11 = !{!"NumCounts", i64 3}
 !12 = !{!"NumFunctions", i64 1}
-!13 = !{!"DetailedSummary", !14}
-!14 = !{!15, !16, !17, !18, !19, !20, !20, !21, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30}
-!15 = !{i32 10000, i64 3000, i32 1}
-!16 = !{i32 100000, i64 3000, i32 1}
-!17 = !{i32 200000, i64 3000, i32 1}
-!18 = !{i32 300000, i64 3000, i32 1}
-!19 = !{i32 400000, i64 3000, i32 1}
-!20 = !{i32 500000, i64 3000, i32 1}
-!21 = !{i32 600000, i64 3000, i32 1}
-!22 = !{i32 700000, i64 3000, i32 1}
-!23 = !{i32 800000, i64 3000, i32 1}
-!24 = !{i32 900000, i64 3000, i32 1}
-!25 = !{i32 950000, i64 3000, i32 1}
-!26 = !{i32 990000, i64 3000, i32 1}
-!27 = !{i32 999000, i64 3000, i32 1}
-!28 = !{i32 999900, i64 2, i32 2}
-!29 = !{i32 999990, i64 2, i32 2}
-!30 = !{i32 999999, i64 2, i32 2}
-!31 = !{!"clang version 5.0.0 (trunk 297016)"}
-!34 = !{!"function_entry_count", i64 1}
-!40 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000}
+!13 = !{!"IsPartialProfile", i64 0}
+!14 = !{!"DetailedSummary", !15}
+!15 = !{!16, !17, !18, !19, !20, !21, !21, !22, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31}
+!16 = !{i32 10000, i64 3000, i32 1}
+!17 = !{i32 100000, i64 3000, i32 1}
+!18 = !{i32 200000, i64 3000, i32 1}
+!19 = !{i32 300000, i64 3000, i32 1}
+!20 = !{i32 400000, i64 3000, i32 1}
+!21 = !{i32 500000, i64 3000, i32 1}
+!22 = !{i32 600000, i64 3000, i32 1}
+!23 = !{i32 700000, i64 3000, i32 1}
+!24 = !{i32 800000, i64 3000, i32 1}
+!25 = !{i32 900000, i64 3000, i32 1}
+!26 = !{i32 950000, i64 3000, i32 1}
+!27 = !{i32 990000, i64 3000, i32 1}
+!28 = !{i32 999000, i64 3000, i32 1}
+!29 = !{i32 999900, i64 2, i32 2}
+!30 = !{i32 999990, i64 2, i32 2}
+!31 = !{i32 999999, i64 2, i32 2}
+!32 = !{!"clang version 5.0.0 (trunk 297016)"}
+!35 = !{!"function_entry_count", i64 1}
+!41 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000}
Index: llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll
+++ llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll
@@ -22,23 +22,23 @@
 @fptr = local_unnamed_addr global void ()* null, align 8
 
 ; Function Attrs: norecurse uwtable
-define i32 @main() local_unnamed_addr #0 !prof !34 {
+define i32 @main() local_unnamed_addr #0 !prof !35 {
 entry:
   %0 = load void ()*, void ()** @fptr, align 8
-  tail call void %0(), !prof !40
+  tail call void %0(), !prof !41
   ret i32 0
 }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3,!4}
-!llvm.ident = !{!31}
+!llvm.ident = !{!32}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)
 !1 = !DIFile(filename: "main.cc", directory: ".")
 !2 = !{}
 !3 = !{i32 2, !"Debug Info Version", i32 3}
 !4 = !{i32 1, !"ProfileSummary", !5}
-!5 = !{!6, !7, !8, !9, !10, !11, !12, !13}
+!5 = !{!6, !7, !8, !9, !10, !11, !12, !13, !14}
 !6 = !{!"ProfileFormat", !"SampleProfile"}
 !7 = !{!"TotalCount", i64 3003}
 !8 = !{!"MaxCount", i64 3000}
@@ -46,24 +46,25 @@
 !10 = !{!"MaxFunctionCount", i64 0}
 !11 = !{!"NumCounts", i64 3}
 !12 = !{!"NumFunctions", i64 1}
-!13 = !{!"DetailedSummary", !14}
-!14 = !{!15, !16, !17, !18, !19, !20, !20, !21, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30}
-!15 = !{i32 10000, i64 3000, i32 1}
-!16 = !{i32 100000, i64 3000, i32 1}
-!17 = !{i32 200000, i64 3000, i32 1}
-!18 = !{i32 300000, i64 3000, i32 1}
-!19 = !{i32 400000, i64 3000, i32 1}
-!20 = !{i32 500000, i64 3000, i32 1}
-!21 = !{i32 600000, i64 3000, i32 1}
-!22 = !{i32 700000, i64 3000, i32 1}
-!23 = !{i32 800000, i64 3000, i32 1}
-!24 = !{i32 900000, i64 3000, i32 1}
-!25 = !{i32 950000, i64 3000, i32 1}
-!26 = !{i32 990000, i64 3000, i32 1}
-!27 = !{i32 999000, i64 3000, i32 1}
-!28 = !{i32 999900, i64 2, i32 2}
-!29 = !{i32 999990, i64 2, i32 2}
-!30 = !{i32 999999, i64 2, i32 2}
-!31 = !{!"clang version 5.0.0 (trunk 297016)"}
-!34 = !{!"function_entry_count", i64 1}
-!40 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000}
+!13 = !{!"IsPartialProfile", i64 0}
+!14 = !{!"DetailedSummary", !15}
+!15 = !{!16, !17, !18, !19, !20, !21, !21, !22, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31}
+!16 = !{i32 10000, i64 3000, i32 1}
+!17 = !{i32 100000, i64 3000, i32 1}
+!18 = !{i32 200000, i64 3000, i32 1}
+!19 = !{i32 300000, i64 3000, i32 1}
+!20 = !{i32 400000, i64 3000, i32 1}
+!21 = !{i32 500000, i64 3000, i32 1}
+!22 = !{i32 600000, i64 3000, i32 1}
+!23 = !{i32 700000, i64 3000, i32 1}
+!24 = !{i32 800000, i64 3000, i32 1}
+!25 = !{i32 900000, i64 3000, i32 1}
+!26 = !{i32 950000, i64 3000, i32 1}
+!27 = !{i32 990000, i64 3000, i32 1}
+!28 = !{i32 999000, i64 3000, i32 1}
+!29 = !{i32 999900, i64 2, i32 2}
+!30 = !{i32 999990, i64 2, i32 2}
+!31 = !{i32 999999, i64 2, i32 2}
+!32 = !{!"clang version 5.0.0 (trunk 297016)"}
+!35 = !{!"function_entry_count", i64 1}
+!41 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000}
Index: llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll
+++ llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll
@@ -22,25 +22,25 @@
   ret void
 }
 
-define i32 @main() local_unnamed_addr #0 !prof !34 {
+define i32 @main() local_unnamed_addr #0 !prof !35 {
 entry:
   %0 = load void ()*, void ()** @fptr, align 8
 ; OPT-NOT: label %if.false.orig_indirect
 ; OPT-NODEAD: br i1 %{{[0-9]+}}, label %if.end.icp, label %if.false.orig_indirect
-  tail call void %0(), !prof !40
+  tail call void %0(), !prof !41
   ret i32 0
 }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3,!4}
-!llvm.ident = !{!31}
+!llvm.ident = !{!32}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)
 !1 = !DIFile(filename: "main.cc", directory: ".")
 !2 = !{}
 !3 = !{i32 2, !"Debug Info Version", i32 3}
 !4 = !{i32 1, !"ProfileSummary", !5}
-!5 = !{!6, !7, !8, !9, !10, !11, !12, !13}
+!5 = !{!6, !7, !8, !9, !10, !11, !12, !13, !14}
 !6 = !{!"ProfileFormat", !"SampleProfile"}
 !7 = !{!"TotalCount", i64 3003}
 !8 = !{!"MaxCount", i64 3000}
@@ -48,24 +48,25 @@
 !10 = !{!"MaxFunctionCount", i64 0}
 !11 = !{!"NumCounts", i64 3}
 !12 = !{!"NumFunctions", i64 1}
-!13 = !{!"DetailedSummary", !14}
-!14 = !{!15, !16, !17, !18, !19, !20, !20, !21, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30}
-!15 = !{i32 10000, i64 3000, i32 1}
-!16 = !{i32 100000, i64 3000, i32 1}
-!17 = !{i32 200000, i64 3000, i32 1}
-!18 = !{i32 300000, i64 3000, i32 1}
-!19 = !{i32 400000, i64 3000, i32 1}
-!20 = !{i32 500000, i64 3000, i32 1}
-!21 = !{i32 600000, i64 3000, i32 1}
-!22 = !{i32 700000, i64 3000, i32 1}
-!23 = !{i32 800000, i64 3000, i32 1}
-!24 = !{i32 900000, i64 3000, i32 1}
-!25 = !{i32 950000, i64 3000, i32 1}
-!26 = !{i32 990000, i64 3000, i32 1}
-!27 = !{i32 999000, i64 3000, i32 1}
-!28 = !{i32 999900, i64 2, i32 2}
-!29 = !{i32 999990, i64 2, i32 2}
-!30 = !{i32 999999, i64 2, i32 2}
-!31 = !{!"clang version 5.0.0 (trunk 297016)"}
-!34 = !{!"function_entry_count", i64 1}
-!40 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000}
+!13 = !{!"IsPartialProfile", i64 0}
+!14 = !{!"DetailedSummary", !15}
+!15 = !{!16, !17, !18, !19, !20, !21, !21, !22, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31}
+!16 = !{i32 10000, i64 3000, i32 1}
+!17 = !{i32 100000, i64 3000, i32 1}
+!18 = !{i32 200000, i64 3000, i32 1}
+!19 = !{i32 300000, i64 3000, i32 1}
+!20 = !{i32 400000, i64 3000, i32 1}
+!21 = !{i32 500000, i64 3000, i32 1}
+!22 = !{i32 600000, i64 3000, i32 1}
+!23 = !{i32 700000, i64 3000, i32 1}
+!24 = !{i32 800000, i64 3000, i32 1}
+!25 = !{i32 900000, i64 3000, i32 1}
+!26 = !{i32 950000, i64 3000, i32 1}
+!27 = !{i32 990000, i64 3000, i32 1}
+!28 = !{i32 999000, i64 3000, i32 1}
+!29 = !{i32 999900, i64 2, i32 2}
+!30 = !{i32 999990, i64 2, i32 2}
+!31 = !{i32 999999, i64 2, i32 2}
+!32 = !{!"clang version 5.0.0 (trunk 297016)"}
+!35 = !{!"function_entry_count", i64 1}
+!41 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000}
Index: llvm/test/Transforms/PGOProfile/unreachable_bb.ll
===================================================================
--- llvm/test/Transforms/PGOProfile/unreachable_bb.ll
+++ llvm/test/Transforms/PGOProfile/unreachable_bb.ll
@@ -16,7 +16,7 @@
 declare void @bar()
 
 ;USE: !0 = !{i32 1, !"ProfileSummary", !1}
-;USE: !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+;USE: !1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
 ;USE: !2 = !{!"ProfileFormat", !"InstrProf"}
 ;USE: !3 = !{!"TotalCount", i64 0}
 
Index: llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
===================================================================
--- llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
+++ llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
@@ -38,7 +38,7 @@
 ; ACCURATE: ![[COLD_ID]] = !{!"function_section_prefix", !".unlikely"}
 !llvm.module.flags = !{!1}
 !1 = !{i32 1, !"ProfileSummary", !2}
-!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11}
 !3 = !{!"ProfileFormat", !"SampleProfile"}
 !4 = !{!"TotalCount", i64 10000}
 !5 = !{!"MaxCount", i64 1000}
@@ -46,8 +46,9 @@
 !7 = !{!"MaxFunctionCount", i64 1000}
 !8 = !{!"NumCounts", i64 3}
 !9 = !{!"NumFunctions", i64 3}
-!10 = !{!"DetailedSummary", !11}
-!11 = !{!12, !13, !14}
-!12 = !{i32 10000, i64 100, i32 1}
-!13 = !{i32 999000, i64 100, i32 1}
-!14 = !{i32 999999, i64 1, i32 2}
+!10 = !{!"IsPartialProfile", i64 0}
+!11 = !{!"DetailedSummary", !12}
+!12 = !{!13, !14, !15}
+!13 = !{i32 10000, i64 100, i32 1}
+!14 = !{i32 999000, i64 100, i32 1}
+!15 = !{i32 999999, i64 1, i32 2}
Index: llvm/test/Transforms/SampleProfile/summary.ll
===================================================================
--- llvm/test/Transforms/SampleProfile/summary.ll
+++ llvm/test/Transforms/SampleProfile/summary.ll
@@ -1,6 +1,10 @@
 ; Test that we annotate entire program's summary to IR.
 ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | FileCheck %s
 ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | opt -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | FileCheck %s
+; Test that we annotate partial profile flag to IR correctly.
+; RUN: llvm-profdata merge --sample --extbinary --partial-profile %S/Inputs/summary.prof --output=%t.prof
+; RUN: opt < %s -sample-profile -sample-profile-file=%t.prof -S | FileCheck %s -check-prefix=PARTIAL
+; RUN: opt < %s -sample-profile -sample-profile-file=%t.prof -S | opt -sample-profile -sample-profile-file=%t.prof -S | FileCheck %s -check-prefix=PARTIAL
 
 define i32 @bar() #0 !dbg !1 {
 entry:
@@ -18,6 +22,8 @@
 ; CHECK-DAG: {{![0-9]+}} = !{!"NumCounts", i64 5}
 ; CHECK-DAG: {{![0-9]+}} = !{!"NumFunctions", i64 3}
 ; CHECK-DAG: {{![0-9]+}} = !{!"MaxFunctionCount", i64 3}
+; CHECK-DAG: {{![0-9]+}} = !{!"IsPartialProfile", i64 0}
+; PARTIAL: {{![0-9]+}} = !{!"IsPartialProfile", i64 1}
 
 !1 = distinct !DISubprogram(name: "bar")
 !2 = !DILocation(line: 2, scope: !2)
Index: llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
===================================================================
--- llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
+++ llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
@@ -86,7 +86,7 @@
         "{0}";
     const char *SummaryString = "!llvm.module.flags = !{{!1}"
                                 "!1 = !{{i32 1, !\"ProfileSummary\", !2}"
-                                "!2 = !{{!3, !4, !5, !6, !7, !8, !9, !10}"
+                                "!2 = !{{!3, !4, !5, !6, !7, !8, !9, !10, !11}"
                                 "!3 = !{{!\"ProfileFormat\", !\"{0}\"}"
                                 "!4 = !{{!\"TotalCount\", i64 10000}"
                                 "!5 = !{{!\"MaxCount\", i64 10}"
@@ -94,11 +94,12 @@
                                 "!7 = !{{!\"MaxFunctionCount\", i64 1000}"
                                 "!8 = !{{!\"NumCounts\", i64 3}"
                                 "!9 = !{{!\"NumFunctions\", i64 3}"
-                                "!10 = !{{!\"DetailedSummary\", !11}"
-                                "!11 = !{{!12, !13, !14}"
-                                "!12 = !{{i32 10000, i64 1000, i32 1}"
-                                "!13 = !{{i32 999000, i64 300, i32 3}"
-                                "!14 = !{{i32 999999, i64 5, i32 10}";
+                                "!10 = !{{!\"IsPartialProfile\", i64 0}"
+                                "!11 = !{{!\"DetailedSummary\", !12}"
+                                "!12 = !{{!13, !14, !15}"
+                                "!13 = !{{i32 10000, i64 1000, i32 1}"
+                                "!14 = !{{i32 999000, i64 300, i32 3}"
+                                "!15 = !{{i32 999999, i64 5, i32 10}";
     SMDiagnostic Err;
     if (ProfKind)
       return parseAssemblyString(
Index: llvm/unittests/ProfileData/SampleProfTest.cpp
===================================================================
--- llvm/unittests/ProfileData/SampleProfTest.cpp
+++ llvm/unittests/ProfileData/SampleProfTest.cpp
@@ -221,6 +221,7 @@
       ASSERT_EQ(4u, Summary.getNumFunctions());
       ASSERT_EQ(1437u, Summary.getMaxFunctionCount());
       ASSERT_EQ(60351u, Summary.getMaxCount());
+      ASSERT_TRUE(Summary.isPartialProfile());
 
       uint32_t Cutoff = 800000;
       auto Predicate = [&Cutoff](const ProfileSummaryEntry &PE) {
@@ -241,6 +242,7 @@
     };
 
     ProfileSummary &Summary = Reader->getSummary();
+    Summary.setPartialProfile(true);
     VerifySummary(Summary);
 
     // Test that conversion of summary to and from Metadata works.
Index: llvm/unittests/Target/X86/MachineSizeOptsTest.cpp
===================================================================
--- llvm/unittests/Target/X86/MachineSizeOptsTest.cpp
+++ llvm/unittests/Target/X86/MachineSizeOptsTest.cpp
@@ -122,20 +122,20 @@
   EXPECT_FALSE(shouldOptimizeForSize(BB3, &PSI, MBFI_F, PGSOQueryType::Test));
 }
 
-const char* MachineSizeOptsTest::MIRString = R"MIR(
+const char *MachineSizeOptsTest::MIRString = R"MIR(
 --- |
-  define i32 @g(i32 %x) !prof !14 {
+  define i32 @g(i32 %x) !prof !15 {
     ret i32 0
   }
 
-  define i32 @h(i32 %x) !prof !15 {
+  define i32 @h(i32 %x) !prof !16 {
     ret i32 0
   }
 
-  define i32 @f(i32 %x) !prof !16 {
+  define i32 @f(i32 %x) !prof !17 {
   bb0:
     %y1 = icmp eq i32 %x, 0
-    br i1 %y1, label %bb1, label %bb2, !prof !17
+    br i1 %y1, label %bb1, label %bb2, !prof !18
 
   bb1:                                              ; preds = %bb0
     %z1 = call i32 @g(i32 %x)
@@ -153,7 +153,7 @@
   !llvm.module.flags = !{!0}
 
   !0 = !{i32 1, !"ProfileSummary", !1}
-  !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+  !1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
   !2 = !{!"ProfileFormat", !"InstrProf"}
   !3 = !{!"TotalCount", i64 10000}
   !4 = !{!"MaxCount", i64 10}
@@ -161,15 +161,16 @@
   !6 = !{!"MaxFunctionCount", i64 1000}
   !7 = !{!"NumCounts", i64 3}
   !8 = !{!"NumFunctions", i64 3}
-  !9 = !{!"DetailedSummary", !10}
-  !10 = !{!11, !12, !13}
-  !11 = !{i32 10000, i64 1000, i32 1}
-  !12 = !{i32 999000, i64 300, i32 3}
-  !13 = !{i32 999999, i64 5, i32 10}
-  !14 = !{!"function_entry_count", i64 1}
-  !15 = !{!"function_entry_count", i64 100}
-  !16 = !{!"function_entry_count", i64 400}
-  !17 = !{!"branch_weights", i32 100, i32 1}
+  !9 = !{!"IsPartialProfile", i64 0}
+  !10 = !{!"DetailedSummary", !11}
+  !11 = !{!12, !13, !14}
+  !12 = !{i32 10000, i64 1000, i32 1}
+  !13 = !{i32 999000, i64 300, i32 3}
+  !14 = !{i32 999999, i64 5, i32 10}
+  !15 = !{!"function_entry_count", i64 1}
+  !16 = !{!"function_entry_count", i64 100}
+  !17 = !{!"function_entry_count", i64 400}
+  !18 = !{!"branch_weights", i32 100, i32 1}
 
 ...
 ---
Index: llvm/unittests/Transforms/Utils/SizeOptsTest.cpp
===================================================================
--- llvm/unittests/Transforms/Utils/SizeOptsTest.cpp
+++ llvm/unittests/Transforms/Utils/SizeOptsTest.cpp
@@ -77,19 +77,19 @@
   EXPECT_FALSE(shouldOptimizeForSize(BB3, &PSI, BFI_F, PGSOQueryType::Test));
 }
 
-const char* SizeOptsTest::IRString = R"IR(
-  define i32 @g(i32 %x) !prof !14 {
+const char *SizeOptsTest::IRString = R"IR(
+  define i32 @g(i32 %x) !prof !15 {
     ret i32 0
   }
 
-  define i32 @h(i32 %x) !prof !15 {
+  define i32 @h(i32 %x) !prof !16 {
     ret i32 0
   }
 
-  define i32 @f(i32 %x) !prof !16 {
+  define i32 @f(i32 %x) !prof !17 {
   bb0:
     %y1 = icmp eq i32 %x, 0
-    br i1 %y1, label %bb1, label %bb2, !prof !17
+    br i1 %y1, label %bb1, label %bb2, !prof !18
 
   bb1:                                              ; preds = %bb0
     %z1 = call i32 @g(i32 %x)
@@ -107,7 +107,7 @@
   !llvm.module.flags = !{!0}
 
   !0 = !{i32 1, !"ProfileSummary", !1}
-  !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
+  !1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
   !2 = !{!"ProfileFormat", !"InstrProf"}
   !3 = !{!"TotalCount", i64 10000}
   !4 = !{!"MaxCount", i64 10}
@@ -115,15 +115,16 @@
   !6 = !{!"MaxFunctionCount", i64 1000}
   !7 = !{!"NumCounts", i64 3}
   !8 = !{!"NumFunctions", i64 3}
-  !9 = !{!"DetailedSummary", !10}
-  !10 = !{!11, !12, !13}
-  !11 = !{i32 10000, i64 1000, i32 1}
-  !12 = !{i32 999000, i64 300, i32 3}
-  !13 = !{i32 999999, i64 5, i32 10}
-  !14 = !{!"function_entry_count", i64 1}
-  !15 = !{!"function_entry_count", i64 100}
-  !16 = !{!"function_entry_count", i64 400}
-  !17 = !{!"branch_weights", i32 100, i32 1}
+  !9 = !{!"IsPartialProfile", i64 0}
+  !10 = !{!"DetailedSummary", !11}
+  !11 = !{!12, !13, !14}
+  !12 = !{i32 10000, i64 1000, i32 1}
+  !13 = !{i32 999000, i64 300, i32 3}
+  !14 = !{i32 999999, i64 5, i32 10}
+  !15 = !{!"function_entry_count", i64 1}
+  !16 = !{!"function_entry_count", i64 100}
+  !17 = !{!"function_entry_count", i64 400}
+  !18 = !{!"branch_weights", i32 100, i32 1}
 )IR";
 
 } // end anonymous namespace