[llvm] r266335 - [PGO] Do not attach VP metadata if value count at site is 0 [NFC]

Betul Buyukkurt via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 09:25:46 PDT 2016


Author: betulb
Date: Thu Apr 14 11:25:45 2016
New Revision: 266335

URL: http://llvm.org/viewvc/llvm-project?rev=266335&view=rev
Log:
[PGO] Do not attach VP metadata if value count at site is 0 [NFC] 


Modified:
    llvm/trunk/lib/ProfileData/InstrProf.cpp

Modified: llvm/trunk/lib/ProfileData/InstrProf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProf.cpp?rev=266335&r1=266334&r2=266335&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProf.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProf.cpp Thu Apr 14 11:25:45 2016
@@ -636,6 +636,8 @@ void annotateValueSite(Module &M, Instru
                        InstrProfValueKind ValueKind, uint32_t SiteIdx,
                        uint32_t MaxMDCount) {
   uint32_t NV = InstrProfR.getNumValueDataForSite(ValueKind, SiteIdx);
+  if (!NV)
+    return;
 
   uint64_t Sum = 0;
   std::unique_ptr<InstrProfValueData[]> VD =




More information about the llvm-commits mailing list