From d14f0dbc9b3cd6f78e9029e3cea14e8a9434c52b Mon Sep 17 00:00:00 2001 From: Betul Buyukkurt Date: Thu, 14 Apr 2016 16:25:45 +0000 Subject: [PATCH] [PGO] Do not attach VP metadata if value count at site is 0 [NFC] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266335 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ProfileData/InstrProf.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ProfileData/InstrProf.cpp b/lib/ProfileData/InstrProf.cpp index 7f4a87a14ee..f1a6ce9854a 100644 --- a/lib/ProfileData/InstrProf.cpp +++ b/lib/ProfileData/InstrProf.cpp @@ -636,6 +636,8 @@ void annotateValueSite(Module &M, Instruction &Inst, 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 VD = -- 2.11.0