diff options
author | Xinliang David Li <davidxl@google.com> | 2017-08-16 17:18:01 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2017-08-16 17:18:01 +0000 |
commit | 71ecaa19ff0a6f63b1e0c9fa6d28f5fa84b8072d (patch) | |
tree | 4922a616369879bd8ebc947d830a113a6eb59822 /llvm/lib | |
parent | 999b1d942627537be989a53748b61b49a1d59a24 (diff) | |
download | bcm5719-llvm-71ecaa19ff0a6f63b1e0c9fa6d28f5fa84b8072d.tar.gz bcm5719-llvm-71ecaa19ff0a6f63b1e0c9fa6d28f5fa84b8072d.zip |
[PGO] Fix ThinLTO crash
Differential Revsion: http://reviews.llvm.org/D36640
llvm-svn: 311023
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index fc58718df1f..e3b43b333a1 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -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) |