[llvm] [MemProf] Extend MemProfUse pass to make use of data access profiles to partition data (PR #151238)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 25 12:13:39 PDT 2025


================
@@ -752,3 +773,58 @@ PreservedAnalyses MemProfUsePass::run(Module &M, ModuleAnalysisManager &AM) {
 
   return PreservedAnalyses::none();
 }
+
+bool MemProfUsePass::annotateGlobalVariables(
+    Module &M, const memprof::DataAccessProfData *DataAccessProf) {
+  if (!AnnotationStaticDataPrefix || M.globals().empty() || !DataAccessProf)
----------------
snehasish wrote:

Can we emit a warning if the user wanted to annotate the static data but the memprof didn't have the info? It would catch mismatched expectations during a build.

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


More information about the llvm-commits mailing list