summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBetul Buyukkurt <betulb@codeaurora.org>2016-04-14 16:25:45 +0000
committerBetul Buyukkurt <betulb@codeaurora.org>2016-04-14 16:25:45 +0000
commit4f1e8c94bfd013223590d83fb11eeff110600440 (patch)
tree3776e80e68d8fd7150b8a471d04fde3fc224564d /llvm/lib
parentb77365b5954b6c4c601e22e53999a8534d51141b (diff)
downloadbcm5719-llvm-4f1e8c94bfd013223590d83fb11eeff110600440.tar.gz
bcm5719-llvm-4f1e8c94bfd013223590d83fb11eeff110600440.zip
[PGO] Do not attach VP metadata if value count at site is 0 [NFC]
llvm-svn: 266335
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ProfileData/InstrProf.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index 7f4a87a14ee..f1a6ce9854a 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/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<InstrProfValueData[]> VD =
OpenPOWER on IntegriCloud