summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-04-10 03:32:02 +0000
committerXinliang David Li <davidxl@google.com>2016-04-10 03:32:02 +0000
commit284644838fa71fd129ce4e344b56f51220dcb83d (patch)
tree79e12d2b5ea5b55e61bd6cfd311b027e90c2b927 /llvm/lib
parentcb1225544269694305f433a60ee6387690d9729a (diff)
downloadbcm5719-llvm-284644838fa71fd129ce4e344b56f51220dcb83d.tar.gz
bcm5719-llvm-284644838fa71fd129ce4e344b56f51220dcb83d.zip
[PGO] Fix deserialize bug
Raw function pointer collected by value profile data may be from external functions that are not instrumented. They won't have mapping data to be used by the deserializer. Force the value to be 0 in this case. llvm-svn: 265890
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ProfileData/InstrProf.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index cd7ddafd817..7e043e3792a 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -398,8 +398,10 @@ uint64_t InstrProfRecord::remapValue(uint64_t Value, uint32_t ValueKind,
std::lower_bound(ValueMap->begin(), ValueMap->end(), Value,
[](const std::pair<uint64_t, uint64_t> &LHS,
uint64_t RHS) { return LHS.first < RHS; });
- if (Result != ValueMap->end())
+ if (Result != ValueMap->end() && Result->first == Value)
Value = (uint64_t)Result->second;
+ else
+ Value = 0;
break;
}
}
OpenPOWER on IntegriCloud