[llvm] [ProfileData] Introduce SampleProfileFuncOffsetTable (NFC) (PR #205045)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 18:03:48 PDT 2026


================
@@ -908,6 +908,79 @@ class FuncOffsetHashTableInfo {
   }
 };
 
+/// A unified wrapper representing the function offset table.
+///
+/// This class abstracts away the physical representation of the offset table,
+/// which can either be:
+///
+/// - An llvm::DenseMap mapping function GUIDs (or context hashes) to their
+///   profile offsets, populated when reading the array of offsets in
+///   context-sensitive (CS) profiles or version 103 profiles.
+///
+/// - An OnDiskIterableChainedHashTable providing the same mapping directly from
+///   the file in (non-context-sensitive) version 104 profiles.
+///
+/// It exposes a single, type-agnostic lookup interface, shielding the reader
+/// from the underlying container types. To prevent hybrid-state corruption, it
+/// enforces mutually exclusive paths using assertions.
+class SampleProfileFuncOffsetTable {
----------------
kazutakahirata wrote:

Fixed in the latest revision.  Thanks!

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


More information about the llvm-commits mailing list