[PATCH] D89524: [NFC][SampleFDO] Move some common stuff from SampleProfileReaderExtBinary/SampleProfileWriterExtBinary to their parent classes.

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 10:11:18 PDT 2020


wmi added inline comments.


================
Comment at: llvm/lib/ProfileData/SampleProfWriter.cpp:206
+  switch (Type) {
+  case SecProfileSymbolList:
+    if (auto EC = writeProfileSymbolListSection())
----------------
hoy wrote:
> Why is this separated from `writeOneSection`?
That is somewhat explained in the reply to Wenlei's mail. I want to put a section to an inheritance level when foreseeably new subclasses created in other inheritance branch will not use it. Surely whether SecProfileSymbolList will not be used by other new formats are questionable. I just use it as an example and it will be easy to move the section up.


================
Comment at: llvm/lib/ProfileData/SampleProfWriter.cpp:257
+  // The setting about the section flag should happen before writeOneSection.
+  if (ProfSymList && ProfSymList->toCompress())
+    setToCompressSection(SecProfileSymbolList);
----------------
hoy wrote:
> Can this be moved into `writeProfileSymbolListSection`?
It cannot. Whether the section will be compressed or not has to be decided before markSectionStart is called. 


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89524/new/

https://reviews.llvm.org/D89524



More information about the llvm-commits mailing list