[PATCH] D48510: [SampleFDO] Add an option to turn on/off warning about samples unused

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 25 08:45:16 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL335484: [SampleFDO] Add an option to turn on/off warning about samples unused. (authored by wmi, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48510?vs=152557&id=152701#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D48510

Files:
  llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp


Index: llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
+++ llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
@@ -111,6 +111,11 @@
     cl::desc("Emit a warning if less than N% of samples in the input profile "
              "are matched to the IR."));
 
+static cl::opt<bool> NoWarnSampleUnused(
+    "no-warn-sample-unused", cl::init(false), cl::Hidden,
+    cl::desc("Use this option to turn off/on warnings about function with "
+             "samples but without debug information to use those samples. "));
+
 namespace {
 
 using BlockWeightMap = DenseMap<const BasicBlock *, uint64_t>;
@@ -1360,6 +1365,9 @@
   if (DISubprogram *S = F.getSubprogram())
     return S->getLine();
 
+  if (NoWarnSampleUnused)
+    return 0;
+
   // If the start of \p F is missing, emit a diagnostic to inform the user
   // about the missed opportunity.
   F.getContext().diagnose(DiagnosticInfoSampleProfile(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48510.152701.patch
Type: text/x-patch
Size: 1017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180625/1776a925/attachment.bin>


More information about the llvm-commits mailing list