[llvm] [NFC] ProfileSummaryInfo: use analysis manager mechanisms for invalidation (PR #86086)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 15:25:49 PDT 2024


================
@@ -2157,10 +2159,16 @@ PreservedAnalyses PGOInstrumentationUse::run(Module &M,
     return &FAM.getResult<BlockFrequencyAnalysis>(F);
   };
 
-  auto *PSI = &MAM.getResult<ProfileSummaryAnalysis>(M);
+  auto AbandonAndRefreshPSI = [&MAM](Module &M) {
----------------
mtrofin wrote:

Oh, I misread part of that. So the reason we can't just fetch the PSI here is because we need the data saved in the module (line 1993) to actually materialize it. I think the rest holds: we can just fetch it when needed from the MAM, just like the other analyses, and simplify the API.

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


More information about the llvm-commits mailing list