[PGO] Fix ThinLTO crash

Differential Revsion: http://reviews.llvm.org/D36640


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311023 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Xinliang David Li
2017-08-16 17:18:01 +00:00
parent cb139f4145
commit 2f4468d845
3 changed files with 26 additions and 0 deletions

View File

@@ -3626,6 +3626,12 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
CallValueId = getValueId(GUID);
if (!CallValueId)
continue;
// The mapping from OriginalId to GUID may return a GUID
// that corresponds to a static varible. Filter it out here.
auto *GVSum = Index.getGlobalValueSummary(GUID, false);
if (GVSum &&
GVSum->getSummaryKind() == GlobalValueSummary::GlobalVarKind)
continue;
}
NameVals.push_back(*CallValueId);
if (HasProfileData)