[llvm] [NFC][StaticDataProfileInfo] Refactor StaticDataProfileInfo::getConstantSectionPrefix and extract analysis based on PGO-counter to be a helper function (PR #162388)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 14 16:11:08 PDT 2025


================
@@ -44,6 +47,20 @@ class StaticDataProfileInfo {
   LLVM_ABI std::optional<uint64_t>
   getConstantProfileCount(const Constant *C) const;
 
+  enum class StaticDataHotness : uint8_t {
+    Cold = 0,
+    LukewarmOrUnknown = 1,
+    Hot = 2,
+  };
+
+  /// Return the hotness of the constant \p C based on its profile count \p
+  /// Count.
+  LLVM_ABI StaticDataHotness getSectionHotnessUsingProfileCount(
----------------
mingmingl-llvm wrote:

done.

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


More information about the llvm-commits mailing list