[llvm] [MergeFunctions] Preserve instruction-level profile metadata during merging (PR #208009)

Alok Kumar Sharma via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 06:23:07 PDT 2026


================
@@ -198,10 +213,13 @@ class MergeFunctions {
   }
 
   template <typename FuncContainer> bool run(FuncContainer &Functions);
-  DenseMap<Function *, Function *> runOnFunctions(ArrayRef<Function *> F);
+  DenseMap<Function *, Function *>
+  runOnFunctions(ArrayRef<Function *> F, FunctionAnalysisManager *AM = nullptr);
 
   SmallPtrSet<GlobalValue *, 4> &getUsed();
 
+  void setFunctionAnalysisManager(FunctionAnalysisManager *AM) { FAM = AM; }
----------------
alokkrsharma wrote:

Agreed. I’ll refactor the helper APIs to use ModuleAnalysisManager and retrieve FAM through FunctionAnalysisManagerModuleProxy.

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


More information about the llvm-commits mailing list