[PATCH] D16258: [PGO] Profile Summary Index profile writer and reader support

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 10:50:08 PST 2016

vsk added inline comments.

Comment at: include/llvm/ProfileData/InstrProf.h:751
@@ +750,3 @@
+  // Reserved fields for future
+  uint64_t Reserved[5];
+  /// Number of Cutoff entries
I'm not sure about this Reserved field. IMO any new future functionality should come with a format version bump, even if the on-disk layout stays the same. That means we can teach the reader to skip straight to NumEntries for v4 files.

Comment at: lib/ProfileData/InstrProfWriter.cpp:197
@@ +196,3 @@
+    TheSummary->Entries[I].NumBlocks = Res[I].NumBlocks;
+  }
I see. Is it possible to make the Entries array an array of ProfileSummaryEntry? We'd have to make the Cutoff field 64-bit, but it would help keep things in sync. That also lets us use the default copy-constructor here, i.e `TheSummary->Entries[I] = Res[I]`.


More information about the llvm-commits mailing list