diff --git a/clang/test/CodeGen/Inputs/thinlto_expect1.proftext b/clang/test/CodeGen/Inputs/thinlto_expect1.proftext --- a/clang/test/CodeGen/Inputs/thinlto_expect1.proftext +++ b/clang/test/CodeGen/Inputs/thinlto_expect1.proftext @@ -2,7 +2,7 @@ :ir foo # Func Hash: -25571299074 +784007059655560962 # Num Counters: 2 # Counter Values: diff --git a/clang/test/CodeGen/Inputs/thinlto_expect2.proftext b/clang/test/CodeGen/Inputs/thinlto_expect2.proftext --- a/clang/test/CodeGen/Inputs/thinlto_expect2.proftext +++ b/clang/test/CodeGen/Inputs/thinlto_expect2.proftext @@ -2,7 +2,7 @@ :csir foo # Func Hash: -25571299074 +784007059655560962 # Num Counters: 2 # Counter Values: @@ -11,7 +11,7 @@ foo # Func Hash: -1152921530178146050 +1936928564262407938 # Num Counters: 2 # Counter Values: diff --git a/clang/test/CodeGenCXX/Inputs/profile-remap.proftext b/clang/test/CodeGenCXX/Inputs/profile-remap.proftext --- a/clang/test/CodeGenCXX/Inputs/profile-remap.proftext +++ b/clang/test/CodeGenCXX/Inputs/profile-remap.proftext @@ -1,6 +1,6 @@ :ir _ZN3Foo8functionENS_1XE -29667547796 +146835647075900052 2 10 90 diff --git a/clang/test/CodeGenCXX/Inputs/profile-remap_entry.proftext b/clang/test/CodeGenCXX/Inputs/profile-remap_entry.proftext --- a/clang/test/CodeGenCXX/Inputs/profile-remap_entry.proftext +++ b/clang/test/CodeGenCXX/Inputs/profile-remap_entry.proftext @@ -1,7 +1,7 @@ :ir :entry_first _ZN3Foo8functionENS_1XE -29667547796 +146835647075900052 2 100 90 diff --git a/clang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext b/clang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext --- a/clang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext +++ b/clang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext @@ -2,7 +2,7 @@ :ir main # Func Hash: -34137660316 +1063705162469825436 # Num Counters: 2 # Counter Values: diff --git a/clang/test/Profile/Inputs/gcc-flag-compatibility_IR_entry.proftext b/clang/test/Profile/Inputs/gcc-flag-compatibility_IR_entry.proftext --- a/clang/test/Profile/Inputs/gcc-flag-compatibility_IR_entry.proftext +++ b/clang/test/Profile/Inputs/gcc-flag-compatibility_IR_entry.proftext @@ -3,7 +3,7 @@ :entry_first main # Func Hash: -34137660316 +1063705162469825436 # Num Counters: 2 # Counter Values: diff --git a/compiler-rt/test/profile/Linux/instrprof-value-merge.c b/compiler-rt/test/profile/Linux/instrprof-value-merge.c --- a/compiler-rt/test/profile/Linux/instrprof-value-merge.c +++ b/compiler-rt/test/profile/Linux/instrprof-value-merge.c @@ -45,7 +45,7 @@ // CHECK: Counters: // CHECK: main: -// CHECK: Hash: 0x00030012a7ab6e87 +// CHECK: Hash: 0x0a9bd81e87ab6e87 // CHECK: Counters: 6 // CHECK: Indirect Call Site Count: 3 // CHECK: Number of Memory Intrinsics Calls: 3 diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp --- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -261,6 +261,10 @@ // Defined in Analysis/BlockFrequencyInfo.cpp: -view-bfi-func-name= extern cl::opt ViewBlockFreqFuncName; +static cl::opt + PGOOldCFGHashing("pgo-instr-old-cfg-hashing", cl::init(false), cl::Hidden, + cl::desc("Use the old CFG function hashing.")); + // Return a string describing the branch condition that can be // used in static branch probability heuristics: static std::string getBranchCondString(Instruction *TI) { @@ -620,7 +624,8 @@ } // end anonymous namespace // Compute Hash value for the CFG: the lower 32 bits are CRC32 of the index -// value of each BB in the CFG. The higher 32 bits record the number of edges. +// value of each BB in the CFG. The higher 32 bits are the CR32 of the numbers +// of selects, indirect calls, mem ops and edges. template void FuncPGOInstrumentation::computeCFGHash() { std::vector Indexes; @@ -639,22 +644,49 @@ } JC.update(Indexes); - // Hash format for context sensitive profile. Reserve 4 bits for other - // information. - FunctionHash = (uint64_t)SIVisitor.getNumOfSelectInsts() << 56 | - (uint64_t)ValueSites[IPVK_IndirectCallTarget].size() << 48 | - //(uint64_t)ValueSites[IPVK_MemOPSize].size() << 40 | - (uint64_t)MST.AllEdges.size() << 32 | JC.getCRC(); + JamCRC JCH; + if (PGOOldCFGHashing) { + // Hash format for context sensitive profile. Reserve 4 bits for other + // information. + FunctionHash = (uint64_t)SIVisitor.getNumOfSelectInsts() << 56 | + (uint64_t)ValueSites[IPVK_IndirectCallTarget].size() << 48 | + //(uint64_t)ValueSites[IPVK_MemOPSize].size() << 40 | + (uint64_t)MST.AllEdges.size() << 32 | JC.getCRC(); + } else { + // The higher 32 bits. + union { + uint64_t N; + uint8_t C[8]; + } Data; + Data.N = (uint64_t)SIVisitor.getNumOfSelectInsts(); + JCH.update(Data.C); + Data.N = (uint64_t)ValueSites[IPVK_IndirectCallTarget].size(); + JCH.update(Data.C); + Data.N = (uint64_t)ValueSites[IPVK_MemOPSize].size(); + JCH.update(Data.C); + Data.N = (uint64_t)MST.AllEdges.size(); + JCH.update(Data.C); + + // Hash format for context sensitive profile. Reserve 4 bits for other + // information. + FunctionHash = (((uint64_t)JCH.getCRC()) << 28) + JC.getCRC(); + } + // Reserve bit 60-63 for other information purpose. FunctionHash &= 0x0FFFFFFFFFFFFFFF; + if (IsCS) NamedInstrProfRecord::setCSFlagInHash(FunctionHash); LLVM_DEBUG(dbgs() << "Function Hash Computation for " << F.getName() << ":\n" << " CRC = " << JC.getCRC() << ", Selects = " << SIVisitor.getNumOfSelectInsts() << ", Edges = " << MST.AllEdges.size() << ", ICSites = " - << ValueSites[IPVK_IndirectCallTarget].size() - << ", Hash = " << FunctionHash << "\n";); + << ValueSites[IPVK_IndirectCallTarget].size()); + if (!PGOOldCFGHashing) { + LLVM_DEBUG(dbgs() << ", Memops = " << ValueSites[IPVK_MemOPSize].size() + << ", High32 CRC = " << JCH.getCRC()); + } + LLVM_DEBUG(dbgs() << ", Hash = " << FunctionHash << "\n";); } // Check if we can safely rename this Comdat function. diff --git a/llvm/test/Transforms/PGOProfile/Inputs/PR41279.proftext b/llvm/test/Transforms/PGOProfile/Inputs/PR41279.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/PR41279.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/PR41279.proftext @@ -1,6 +1,6 @@ :ir foo -60927483247 +1096621588030135663 4 3 2 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/PR41279_2.proftext b/llvm/test/Transforms/PGOProfile/Inputs/PR41279_2.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/PR41279_2.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/PR41279_2.proftext @@ -1,6 +1,6 @@ :ir f -62077759478 +1096621589180411894 2 3 2 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext b/llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir test_br_1 -25571299074 +784007059655560962 2 3 2 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/branch1_large_count.proftext b/llvm/test/Transforms/PGOProfile/Inputs/branch1_large_count.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/branch1_large_count.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/branch1_large_count.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir test_br_1 -25571299074 +784007059655560962 2 12884901888 8589934592 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext b/llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir test_br_2 -29667547796 +146835647075900052 2 1 1 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/branch2_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/branch2_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/branch2_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/branch2_entry.proftext @@ -2,7 +2,7 @@ :ir :entry_first test_br_2 -29667547796 +146835647075900052 2 2 1 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext b/llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir test_criticalEdge -82323253069 +93478046750287693 8 2 1 @@ -13,7 +13,7 @@ 1 :bar -12884901887 +742261418966908927 1 7 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/criticaledge_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/criticaledge_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/criticaledge_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/criticaledge_entry.proftext @@ -2,7 +2,7 @@ :ir :entry_first test_criticalEdge -82323253069 +93478046750287693 8 7 2 @@ -14,7 +14,7 @@ 1 :bar -12884901887 +742261418966908927 1 7 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/cspgo.proftext b/llvm/test/Transforms/PGOProfile/Inputs/cspgo.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/cspgo.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/cspgo.proftext @@ -54,7 +54,7 @@ foo # Func Hash: -1152921640672869708 +1456607294772657484 # Num Counters: 10 # Counter Values: @@ -71,7 +71,7 @@ foo # Func Hash: -29212902728 +146835646621254984 # Num Counters: 2 # Counter Values: @@ -80,7 +80,7 @@ bar # Func Hash: -1152921569533132113 +1440408129826749777 # Num Counters: 5 # Counter Values: @@ -92,7 +92,7 @@ bar # Func Hash: -56228292833 +567185239050791137 # Num Counters: 4 # Counter Values: @@ -103,7 +103,7 @@ main # Func Hash: -1152921517491748863 +1895182923573755903 # Num Counters: 1 # Counter Values: @@ -111,7 +111,7 @@ main # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: @@ -135,7 +135,7 @@ goo # Func Hash: -1152921517491748863 +1895182923573755903 # Num Counters: 1 # Counter Values: @@ -143,7 +143,7 @@ goo # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/diag_no_value_sites.proftext b/llvm/test/Transforms/PGOProfile/Inputs/diag_no_value_sites.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/diag_no_value_sites.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/diag_no_value_sites.proftext @@ -1,6 +1,6 @@ # :ir is the flag to indicate this is IR level profile. :ir foo -12884901887 +48277136972185599 1 1 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/fix_entry_count.proftext b/llvm/test/Transforms/PGOProfile/Inputs/fix_entry_count.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/fix_entry_count.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/fix_entry_count.proftext @@ -1,7 +1,7 @@ :ir :entry_first test_simple_for -34137660316 +1063705162469825436 2 0 96 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext @@ -3,7 +3,7 @@ :entry_first hot # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: @@ -11,7 +11,7 @@ cold # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: @@ -19,7 +19,7 @@ med # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext b/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext @@ -1,7 +1,7 @@ :ir bar # Func Hash: -281487861612543 +170957022131388415 # Num Counters: 1 # Counter Values: @@ -19,7 +19,7 @@ func1 # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: @@ -27,7 +27,7 @@ func2 # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: @@ -35,7 +35,7 @@ func3 # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/indirectbr.proftext b/llvm/test/Transforms/PGOProfile/Inputs/indirectbr.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/indirectbr.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/indirectbr.proftext @@ -2,7 +2,7 @@ :ir foo # Func Hash: -47485104005 +844982796158316421 # Num Counters: 4 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/indirectbr_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/indirectbr_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/indirectbr_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/indirectbr_entry.proftext @@ -3,7 +3,7 @@ :entry_first foo # Func Hash: -47485104005 +844982796158316421 # Num Counters: 4 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext b/llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext @@ -1,7 +1,7 @@ :ir _Z11irreducibleii # Func Hash: -64451410787 +287486624745028451 # Num Counters: 6 # Counter Values: @@ -14,7 +14,7 @@ _Z11irreduciblePh # Func Hash: -104649601521 +331779889035882993 # Num Counters: 9 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/irreducible_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/irreducible_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/irreducible_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/irreducible_entry.proftext @@ -2,7 +2,7 @@ :entry_first _Z11irreducibleii # Func Hash: -64451410787 +287486624745028451 # Num Counters: 6 # Counter Values: @@ -15,7 +15,7 @@ _Z11irreduciblePh # Func Hash: -104649601521 +331779889035882993 # Num Counters: 9 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext b/llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir foo -59130013419 +567185241952511723 4 3 1 @@ -9,7 +9,7 @@ 0 bar -24868915205 +784007058953177093 2 3 2 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/landingpad_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/landingpad_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/landingpad_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/landingpad_entry.proftext @@ -2,7 +2,7 @@ :ir :entry_first foo -59130013419 +567185241952511723 4 5 1 @@ -10,7 +10,7 @@ 0 bar -24868915205 +784007058953177093 2 3 2 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/large_count_remarks.proftext b/llvm/test/Transforms/PGOProfile/Inputs/large_count_remarks.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/large_count_remarks.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/large_count_remarks.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir test -25571299074 +784007059655560962 2 40000000000 20000000000 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext b/llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir test_simple_for -34137660316 +1063705162469825436 2 96 4 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/loop1_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/loop1_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/loop1_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/loop1_entry.proftext @@ -2,7 +2,7 @@ :ir :entry_first test_simple_for -34137660316 +1063705162469825436 2 4 96 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext b/llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir test_nested_for -53929068288 +798733566382720768 3 33 10 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/loop2_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/loop2_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/loop2_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/loop2_entry.proftext @@ -2,7 +2,7 @@ :ir :entry_first test_nested_for -53929068288 +798733566382720768 3 6 33 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/memop_size_annotation.proftext b/llvm/test/Transforms/PGOProfile/Inputs/memop_size_annotation.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/memop_size_annotation.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/memop_size_annotation.proftext @@ -2,7 +2,7 @@ :ir foo # Func Hash: -53929068288 +687116424982578944 # Num Counters: 3 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch-correct.proftext b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch-correct.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch-correct.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch-correct.proftext @@ -2,7 +2,7 @@ :ir bar # Func Hash: -29667547796 +146835647075900052 # Num Counters: 2 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch.proftext b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch.proftext @@ -2,7 +2,7 @@ :ir bar # Func Hash: -29667547796 +146835647075900052 # Num Counters: 2 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch_entry.proftext @@ -3,7 +3,7 @@ :entry_first bar # Func Hash: -29667547796 +146835647075900052 # Num Counters: 2 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct.proftext b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct.proftext @@ -2,7 +2,7 @@ :ir main # Func Hash: -74054140268 +391331300939170156 # Num Counters: 7 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct_entry.proftext @@ -3,7 +3,7 @@ :entry_first main # Func Hash: -74054140268 +391331300939170156 # Num Counters: 7 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch.proftext b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch.proftext @@ -2,7 +2,7 @@ :ir main # Func Hash: -74054140268 +391331300939170156 # Num Counters: 7 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch_entry.proftext @@ -3,7 +3,7 @@ :entry_first main # Func Hash: -74054140268 +391331300939170156 # Num Counters: 7 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/multiple_hash_profile.proftext b/llvm/test/Transforms/PGOProfile/Inputs/multiple_hash_profile.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/multiple_hash_profile.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/multiple_hash_profile.proftext @@ -2,7 +2,7 @@ :ir _Z3fooi # Func Hash: -72057606922829823 +382993475055910911 # Num Counters: 2 # Counter Values: @@ -19,7 +19,7 @@ _Z3bari # Func Hash: -72057606922829823 +382993475055910911 # Num Counters: 2 # Counter Values: @@ -28,7 +28,7 @@ _Z4m2f1v # Func Hash: -12884901887 +742261418966908927 # Num Counters: 1 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/noreturncall.proftext b/llvm/test/Transforms/PGOProfile/Inputs/noreturncall.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/noreturncall.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/noreturncall.proftext @@ -2,7 +2,7 @@ :ir foo # Func Hash: -36496524737 +238984482720105921 # Num Counters: 3 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/remap.proftext b/llvm/test/Transforms/PGOProfile/Inputs/remap.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/remap.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/remap.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir _ZN3foo3barERKN1N1XINS_4quuxEEE -25571299074 +784007059655560962 2 3 2 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/select1.proftext b/llvm/test/Transforms/PGOProfile/Inputs/select1.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/select1.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/select1.proftext @@ -1,7 +1,7 @@ :ir :entry_first test_br_2 -72057623705475732 +942389667449461396 3 5 1 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/select2.proftext b/llvm/test/Transforms/PGOProfile/Inputs/select2.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/select2.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/select2.proftext @@ -3,7 +3,7 @@ :entry_first foo # Func Hash: -72057628175588252 +134732432632142748 # Num Counters: 3 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/Inputs/switch.proftext b/llvm/test/Transforms/PGOProfile/Inputs/switch.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/switch.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/switch.proftext @@ -1,7 +1,7 @@ # :ir is the flag to indicate this is IR level profile. :ir test_switch -46200943743 +536873293052540031 4 0 5 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/switch_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/switch_entry.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/switch_entry.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/switch_entry.proftext @@ -2,7 +2,7 @@ :ir :entry_first test_switch -46200943743 +536873293052540031 4 10 5 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cs.proftext b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cs.proftext --- a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cs.proftext +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cs.proftext @@ -10,7 +10,7 @@ foo # Func Hash: -29212902728 +1720106746050921044 # Num Counters: 2 # Counter Values: @@ -19,7 +19,7 @@ bar # Func Hash: -1152921534274394772 +1299757151682747028 # Num Counters: 2 # Counter Values: @@ -45,7 +45,7 @@ main # Func Hash: -12884901887 +1895182923573755903 # Num Counters: 1 # Counter Values: @@ -53,7 +53,7 @@ cspgo.c:foo # Func Hash: -1152921563228422740 +1720106746050921044 # Num Counters: 4 # Counter Values: diff --git a/llvm/test/Transforms/PGOProfile/PR41279.ll b/llvm/test/Transforms/PGOProfile/PR41279.ll --- a/llvm/test/Transforms/PGOProfile/PR41279.ll +++ b/llvm/test/Transforms/PGOProfile/PR41279.ll @@ -27,7 +27,7 @@ 6: cleanupret from %17 unwind to caller ; GEN: 6: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 60927483247, i32 4, i32 2) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 2) 7: store i8 1, i8* %3, align 1 @@ -50,13 +50,13 @@ store i8 0, i8* %3, align 1 br label %14 ; GEN: 12: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 60927483247, i32 4, i32 1) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 1) 13: call void @f3({ i8*, i64 }* %0, { i8*, i64 }* %1, i64 1) br label %14 ; GEN: 13: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 60927483247, i32 4, i32 0) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 0) 14: ret void @@ -65,7 +65,7 @@ store i8 0, i8* %3, align 1 br label %6 ; GEN: 15: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 60927483247, i32 4, i32 3) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 3) 16: %17 = cleanuppad within none [] diff --git a/llvm/test/Transforms/PGOProfile/PR41279_2.ll b/llvm/test/Transforms/PGOProfile/PR41279_2.ll --- a/llvm/test/Transforms/PGOProfile/PR41279_2.ll +++ b/llvm/test/Transforms/PGOProfile/PR41279_2.ll @@ -30,7 +30,7 @@ store i32 %2, i32* %__exception_code, align 4 br label %__try.cont7 ;GEN: _except1: -;GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_f, i32 0, i32 0), i64 62077759478, i32 2, i32 1) +;GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_f, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1) invoke.cont: br label %__try.cont @@ -59,7 +59,7 @@ invoke.cont3: br label %__try.cont7 ;GEN: invoke.cont3: -;GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_f, i32 0, i32 0), i64 62077759478, i32 2, i32 0) +;GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_f, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) } diff --git a/llvm/test/Transforms/PGOProfile/branch1.ll b/llvm/test/Transforms/PGOProfile/branch1.ll --- a/llvm/test/Transforms/PGOProfile/branch1.ll +++ b/llvm/test/Transforms/PGOProfile/branch1.ll @@ -32,7 +32,7 @@ ; USE-SAME: !prof ![[FUNC_ENTRY_COUNT:[0-9]+]] entry: ; GEN: entry: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_1, i32 0, i32 0), i64 25571299074, i32 2, i32 0) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_1, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) %cmp = icmp sgt i32 %i, 0 br i1 %cmp, label %if.then, label %if.end ; USE: br i1 %cmp, label %if.then, label %if.end @@ -44,7 +44,7 @@ if.then: ; GEN: if.then: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_1, i32 0, i32 0), i64 25571299074, i32 2, i32 1) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_1, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1) %add = add nsw i32 %i, 2 br label %if.end diff --git a/llvm/test/Transforms/PGOProfile/branch2.ll b/llvm/test/Transforms/PGOProfile/branch2.ll --- a/llvm/test/Transforms/PGOProfile/branch2.ll +++ b/llvm/test/Transforms/PGOProfile/branch2.ll @@ -20,7 +20,7 @@ entry: ; GEN: entry: ; NOTENTRY-NOT: llvm.instrprof.increment -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 29667547796, i32 2, i32 0) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) %cmp = icmp sgt i32 %i, 0 br i1 %cmp, label %if.then, label %if.else ; USE: br i1 %cmp, label %if.then, label %if.else @@ -29,14 +29,14 @@ if.then: ; GEN: if.then: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 29667547796, i32 2, i32 0) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) ; ENTRY-NOT: llvm.instrprof.increment %add = add nsw i32 %i, 2 br label %if.end if.else: ; GEN: if.else: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 29667547796, i32 2, i32 1) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1) %sub = sub nsw i32 %i, 2 br label %if.end diff --git a/llvm/test/Transforms/PGOProfile/criticaledge.ll b/llvm/test/Transforms/PGOProfile/criticaledge.ll --- a/llvm/test/Transforms/PGOProfile/criticaledge.ll +++ b/llvm/test/Transforms/PGOProfile/criticaledge.ll @@ -21,7 +21,7 @@ entry: ; CHECK: entry: ; NOTENTRY-NOT: call void @llvm.instrprof.increment -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 0) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 0) switch i32 %i, label %sw.default [ i32 1, label %sw.bb i32 2, label %sw.bb1 @@ -35,24 +35,24 @@ ; USE-SAME: !prof ![[BW_SWITCH:[0-9]+]] ; CHECK: entry.sw.bb2_crit_edge1: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 1) -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 2) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 1) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 2) ; CHECK: br label %sw.bb2 ; CHECK: entry.sw.bb2_crit_edge: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 0) -; TENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 1) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 0) +; TENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 1) ; CHECK: br label %sw.bb2 sw.bb: ; GEN: sw.bb: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 5) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 5) %call = call i32 @bar(i32 2) br label %sw.epilog sw.bb1: ; GEN: sw.bb1: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 4) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 4) %call2 = call i32 @bar(i32 1024) br label %sw.epilog @@ -66,14 +66,14 @@ if.then: ; GEN: if.then: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 2) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 2) ; ENTRY-NOT: call void @llvm.instrprof.increment %call4 = call i32 @bar(i32 4) br label %return if.end: ; GEN: if.end: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 3) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 3) %call5 = call i32 @bar(i32 8) br label %sw.epilog @@ -88,13 +88,13 @@ if.then8: ; GEN: if.then8: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 7) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 7) %add = add nsw i32 %call6, 10 br label %if.end9 if.end9: ; GEN: if.end9: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 82323253069, i32 8, i32 6) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__profn_test_criticalEdge, i32 0, i32 0), i64 {{[0-9]+}}, i32 8, i32 6) %res.0 = phi i32 [ %add, %if.then8 ], [ %call6, %sw.default ] br label %sw.epilog @@ -113,7 +113,7 @@ define internal i32 @bar(i32 %i) { entry: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn__stdin__bar, i32 0, i32 0), i64 12884901887, i32 1, i32 0) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn__stdin__bar, i32 0, i32 0), i64 {{[0-9]+}}, i32 1, i32 0) ret i32 %i } diff --git a/llvm/test/Transforms/PGOProfile/instr_entry_bb.ll b/llvm/test/Transforms/PGOProfile/instr_entry_bb.ll --- a/llvm/test/Transforms/PGOProfile/instr_entry_bb.ll +++ b/llvm/test/Transforms/PGOProfile/instr_entry_bb.ll @@ -16,7 +16,7 @@ define i32 @test_br_2(i32 %i) { entry: ; GEN: entry: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 29667547796, i32 2, i32 0) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) ; GENA: entry: ; GENA: %{{[0-9+]}} = atomicrmw add i64* getelementptr inbounds ([2 x i64], [2 x i64]* @__profc_test_br_2, i64 0, i64 0), i64 1 monotonic ; USE: br i1 %cmp, label %if.then, label %if.else @@ -33,7 +33,7 @@ if.else: ; GEN: if.else: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 29667547796, i32 2, i32 1) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1) ; GENA: if.else: ; GENA: %pgocount = load i64, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @__profc_test_br_2, i64 0, i64 1), align 8 ; GENA: [[V:%[0-9]*]] = add i64 %pgocount, 1 diff --git a/llvm/test/Transforms/PGOProfile/landingpad.ll b/llvm/test/Transforms/PGOProfile/landingpad.ll --- a/llvm/test/Transforms/PGOProfile/landingpad.ll +++ b/llvm/test/Transforms/PGOProfile/landingpad.ll @@ -22,7 +22,7 @@ define i32 @bar(i32 %i) { entry: ; GEN: entry: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 24868915205, i32 2, i32 0) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) %rem = srem i32 %i, 3 %tobool = icmp ne i32 %rem, 0 br i1 %tobool, label %if.then, label %if.end @@ -31,7 +31,7 @@ if.then: ; GEN: if.then: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 24868915205, i32 2, i32 1) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1) %exception = call i8* @__cxa_allocate_exception(i64 4) %tmp = bitcast i8* %exception to i32* store i32 %i, i32* %tmp, align 16 @@ -53,7 +53,7 @@ entry: ; GEN: entry: ; NOTENTRY-NOT: call void @llvm.instrprof.increment -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 59130013419, i32 4, i32 0) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 0) %rem = srem i32 %i, 2 %tobool = icmp ne i32 %rem, 0 br i1 %tobool, label %if.then, label %if.end @@ -69,7 +69,7 @@ invoke.cont: ; GEN: invoke.cont: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 59130013419, i32 4, i32 1) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 1) br label %if.end lpad: @@ -92,7 +92,7 @@ catch: ; GEN: catch: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 59130013419, i32 4, i32 2) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 2) %tmp4 = call i8* @__cxa_begin_catch(i8* %tmp1) %tmp5 = bitcast i8* %tmp4 to i32* %tmp6 = load i32, i32* %tmp5, align 4 @@ -109,7 +109,7 @@ if.end: ; GEN: if.end: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 59130013419, i32 4, i32 0) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 0) ; ENTRY-NOT: call void @llvm.instrprof.increment %tmp8 = load i32, i32* @val, align 4 %add = add nsw i32 %tmp8, %i @@ -118,7 +118,7 @@ eh.resume: ; GEN: eh.resume: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 59130013419, i32 4, i32 3) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 3) %lpad.val = insertvalue { i8*, i32 } undef, i8* %tmp1, 0 %lpad.val3 = insertvalue { i8*, i32 } %lpad.val, i32 %tmp2, 1 resume { i8*, i32 } %lpad.val3 diff --git a/llvm/test/Transforms/PGOProfile/loop1.ll b/llvm/test/Transforms/PGOProfile/loop1.ll --- a/llvm/test/Transforms/PGOProfile/loop1.ll +++ b/llvm/test/Transforms/PGOProfile/loop1.ll @@ -19,8 +19,8 @@ define i32 @test_simple_for(i32 %n) { entry: ; GEN: entry: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_simple_for, i32 0, i32 0), i64 34137660316, i32 2, i32 1) -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_simple_for, i32 0, i32 0), i64 34137660316, i32 2, i32 0) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_simple_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_simple_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) br label %for.cond for.cond: @@ -42,8 +42,8 @@ for.inc: ; GEN: for.inc: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_simple_for, i32 0, i32 0), i64 34137660316, i32 2, i32 0) -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_simple_for, i32 0, i32 0), i64 34137660316, i32 2, i32 1) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_simple_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_simple_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1) %inc1 = add nsw i32 %i, 1 br label %for.cond diff --git a/llvm/test/Transforms/PGOProfile/loop2.ll b/llvm/test/Transforms/PGOProfile/loop2.ll --- a/llvm/test/Transforms/PGOProfile/loop2.ll +++ b/llvm/test/Transforms/PGOProfile/loop2.ll @@ -18,8 +18,8 @@ define i32 @test_nested_for(i32 %r, i32 %s) { entry: ; GEN: entry: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 53929068288, i32 3, i32 2) -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 53929068288, i32 3, i32 0) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 3, i32 2) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 3, i32 0) br label %for.cond.outer for.cond.outer: @@ -55,8 +55,8 @@ for.inc.inner: ; GEN: for.inc.inner: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 53929068288, i32 3, i32 0) -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 53929068288, i32 3, i32 1) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 3, i32 0) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 3, i32 1) %inc.1 = add nsw i32 %j.0, 1 br label %for.cond.inner @@ -66,8 +66,8 @@ for.inc.outer: ; GEN: for.inc.outer: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 53929068288, i32 3, i32 1) -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 53929068288, i32 3, i32 2) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 3, i32 1) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__profn_test_nested_for, i32 0, i32 0), i64 {{[0-9]+}}, i32 3, i32 2) %inc.2 = add nsw i32 %i.0, 1 br label %for.cond.outer diff --git a/llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll b/llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll --- a/llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll +++ b/llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll @@ -5,7 +5,7 @@ ; CHECK_LABEL: test ; CHECK: %1 = zext i32 %c to i64 -; CHECK: call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__profn_test, i32 0, i32 0), i64 12884901887, i64 %1, i32 1, i32 0) +; CHECK: call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__profn_test, i32 0, i32 0), i64 48277136972185599, i64 %1, i32 1, i32 0) define void @test(i8* %a, i8* %p) { %c = call i32 @strlen(i8* %p) diff --git a/llvm/test/Transforms/PGOProfile/single_bb.ll b/llvm/test/Transforms/PGOProfile/single_bb.ll --- a/llvm/test/Transforms/PGOProfile/single_bb.ll +++ b/llvm/test/Transforms/PGOProfile/single_bb.ll @@ -10,6 +10,6 @@ define i32 @single_bb() { entry: ; GEN: entry: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_single_bb, i32 0, i32 0), i64 12884901887, i32 1, i32 0) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_single_bb, i32 0, i32 0), i64 {{[0-9]+}}, i32 1, i32 0) ret i32 0 } diff --git a/llvm/test/Transforms/PGOProfile/switch.ll b/llvm/test/Transforms/PGOProfile/switch.ll --- a/llvm/test/Transforms/PGOProfile/switch.ll +++ b/llvm/test/Transforms/PGOProfile/switch.ll @@ -19,7 +19,7 @@ entry: ; GEN: entry: ; NOTENTRY-NOT: call void @llvm.instrprof.increment -; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 46200943743, i32 4, i32 0) +; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 0) switch i32 %i, label %sw.default [ i32 1, label %sw.bb i32 2, label %sw.bb1 @@ -31,23 +31,23 @@ sw.bb: ; GEN: sw.bb: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 46200943743, i32 4, i32 2) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 2) br label %sw.epilog sw.bb1: ; GEN: sw.bb1: -; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 46200943743, i32 4, i32 0) +; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 0) ; ENTRY-NOT: call void @llvm.instrprof.increment br label %sw.epilog sw.bb2: ; GEN: sw.bb2: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 46200943743, i32 4, i32 1) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 1) br label %sw.epilog sw.default: ; GEN: sw.default: -; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 46200943743, i32 4, i32 3) +; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__profn_test_switch, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 3) br label %sw.epilog sw.epilog: