Add more comment

llvm-svn: 311025
This commit is contained in:
Xinliang David Li 2017-08-16 17:33:43 +00:00
parent ae3527e6bb
commit 5a57b842cf
1 changed files with 9 additions and 1 deletions

View File

@ -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)