[llvm] [SampleProfile] Support Eytzinger layout in SecFuncOffsetTable (PR #213829)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 00:04:24 PDT 2026


================
@@ -1070,9 +1100,27 @@ class SampleProfileFuncOffsetTable {
     return std::nullopt;
   }
 
+  /// Direct read-only array (`ArrayRef`) of function offsets aligned parallel
+  /// to the corresponding Eytzinger name span:
+  ArrayRef<support::ulittle32_t> getFuncOffsets() const {
+    assert(isEytzinger() &&
+           "Cannot call getFuncOffsets() on non-Eytzinger table");
+    return FuncOffsetSpan;
+  }
+
+  size_t getExpectedSize() const {
+    assert(isEytzinger() &&
+           "Cannot call getExpectedSize() on non-Eytzinger table");
+    return NameSpan.size();
+  }
+
+  bool isEytzinger() const { return FuncOffsetSpan.data() != nullptr; }
----------------
kazutakahirata wrote:

Addressed in the latest iteration.

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


More information about the llvm-commits mailing list