<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif">I didn't realize llvm-profdata has a command line guide, then there are several other flags which havn't been added to the commandline guide. I will add them. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 12, 2020 at 3:11 PM Xinliang David Li <<a href="mailto:xinliangli@gmail.com">xinliangli@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Command line guide needs to be updated too.<div><br></div><div>David</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 12, 2020 at 3:06 PM Wei Mi via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Wei Mi<br>
Date: 2020-05-12T15:06:03-07:00<br>
New Revision: 56926ae0faa67ac4c3b75609bfeea2eb324c0851<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/56926ae0faa67ac4c3b75609bfeea2eb324c0851" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/56926ae0faa67ac4c3b75609bfeea2eb324c0851</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/56926ae0faa67ac4c3b75609bfeea2eb324c0851.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/56926ae0faa67ac4c3b75609bfeea2eb324c0851.diff</a><br>
<br>
LOG: [SampleFDO] Rename llvm-profdata flag -partial-profile to -gen-partial-profile.<br>
<br>
The internal flag -partial-profile in llvm conflicts with the flag with<br>
the same name in llvm-profdata. The conflict happens in builds with<br>
LLVM_LINK_LLVM_DYLIB enabled. In this case the tools are linked with libLLVM<br>
and we end up with two definitions for the same cl::opt.<br>
<br>
The patch renames llvm-profdata flag -partial-profile to -gen-partial-profile.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/test/tools/llvm-profdata/show-prof-info.test<br>
    llvm/tools/llvm-profdata/llvm-profdata.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/test/tools/llvm-profdata/show-prof-info.test b/llvm/test/tools/llvm-profdata/show-prof-info.test<br>
index ca91051dc1c8..4a748667d1ad 100644<br>
--- a/llvm/test/tools/llvm-profdata/show-prof-info.test<br>
+++ b/llvm/test/tools/llvm-profdata/show-prof-info.test<br>
@@ -1,5 +1,5 @@<br>
 REQUIRES: zlib<br>
-; RUN: llvm-profdata merge -sample -extbinary -use-md5 -compress-all-sections -partial-profile -prof-sym-list=%S/Inputs/profile-symbol-list-1.text %S/Inputs/sample-profile.proftext -o %t.1.output<br>
+; RUN: llvm-profdata merge -sample -extbinary -use-md5 -compress-all-sections -gen-partial-profile -prof-sym-list=%S/Inputs/profile-symbol-list-1.text %S/Inputs/sample-profile.proftext -o %t.1.output<br>
 ; RUN: wc -c < %t.1.output > %t.txt<br>
 ; RUN: llvm-profdata show -sample -show-sec-info-only %t.1.output >> %t.txt<br>
 ; RUN: FileCheck %s --input-file=%t.txt<br>
<br>
diff  --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp<br>
index 6d2f636b35e9..3d0e820d2f59 100644<br>
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp<br>
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp<br>
@@ -449,7 +449,7 @@ static void handleExtBinaryWriter(sampleprof::SampleProfileWriter &Writer,<br>
                                   MemoryBuffer *Buffer,<br>
                                   sampleprof::ProfileSymbolList &WriterList,<br>
                                   bool CompressAllSections, bool UseMD5,<br>
-                                  bool PartialProfile) {<br>
+                                  bool GenPartialProfile) {<br>
   populateProfileSymbolList(Buffer, WriterList);<br>
   if (WriterList.size() > 0 && OutputFormat != PF_Ext_Binary)<br>
     warn("Profile Symbol list is not empty but the output format is not "<br>
@@ -469,9 +469,9 @@ static void handleExtBinaryWriter(sampleprof::SampleProfileWriter &Writer,<br>
     else<br>
       Writer.setUseMD5();<br>
   }<br>
-  if (PartialProfile) {<br>
+  if (GenPartialProfile) {<br>
     if (OutputFormat != PF_Ext_Binary)<br>
-      warn("-partial-profile is ignored. Specify -extbinary to enable it");<br>
+      warn("-gen-partial-profile is ignored. Specify -extbinary to enable it");<br>
     else<br>
       Writer.setPartialProfile();<br>
   }<br>
@@ -481,7 +481,7 @@ static void<br>
 mergeSampleProfile(const WeightedFileVector &Inputs, SymbolRemapper *Remapper,<br>
                    StringRef OutputFilename, ProfileFormat OutputFormat,<br>
                    StringRef ProfileSymbolListFile, bool CompressAllSections,<br>
-                   bool UseMD5, bool PartialProfile, FailureMode FailMode) {<br>
+                   bool UseMD5, bool GenPartialProfile, FailureMode FailMode) {<br>
   using namespace sampleprof;<br>
   StringMap<FunctionSamples> ProfileMap;<br>
   SmallVector<std::unique_ptr<sampleprof::SampleProfileReader>, 5> Readers;<br>
@@ -538,7 +538,7 @@ mergeSampleProfile(const WeightedFileVector &Inputs, SymbolRemapper *Remapper,<br>
   // Make sure Buffer lives as long as WriterList.<br>
   auto Buffer = getInputFileBuf(ProfileSymbolListFile);<br>
   handleExtBinaryWriter(*Writer, OutputFormat, Buffer.get(), WriterList,<br>
-                        CompressAllSections, UseMD5, PartialProfile);<br>
+                        CompressAllSections, UseMD5, GenPartialProfile);<br>
   Writer->write(ProfileMap);<br>
 }<br>
<br>
@@ -670,10 +670,9 @@ static int merge_main(int argc, const char *argv[]) {<br>
       "use-md5", cl::init(false), cl::Hidden,<br>
       cl::desc("Choose to use MD5 to represent string in name table (only "<br>
                "meaningful for -extbinary)"));<br>
-  cl::opt<bool> PartialProfile(<br>
-      "partial-profile", cl::init(false), cl::Hidden,<br>
-      cl::desc("Set the profile to be a partial profile (only meaningful "<br>
-               "for -extbinary)"));<br>
+  cl::opt<bool> GenPartialProfile(<br>
+      "gen-partial-profile", cl::init(false), cl::Hidden,<br>
+      cl::desc("Generate a partial profile (only meaningful for -extbinary)"));<br>
<br>
   cl::ParseCommandLineOptions(argc, argv, "LLVM profile data merger\n");<br>
<br>
@@ -708,7 +707,7 @@ static int merge_main(int argc, const char *argv[]) {<br>
   else<br>
     mergeSampleProfile(WeightedInputs, Remapper.get(), OutputFilename,<br>
                        OutputFormat, ProfileSymbolListFile, CompressAllSections,<br>
-                       UseMD5, PartialProfile, FailureMode);<br>
+                       UseMD5, GenPartialProfile, FailureMode);<br>
<br>
   return 0;<br>
 }<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div></div>