summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2017-08-16 17:33:43 +0000
committerXinliang David Li <davidxl@google.com>2017-08-16 17:33:43 +0000
commit5a57b842cfa8a7cf36eb13670a697dadf01172e0 (patch)
treea6321190d2a24b86a4742eb79ebdea93dacb5d4f /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentae3527e6bbe8d8de2ff0fa62b1352f7d3371d6f1 (diff)
downloadbcm5719-llvm-5a57b842cfa8a7cf36eb13670a697dadf01172e0.tar.gz
bcm5719-llvm-5a57b842cfa8a7cf36eb13670a697dadf01172e0.zip
Add more comment
llvm-svn: 311025
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index e3b43b333a1..c81e2006ad8 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -3627,7 +3627,15 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
if (!CallValueId)
continue;
// The mapping from OriginalId to GUID may return a GUID
- // that corresponds to a static varible. Filter it out here.
+ // that corresponds to a static variable. Filter it out here.
+ // This can happen when
+ // 1) There is a call to a library function which does not have
+ // a CallValidId;
+ // 2) There is a static variable with the OriginalGUID identical
+ // to the GUID of the library function in 1);
+ // When this happens, the logic for SamplePGO kicks in and
+ // the static varible in 2) will be found, which needs to be
+ // filtered out.
auto *GVSum = Index.getGlobalValueSummary(GUID, false);
if (GVSum &&
GVSum->getSummaryKind() == GlobalValueSummary::GlobalVarKind)
OpenPOWER on IntegriCloud