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: 0x000f0012a7ab6e87 // 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 @@ -641,9 +641,9 @@ // 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 | + FunctionHash = (uint64_t)SIVisitor.getNumOfSelectInsts() << 57 | + (uint64_t)ValueSites[IPVK_IndirectCallTarget].size() << 50 | + (uint64_t)ValueSites[IPVK_MemOPSize].size() << 48 | (uint64_t)MST.AllEdges.size() << 32 | JC.getCRC(); // Reserve bit 60-63 for other information purpose. FunctionHash &= 0x0FFFFFFFFFFFFFFF; @@ -654,6 +654,7 @@ << ", Selects = " << SIVisitor.getNumOfSelectInsts() << ", Edges = " << MST.AllEdges.size() << ", ICSites = " << ValueSites[IPVK_IndirectCallTarget].size() + << ", Memops = " << ValueSites[IPVK_MemOPSize].size() << ", Hash = " << FunctionHash << "\n";); } 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 +281487861612543 1 1 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 +1125912791744511 # Num Counters: 1 # Counter Values: 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 +844478859200256 # Num Counters: 3 # 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 +144115200960757759 # Num Counters: 2 # Counter Values: @@ -19,7 +19,7 @@ _Z3bari # Func Hash: -72057606922829823 +144115200960757759 # Num Counters: 2 # Counter Values: 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 +144115217743403668 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 +144115222213516188 # Num Counters: 3 # Counter Values: 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 281487861612543, i64 %1, i32 1, i32 0) define void @test(i8* %a, i8* %p) { %c = call i32 @strlen(i8* %p)