[llvm] r311025 - Add more comment

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 10:33:43 PDT 2017


Author: davidxl
Date: Wed Aug 16 10:33:43 2017
New Revision: 311025

URL: http://llvm.org/viewvc/llvm-project?rev=311025&view=rev
Log:
Add more comment

Modified:
    llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp

Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=311025&r1=311024&r2=311025&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Wed Aug 16 10:33:43 2017
@@ -3627,7 +3627,15 @@ void IndexBitcodeWriter::writeCombinedGl
         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)




More information about the llvm-commits mailing list