summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp6
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)
OpenPOWER on IntegriCloud