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

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 18:46:29 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)
----------------
mingmingl-llvm wrote:

done. We can follow up in https://github.com/llvm/llvm-project/pull/151238/files#r2298880473 on whether we also want to check option's `NumOccurrences`.

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


More information about the llvm-commits mailing list