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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 10:49:20 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);
----------------
teresajohnson wrote:

It was meant to be false - I had it set to true for testing and nothing failed...switched it to false.

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


More information about the llvm-commits mailing list