[llvm] [PGO] Add support for writing previous indexed format (PR #84505)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 10:29:16 PST 2024


================
@@ -68,10 +68,18 @@ class InstrProfWriter {
   // Use raw pointer here for the incomplete type object.
   InstrProfRecordWriterTrait *InfoObj;
 
+  // Temporary support for writing the previous version of the format, to enable
+  // some forward compaitibility. Currently this suppresses the writing of the
+  // new vtable names section and header fields.
+  // TODO: Consider enabling this with future version changes as well, to ease
+  // deployment of newer versions of llvm-profdata.
+  bool WritePrevVersion = false;
+
 public:
   InstrProfWriter(bool Sparse = false,
                   uint64_t TemporalProfTraceReservoirSize = 0,
-                  uint64_t MaxTemporalProfTraceLength = 0);
+                  uint64_t MaxTemporalProfTraceLength = 0,
+                  bool WritePrevVersion = true);
----------------
snehasish wrote:

Was your intention to have this default to true or false? I'm ok with true since vtable names isn't fully implemented yet - in that case just make it true on L76 and drop this default in the constructor.  

https://github.com/llvm/llvm-project/pull/84505


More information about the llvm-commits mailing list